@Override
  public CompletableFuture<List<RegionInfo>> getRegions(TableName tableName) {
    if (tableName.equals(META_TABLE_NAME)) {
      return connection.registry.getMetaRegionLocations()
        .thenApply(locs -> Stream.of(locs.getRegionLocations()).map(HRegionLocation::getRegion)
          .collect(Collectors.toList()));
    } else {
      return ClientMetaTableAccessor.getTableHRegionLocations(metaTable, tableName).thenApply(
        locs -> locs.stream().map(HRegionLocation::getRegion).collect(Collectors.toList()));
    }
  }
Utility for completing passed TableState {@link CompletableFuture} <code>future</code> using
passed parameters. Sets error or boolean result ('true' if table matches the passed-in
targetState).
hbase-client/src/main/java/org/apache/hadoop/hbase/client/RawAsyncHBaseAdmin.java