private CompletableFuture<List<HRegionLocation>> getTableHRegionLocations(TableName tableName) {
    if (TableName.META_TABLE_NAME.equals(tableName)) {
      CompletableFuture<List<HRegionLocation>> future = new CompletableFuture<>();
      addListener(connection.registry.getMetaRegionLocations(), (metaRegions, err) -> {
        if (err != null) {
          future.completeExceptionally(err);
        } else if (
          metaRegions == null || metaRegions.isEmpty()
            || metaRegions.getDefaultRegionLocation() == null
        ) {
          future.completeExceptionally(new IOException("meta region does not found"));
        } else {
          future.complete(Collections.singletonList(metaRegions.getDefaultRegionLocation()));
        }
      });
      return future;
    } else {
      // For non-meta table, we fetch all locations by scanning hbase:meta table
      return ClientMetaTableAccessor.getTableHRegionLocations(metaTable, tableName);
    }
  }
List all region locations for the specific table.
hbase-client/src/main/java/org/apache/hadoop/hbase/client/RawAsyncHBaseAdmin.java