Package org.apache.hadoop.hbase
Class ClientMetaTableAccessor
java.lang.Object
org.apache.hadoop.hbase.ClientMetaTableAccessor
The (asynchronous) meta table accessor used at client side. Used to read/write region and
 assignment information store in 
hbase:meta.- Since:
- 2.0.0
- See Also:
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic interfaceImplementations 'visit' a catalog table row but with close() at the end.(package private) static classCollects all returned.private static classAClientMetaTableAccessor.Visitorthat collects content out of passedResult.(package private) static classprivate static final classstatic enumstatic interfaceImplementations 'visit' a catalog table row.
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprivate static ScangetMetaScan(AsyncTable<?> metaTable, int rowUpperLimit) static CompletableFuture<Optional<HRegionLocation>>getRegionLocation(AsyncTable<?> metaTable, byte[] regionName) Returns the HRegionLocation from meta for the given regionprivate static Optional<RegionLocations>Returns an HRegionLocationList extracted from the result.static CompletableFuture<Optional<HRegionLocation>>getRegionLocationWithEncodedName(AsyncTable<?> metaTable, byte[] encodedRegionName) Returns the HRegionLocation from meta for the given encoded region namestatic CompletableFuture<List<HRegionLocation>>getTableHRegionLocations(AsyncTable<AdvancedScanResultConsumer> metaTable, TableName tableName) Used to get all region locations for the specific tableprivate static CompletableFuture<List<Pair<RegionInfo,ServerName>>> getTableRegionsAndLocations(AsyncTable<AdvancedScanResultConsumer> metaTable, TableName tableName, boolean excludeOfflinedSplitParents) Used to get table regions' info and server.static byte[]getTableStartRowForMeta(TableName tableName, ClientMetaTableAccessor.QueryType type) Returns start row for scanning META according to query typestatic CompletableFuture<Optional<TableState>>getTableState(AsyncTable<?> metaTable, TableName tableName) private static Optional<TableState>static byte[]getTableStopRowForMeta(TableName tableName, ClientMetaTableAccessor.QueryType type) Returns stop row for scanning META according to query typeprivate static CompletableFuture<Void>scanMeta(AsyncTable<AdvancedScanResultConsumer> metaTable, byte[] startRow, byte[] stopRow, ClientMetaTableAccessor.QueryType type, int maxRows, ClientMetaTableAccessor.Visitor visitor) Performs a scan of META table for given table.private static CompletableFuture<Void>scanMeta(AsyncTable<AdvancedScanResultConsumer> metaTable, TableName tableName, ClientMetaTableAccessor.QueryType type, ClientMetaTableAccessor.Visitor visitor) Performs a scan of META table for given table.static CompletableFuture<Boolean>tableExists(AsyncTable<?> metaTable, TableName tableName) 
- 
Field Details- 
LOG
 
- 
- 
Constructor Details- 
ClientMetaTableAccessorprivate ClientMetaTableAccessor()
 
- 
- 
Method Details- 
tableExists
- 
getTableStatepublic static CompletableFuture<Optional<TableState>> getTableState(AsyncTable<?> metaTable, TableName tableName) 
- 
getRegionLocationpublic static CompletableFuture<Optional<HRegionLocation>> getRegionLocation(AsyncTable<?> metaTable, byte[] regionName) Returns the HRegionLocation from meta for the given region
- 
getRegionLocationWithEncodedNamepublic static CompletableFuture<Optional<HRegionLocation>> getRegionLocationWithEncodedName(AsyncTable<?> metaTable, byte[] encodedRegionName) Returns the HRegionLocation from meta for the given encoded region name
- 
getTableState- Throws:
- IOException
 
- 
getTableHRegionLocationspublic static CompletableFuture<List<HRegionLocation>> getTableHRegionLocations(AsyncTable<AdvancedScanResultConsumer> metaTable, TableName tableName) Used to get all region locations for the specific table- Parameters:
- metaTable- scanner over meta table
- tableName- table we're looking for, can be null for getting all regions
- Returns:
- the list of region locations. The return value will be wrapped by a
         CompletableFuture.
 
- 
getTableRegionsAndLocationsprivate static CompletableFuture<List<Pair<RegionInfo,ServerName>>> getTableRegionsAndLocations(AsyncTable<AdvancedScanResultConsumer> metaTable, TableName tableName, boolean excludeOfflinedSplitParents) Used to get table regions' info and server.- Parameters:
- metaTable- scanner over meta table
- tableName- table we're looking for, can be null for getting all regions
- excludeOfflinedSplitParents- don't return split parents
- Returns:
- the list of regioninfos and server. The return value will be wrapped by a
         CompletableFuture.
 
- 
scanMetaprivate static CompletableFuture<Void> scanMeta(AsyncTable<AdvancedScanResultConsumer> metaTable, TableName tableName, ClientMetaTableAccessor.QueryType type, ClientMetaTableAccessor.Visitor visitor) Performs a scan of META table for given table.- Parameters:
- metaTable- scanner over meta table
- tableName- table within we scan
- type- scanned part of meta
- visitor- Visitor invoked against each row
 
- 
scanMetaprivate static CompletableFuture<Void> scanMeta(AsyncTable<AdvancedScanResultConsumer> metaTable, byte[] startRow, byte[] stopRow, ClientMetaTableAccessor.QueryType type, int maxRows, ClientMetaTableAccessor.Visitor visitor) Performs a scan of META table for given table.- Parameters:
- metaTable- scanner over meta table
- startRow- Where to start the scan
- stopRow- Where to stop the scan
- type- scanned part of meta
- maxRows- maximum rows to return
- visitor- Visitor invoked against each row
 
- 
getMetaScan
- 
getRegionLocationsReturns an HRegionLocationList extracted from the result.
- 
getTableStartRowForMetapublic static byte[] getTableStartRowForMeta(TableName tableName, ClientMetaTableAccessor.QueryType type) Returns start row for scanning META according to query type
- 
getTableStopRowForMetapublic static byte[] getTableStopRowForMeta(TableName tableName, ClientMetaTableAccessor.QueryType type) Returns stop row for scanning META according to query type
 
-