Package org.apache.hadoop.hbase.client
Interface RegionLocator
- All Superinterfaces:
AutoCloseable
,Closeable
- All Known Implementing Classes:
HRegionLocator
Used to view region location information for a single HBase table. Obtain an instance from an
Connection
.- Since:
- 0.99.0
- See Also:
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Clear all the entries in the region location cache.Retrieves all of the regions associated with this table.default byte[][]
Gets the ending row key for every region in the currently open table.getName()
Gets the fully qualified table name instance of this table.default HRegionLocation
getRegionLocation
(byte[] row) Finds the region on which the given row is being served.default HRegionLocation
getRegionLocation
(byte[] row, boolean reload) Finds the region on which the given row is being served.default HRegionLocation
getRegionLocation
(byte[] row, int replicaId) Finds the region with the given replica id on which the given row is being served.getRegionLocation
(byte[] row, int replicaId, boolean reload) Finds the region with the given replica id on which the given row is being served.default 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 Pair<byte[][],
byte[][]> Gets the starting and ending row keys for every region in the currently open table.default byte[][]
Gets the starting row key for every region in the currently open table.
-
Field Details
-
LOCATOR_META_REPLICAS_MODE
Configuration for Region Locator's mode when meta replica is configured. Valid values are: HedgedRead, LoadBalance, None- See Also:
-
LOCATOR_META_REPLICAS_MODE_LOADBALANCE_SELECTOR
Configuration for meta replica selector when Region Locator's LoadBalance mode is configured. The default value is org.apache.hadoop.hbase.client.CatalogReplicaLoadBalanceSimpleSelector.- See Also:
-
-
Method Details
-
getRegionLocation
Finds the region on which the given row is being served. Does not reload the cache.- Parameters:
row
- Row to find.- Returns:
- Location of the row.
- Throws:
IOException
- if a remote or network exception occurs
-
getRegionLocation
Finds 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:
- Location of the row.
- Throws:
IOException
- if a remote or network exception occurs
-
getRegionLocation
Finds the region with the given replica id on which the given row is being served.- Parameters:
row
- Row to find.replicaId
- the replica id- Returns:
- Location of the row.
- Throws:
IOException
- if a remote or network exception occurs
-
getRegionLocation
Finds the region with the given replica id on which the given row is being served.- Parameters:
row
- Row to find.replicaId
- the replica idreload
- true to reload information or false to use cached information- Returns:
- Location of the row.
- Throws:
IOException
- if a remote or network exception occurs
-
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.
- Throws:
IOException
- if a remote or network exception occurs
-
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.
- Throws:
IOException
- if a remote or network exception occurs
-
clearRegionLocationCache
void clearRegionLocationCache()Clear all the entries in the region location cache. This may cause performance issue so use it with caution. -
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. - Throws:
IOException
- if a remote or network exception occurs
-
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
- Throws:
IOException
- if a remote or network exception occurs
-
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
- Throws:
IOException
- if a remote or network exception occurs
-
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
- Throws:
IOException
- if a remote or network exception occurs
-
getName
Gets the fully qualified table name instance of this table.
-