Apache9 commented on code in PR #4442:
URL: https://github.com/apache/hbase/pull/4442#discussion_r876509383


##########
hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncNonMetaRegionLocator.java:
##########
@@ -50,6 +50,7 @@
 import java.util.concurrent.TimeUnit;
 import org.apache.commons.lang3.ObjectUtils;
 import org.apache.hadoop.hbase.CatalogFamilyFormat;
+import org.apache.hadoop.hbase.CatalogReplicaMode;

Review Comment:
   This is because we move CatalogReplicaMode to another package?



##########
hbase-client/src/main/java/org/apache/hadoop/hbase/ClientMetaTableAccessor.java:
##########
@@ -257,7 +259,37 @@ private static CompletableFuture<Void> 
scanMeta(AsyncTable<AdvancedScanResultCon
     }
 
     CompletableFuture<Void> future = new CompletableFuture<Void>();
-    metaTable.scan(scan, new MetaTableScanResultConsumer(rowUpperLimit, 
visitor, future));
+    // Get the region locator's meta replica mode.
+    CatalogReplicaMode metaReplicaMode = 
CatalogReplicaMode.fromString(metaTable.getConfiguration()
+      .get(LOCATOR_META_REPLICAS_MODE, CatalogReplicaMode.NONE.toString()));
+
+    if (metaReplicaMode == CatalogReplicaMode.LOAD_BALANCE) {
+      addListener(metaTable.getDescriptor(), (desc, error) -> {
+        if (error != null) {
+          LOG.warn("Failed to get meta table descriptotr, error={}", error);

Review Comment:
   Here we do not want to log the stacktrace so we use error={}?



##########
hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestMetaRegionReplicaReplication.java:
##########
@@ -477,7 +495,7 @@ public void testHBaseMetaReplicaGets() throws Exception {
 
       // There are read requests increase for primary meta replica.
       // For rest of meta replicas, there is no change as regionMove will tell 
the new location
-      primaryIncreaseReplicaNoChange(readReqsForMetaReplicasAfterGet,
+      
primaryIncreaseReplicaNoChange(readReqsForMetaReplicasAfterGetAllLocations,

Review Comment:
   Mind explaining this UT a bit? I can not get the point here why there is no 
change, since we have moved a region?



##########
hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestMetaRegionReplicaReplication.java:
##########
@@ -385,6 +386,12 @@ private void primaryNoChangeReplicaIncrease(final long[] 
before, final long[] af
     }
   }
 
+  private void PrimaryIncreaseReplicaIncrease(final long[] before, final 
long[] after) {

Review Comment:
   the leading char should be lower case :)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to