bbeaudreault commented on code in PR #4335:
URL: https://github.com/apache/hbase/pull/4335#discussion_r848740986


##########
hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncTableRegionLocatorImpl.java:
##########
@@ -62,7 +62,10 @@ public CompletableFuture<List<HRegionLocation>> 
getAllRegionLocations() {
           .thenApply(locs -> Arrays.asList(locs.getRegionLocations()));
       }
       return ClientMetaTableAccessor
-        .getTableHRegionLocations(conn.getTable(TableName.META_TABLE_NAME), 
tableName);
+        .getTableHRegionLocations(conn.getTable(TableName.META_TABLE_NAME), 
tableName)
+        .whenComplete((locs, error) -> {

Review Comment:
   No problem, thank you for verifying in tests. I think now that you are using 
addListener, you are correct. This is part of the benefit of addListener, but 
still better to avoid the exception altogether. I believe in your original 
implementation with your own `withComplete` call it would have resulted in an 
NPE to the user (but I could be wrong, it's been a while).



-- 
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