Umeshkumar9414 commented on code in PR #8237:
URL: https://github.com/apache/hbase/pull/8237#discussion_r3248742817


##########
hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncTableRegionLocatorImpl.java:
##########
@@ -81,6 +83,39 @@ public CompletableFuture<List<HRegionLocation>> 
getRegionLocations(byte[] row, b
       .thenApply(locs -> Arrays.asList(locs.getRegionLocations()));
   }
 
+  @Override
+  public CompletableFuture<List<HRegionLocation>> 
getRegionLocationsPage(byte[] startKey,
+    int limit) {
+    return tracedFuture(() -> {
+      if (TableName.isMetaTableName(tableName)) {
+        CompletableFuture<List<HRegionLocation>> failed = new 
CompletableFuture<>();
+        failed.completeExceptionally(
+          new IOException("getRegionLocationsPage(startKey, limit) is not 
supported for hbase:meta;"
+            + " use getRegionLocation(EMPTY_START_ROW) instead."));
+        return failed;
+      }
+      int effectiveLimit = limit > 0
+        ? limit
+        : conn.getConfiguration().getInt(HConstants.HBASE_META_SCANNER_CACHING,
+          HConstants.DEFAULT_HBASE_META_SCANNER_CACHING);
+      CompletableFuture<List<HRegionLocation>> future =
+        
ClientMetaTableAccessor.getTableHRegionLocations(conn.getTable(TableName.META_TABLE_NAME),
+          tableName, startKey, effectiveLimit);
+      addListener(future, (locs, error) -> {
+        if (error != null || locs == null) {
+          return;
+        }

Review Comment:
   what if there is error ?



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