@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
构造器和说明 |
---|
HRegionLocator(TableName tableName,
ClusterConnection connection) |
限定符和类型 | 方法和说明 |
---|---|
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
在接口中 Closeable
close
在接口中 AutoCloseable
IOException
public HRegionLocation getRegionLocation(byte[] row) throws IOException
getRegionLocation
在接口中 RegionLocator
row
- Row to find.IOException
- if a remote or network exception occurspublic HRegionLocation getRegionLocation(byte[] row, boolean reload) throws IOException
getRegionLocation
在接口中 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
在接口中 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
在接口中 RegionLocator
IOException
- if a remote or network exception occurspublic byte[][] getEndKeys() throws IOException
This is mainly useful for the MapReduce integration.
getEndKeys
在接口中 RegionLocator
IOException
- if a remote or network exception occurspublic Pair<byte[][],byte[][]> getStartEndKeys() throws IOException
This is mainly useful for the MapReduce integration.
getStartEndKeys
在接口中 RegionLocator
IOException
- if a remote or network exception occurspublic TableName getName()
RegionLocator
getName
在接口中 RegionLocator
public org.apache.hadoop.conf.Configuration getConfiguration()
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.