@InterfaceAudience.Private public class HRegionLocator extends Object implements RegionLocator
RegionLocator. Used to view region location information for a single
HBase table. Lightweight. Get as needed and just close when done. Instances of this class SHOULD
NOT be constructed directly. Obtain an instance via Connection. See
ConnectionFactory class comment for an example of how.
This class is thread safe| Modifier and Type | Field and Description |
|---|---|
private ConnectionImplementation |
connection |
private TableName |
tableName |
| Constructor and Description |
|---|
HRegionLocator(TableName tableName,
ConnectionImplementation connection) |
| Modifier and Type | Method and Description |
|---|---|
void |
clearRegionLocationCache()
Clear all the entries in the region location cache.
|
void |
close() |
List<HRegionLocation> |
getAllRegionLocations()
Retrieves all of the regions associated with this table.
|
TableName |
getName()
Gets the fully qualified table name instance of this table.
|
HRegionLocation |
getRegionLocation(byte[] row,
int replicaId,
boolean reload)
Finds the region with the given replica id on which the given row is being served.
|
List<HRegionLocation> |
getRegionLocations(byte[] row,
boolean reload)
Find all the replicas for the region on which the given row is being served.
|
private List<RegionLocations> |
listRegionLocations() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetEndKeys, getRegionLocation, getRegionLocation, getRegionLocation, getRegionLocations, getStartEndKeys, getStartKeysprivate final ConnectionImplementation connection
public HRegionLocator(TableName tableName, ConnectionImplementation connection)
public void close() throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic HRegionLocation getRegionLocation(byte[] row, int replicaId, boolean reload) throws IOException
RegionLocatorgetRegionLocation in interface RegionLocatorrow - Row to find.replicaId - the replica idreload - true to reload information or false to use cached informationIOException - if a remote or network exception occurspublic List<HRegionLocation> getRegionLocations(byte[] row, boolean reload) throws IOException
RegionLocatorgetRegionLocations in interface RegionLocatorrow - Row to find.reload - true to reload information or false to use cached informationIOException - if a remote or network exception occurspublic List<HRegionLocation> getAllRegionLocations() throws IOException
RegionLocatorreload
parameter.
Notice that the location for region replicas other than the default replica are also returned.getAllRegionLocations in interface RegionLocatorList of all regions associated with this table.IOException - if a remote or network exception occurspublic void clearRegionLocationCache()
RegionLocatorclearRegionLocationCache in interface RegionLocatorpublic TableName getName()
RegionLocatorgetName in interface RegionLocatorprivate List<RegionLocations> listRegionLocations() throws IOException
IOExceptionCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.