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


##########
hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncTableRegionLocatorImpl.java:
##########
@@ -65,13 +65,17 @@ public CompletableFuture<List<HRegionLocation>> 
getAllRegionLocations() {
       CompletableFuture<List<HRegionLocation>> future = new 
CompletableFuture<>();
       addListener(ClientMetaTableAccessor.getTableHRegionLocations(conn
           .getTable(TableName.META_TABLE_NAME), tableName), (locs, error) -> {
-        if (error != null) {
-          future.completeExceptionally(error);
-          return;
-        }
-        locs.forEach(loc -> 
conn.getLocator().getNonMetaRegionLocator().addLocationToCache(loc));
-        future.complete(locs);
-      });
+          if (error != null) {
+            future.completeExceptionally(error);
+            return;
+          }
+          try {
+            locs.forEach(loc -> conn.getLocator()
+              .getNonMetaRegionLocator().addLocationToCache(loc));

Review Comment:
   > We also use it in other place, in our own code, for example, the 
getStartEndKeys is implemented based on getAllRegionLocations. I do not think 
it is a good idea to fail this operation when we fail to add the result to 
cache? The caller will be confused...
   > 
   > I think adding a special method to fill the cache is a possible solution. 
You can start a discussion thread on the dev and user list to discuss it.
   > 
   > Thanks.
   
   a little awkward, for some weird unknown reasons, I can't send emails to the 
dev list ...
   
   But it's fine. I think the solution above is great. I'll address it. Thanks 
all for the reviewing and discussion. @bbeaudreault @Apache9 



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