@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
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.
|
byte[][] |
getStartKeys()
Gets the starting row key for every region in the currently open table.
|
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 occurspublic TableName getName()
RegionLocator
getName
in interface RegionLocator
public org.apache.hadoop.conf.Configuration getConfiguration()
Copyright © 2007–2019 Cloudera. All rights reserved.