Apache9 commented on a change in pull request #2652: URL: https://github.com/apache/hbase/pull/2652#discussion_r523297700
########## File path: hbase-client/src/main/java/org/apache/hadoop/hbase/client/ZKConnectionRegistry.java ########## @@ -138,8 +141,15 @@ private void getMetaRegionLocation(CompletableFuture<RegionLocations> future, if (metaReplicaZNodes.isEmpty()) { future.completeExceptionally(new IOException("No meta znode available")); } - HRegionLocation[] locs = new HRegionLocation[metaReplicaZNodes.size()]; - MutableInt remaining = new MutableInt(locs.length); + // Note, the list of metaReplicaZNodes may be discontiguous regards replicaId; i.e. we may have + // a znode for the default -- replicaId=0 -- and perhaps replicaId '2' but be could be missing + // znode for replicaId '1'. This is a transient condition. Because of this we are careful + // accumulating locations. We use a Map so retries overwrite rather than aggregate and the + // Map sorts just to be kind to further processing. The Map will retain the discontinuity on + // replicaIds but on completion (of the future), the Map values are passed to the + // RegionLocations constructor which knows how to deal with discontinuities. + final Map<Integer, HRegionLocation> locs = new TreeMap(); Review comment: This will generate a generic type warning, please use `new TreeMap<>()` ########## File path: hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestZKConnectionRegistry.java ########## @@ -101,8 +116,8 @@ public void testIndependentZKConnections() throws IOException { otherConf.set(HConstants.ZOOKEEPER_QUORUM, MiniZooKeeperCluster.HOST); try (ZKConnectionRegistry otherRegistry = new ZKConnectionRegistry(otherConf)) { ReadOnlyZKClient zk2 = otherRegistry.getZKClient(); - assertNotSame("Using a different configuration / quorum should result in different " + - "backing zk connection.", zk1, zk2); + assertNotSame("Using a different configuration / quorum should result in different " + + "backing zk connection.", zk1, zk2); Review comment: I recall that you mentioned many times that the operator must be at the end of a line so I changed my formatter config to do this, so now you prefer the operator at the start of a line? I'm fine with both, just want to know which one do you want, or it is not important? ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org