@@ -715,7 +715,7 @@ public CompletableFuture<Boolean> isTableDisabled(TableName tableName) {
715715 @ Override
716716 public CompletableFuture <Boolean > isTableAvailable (TableName tableName ) {
717717 if (TableName .isMetaTableName (tableName )) {
718- return connection .registry .getMetaRegionLocation ().thenApply (locs -> Stream
718+ return connection .registry .getMetaRegionLocations ().thenApply (locs -> Stream
719719 .of (locs .getRegionLocations ()).allMatch (loc -> loc != null && loc .getServerName () != null ));
720720 }
721721 CompletableFuture <Boolean > future = new CompletableFuture <>();
@@ -853,7 +853,7 @@ public CompletableFuture<List<RegionInfo>> getRegions(ServerName serverName) {
853853 @ Override
854854 public CompletableFuture <List <RegionInfo >> getRegions (TableName tableName ) {
855855 if (tableName .equals (META_TABLE_NAME )) {
856- return connection .registry .getMetaRegionLocation ()
856+ return connection .registry .getMetaRegionLocations ()
857857 .thenApply (locs -> Stream .of (locs .getRegionLocations ()).map (HRegionLocation ::getRegion )
858858 .collect (Collectors .toList ()));
859859 } else {
@@ -1081,8 +1081,9 @@ private CompletableFuture<List<HRegionLocation>> getTableHRegionLocations(TableN
10811081 if (TableName .META_TABLE_NAME .equals (tableName )) {
10821082 CompletableFuture <List <HRegionLocation >> future = new CompletableFuture <>();
10831083 // For meta table, we use zk to fetch all locations.
1084- AsyncRegistry registry = AsyncRegistryFactory .getRegistry (connection .getConfiguration ());
1085- addListener (registry .getMetaRegionLocation (), (metaRegions , err ) -> {
1084+ ConnectionRegistry registry = ConnectionRegistryFactory .getRegistry (
1085+ connection .getConfiguration ());
1086+ addListener (registry .getMetaRegionLocations (), (metaRegions , err ) -> {
10861087 if (err != null ) {
10871088 future .completeExceptionally (err );
10881089 } else if (metaRegions == null || metaRegions .isEmpty () ||
@@ -1110,7 +1111,7 @@ private CompletableFuture<Void> compact(TableName tableName, byte[] columnFamily
11101111
11111112 switch (compactType ) {
11121113 case MOB :
1113- addListener (connection .registry .getMasterAddress (), (serverName , err ) -> {
1114+ addListener (connection .registry .getActiveMaster (), (serverName , err ) -> {
11141115 if (err != null ) {
11151116 future .completeExceptionally (err );
11161117 return ;
@@ -2349,7 +2350,7 @@ CompletableFuture<HRegionLocation> getRegionLocation(byte[] regionNameOrEncodedR
23492350 String encodedName = Bytes .toString (regionNameOrEncodedRegionName );
23502351 if (encodedName .length () < RegionInfo .MD5_HEX_LENGTH ) {
23512352 // old format encodedName, should be meta region
2352- future = connection .registry .getMetaRegionLocation ()
2353+ future = connection .registry .getMetaRegionLocations ()
23532354 .thenApply (locs -> Stream .of (locs .getRegionLocations ())
23542355 .filter (loc -> loc .getRegion ().getEncodedName ().equals (encodedName )).findFirst ());
23552356 } else {
@@ -2360,7 +2361,7 @@ CompletableFuture<HRegionLocation> getRegionLocation(byte[] regionNameOrEncodedR
23602361 RegionInfo regionInfo =
23612362 MetaTableAccessor .parseRegionInfoFromRegionName (regionNameOrEncodedRegionName );
23622363 if (regionInfo .isMetaRegion ()) {
2363- future = connection .registry .getMetaRegionLocation ()
2364+ future = connection .registry .getMetaRegionLocations ()
23642365 .thenApply (locs -> Stream .of (locs .getRegionLocations ())
23652366 .filter (loc -> loc .getRegion ().getReplicaId () == regionInfo .getReplicaId ())
23662367 .findFirst ());
@@ -2933,7 +2934,7 @@ public CompletableFuture<CompactionState> getCompactionState(TableName tableName
29332934
29342935 switch (compactType ) {
29352936 case MOB :
2936- addListener (connection .registry .getMasterAddress (), (serverName , err ) -> {
2937+ addListener (connection .registry .getActiveMaster (), (serverName , err ) -> {
29372938 if (err != null ) {
29382939 future .completeExceptionally (err );
29392940 return ;
0 commit comments