@InterfaceAudience.Private @InterfaceStability.Stable 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 ClusterConnection |
connection |
private TableName |
tableName |
Constructor and Description |
---|
HRegionLocator(TableName tableName,
ClusterConnection connection) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
List<HRegionLocation> |
getAllRegionLocations()
Retrieves all of the regions associated with this table.
|
org.apache.hadoop.conf.Configuration |
getConfiguration() |
byte[][] |
getEndKeys()
Gets the ending row key for every region in the currently open table.
|
TableName |
getName()
Gets the fully qualified table name instance of this table.
|
HRegionLocation |
getRegionLocation(byte[] row)
Finds the region on which the given row is being served.
|
HRegionLocation |
getRegionLocation(byte[] row,
boolean reload)
Finds the region on which the given row is being served.
|
Pair<byte[][],byte[][]> |
getStartEndKeys()
Gets the starting and ending row keys for every region in the currently
open table.
|
(package private) Pair<byte[][],byte[][]> |
getStartEndKeys(List<RegionLocations> regions) |
byte[][] |
getStartKeys()
Gets the starting row key for every region in the currently open table.
|
(package private) List<RegionLocations> |
listRegionLocations() |
private final TableName tableName
private final ClusterConnection connection
public HRegionLocator(TableName tableName, ClusterConnection connection)
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
public HRegionLocation getRegionLocation(byte[] row) throws IOException
getRegionLocation
in interface RegionLocator
row
- Row to find.IOException
- if a remote or network exception occurspublic HRegionLocation getRegionLocation(byte[] row, boolean reload) throws IOException
getRegionLocation
in interface RegionLocator
row
- 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
RegionLocator
getAllRegionLocations
in interface RegionLocator
List
of all regions associated with this table.IOException
- if a remote or network exception occurspublic byte[][] getStartKeys() throws IOException
This is mainly useful for the MapReduce integration.
getStartKeys
in interface RegionLocator
IOException
- if a remote or network exception occurspublic byte[][] getEndKeys() throws IOException
This is mainly useful for the MapReduce integration.
getEndKeys
in interface RegionLocator
IOException
- if a remote or network exception occurspublic Pair<byte[][],byte[][]> getStartEndKeys() throws IOException
This is mainly useful for the MapReduce integration.
getStartEndKeys
in interface RegionLocator
IOException
- if a remote or network exception occursPair<byte[][],byte[][]> getStartEndKeys(List<RegionLocations> regions)
public TableName getName()
RegionLocator
getName
in interface RegionLocator
List<RegionLocations> listRegionLocations() throws IOException
IOException
public org.apache.hadoop.conf.Configuration getConfiguration()
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.