Package org.apache.hadoop.hbase.client
Interface AsyncTableRegionLocator
- All Known Implementing Classes:
AsyncTableRegionLocatorImpl
The asynchronous version of RegionLocator.
Usually the implementations will not throw any exception directly, you need to get the exception
from the returned CompletableFuture
.
- Since:
- 2.0.0
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Clear all the entries in the region location cache.Retrieves all of the regions associated with this table.default CompletableFuture<List<byte[]>>
Gets the ending row key for every region in the currently open table.getName()
Gets the fully qualified table name instance of the table whose region we want to locate.default CompletableFuture<HRegionLocation>
getRegionLocation
(byte[] row) Finds the region on which the given row is being served.default CompletableFuture<HRegionLocation>
getRegionLocation
(byte[] row, boolean reload) Finds the region on which the given row is being served.default CompletableFuture<HRegionLocation>
getRegionLocation
(byte[] row, int replicaId) Finds the region with the givenreplicaId
on which the given row is being served.getRegionLocation
(byte[] row, int replicaId, boolean reload) Finds the region with the givenreplicaId
on which the given row is being served.default CompletableFuture<List<HRegionLocation>>
getRegionLocations
(byte[] row) Find all the replicas for the region on which the given row is being served.getRegionLocations
(byte[] row, boolean reload) Find all the replicas for the region on which the given row is being served.default CompletableFuture<List<Pair<byte[],
byte[]>>> Gets the starting and ending row keys for every region in the currently open table.default CompletableFuture<List<byte[]>>
Gets the starting row key for every region in the currently open table.
-
Method Details
-
getName
Gets the fully qualified table name instance of the table whose region we want to locate. -
getRegionLocation
Finds the region on which the given row is being served. Does not reload the cache. Returns the location of the region to which the row belongs.- Parameters:
row
- Row to find.
-
getRegionLocation
Finds the region on which the given row is being served. Returns the location of the region to which the row belongs.- Parameters:
row
- Row to find.reload
- true to reload information or false to use cached information
-
getRegionLocation
Finds the region with the givenreplicaId
on which the given row is being served. Returns the location of the region with the givenreplicaId
to which the row belongs.- Parameters:
row
- Row to find.replicaId
- the replica id of the region
-
getRegionLocation
Finds the region with the givenreplicaId
on which the given row is being served. Returns the location of the region with the givenreplicaId
to which the row belongs.- Parameters:
row
- Row to find.replicaId
- the replica id of the regionreload
- true to reload information or false to use cached information
-
getRegionLocations
Find all the replicas for the region on which the given row is being served.- Parameters:
row
- Row to find.- Returns:
- Locations for all the replicas of the row.
-
getRegionLocations
Find all the replicas for the region on which the given row is being served.- Parameters:
row
- Row to find.reload
- true to reload information or false to use cached information- Returns:
- Locations for all the replicas of the row.
-
getAllRegionLocations
Retrieves all of the regions associated with this table. Usually we will go to meta table directly in this method so there is noreload
parameter. Notice that the location for region replicas other than the default replica are also returned.- Returns:
- a
List
of all regions associated with this table.
-
getStartKeys
Gets the starting row key for every region in the currently open table.This is mainly useful for the MapReduce integration.
- Returns:
- Array of region starting row keys
-
getEndKeys
Gets the ending row key for every region in the currently open table.This is mainly useful for the MapReduce integration.
- Returns:
- Array of region ending row keys
-
getStartEndKeys
Gets the starting and ending row keys for every region in the currently open table.This is mainly useful for the MapReduce integration.
- Returns:
- Pair of arrays of region starting and ending row keys
-
clearRegionLocationCache
void clearRegionLocationCache()Clear all the entries in the region location cache. This may cause performance issue so use it with caution.
-