@InterfaceAudience.Private public final class ClientMetaTableAccessor extends Object
hbase:meta
.CatalogFamilyFormat
Modifier and Type | Class and Description |
---|---|
static interface |
ClientMetaTableAccessor.CloseableVisitor
Implementations 'visit' a catalog table row but with close() at the end.
|
(package private) static class |
ClientMetaTableAccessor.CollectAllVisitor
Collects all returned.
|
private static class |
ClientMetaTableAccessor.CollectingVisitor<T>
A
ClientMetaTableAccessor.Visitor that collects content out of passed Result . |
(package private) static class |
ClientMetaTableAccessor.CollectRegionLocationsVisitor |
private static class |
ClientMetaTableAccessor.MetaTableScanResultConsumer |
static class |
ClientMetaTableAccessor.QueryType |
static interface |
ClientMetaTableAccessor.Visitor
Implementations 'visit' a catalog table row.
|
Modifier and Type | Field and Description |
---|---|
private static org.slf4j.Logger |
LOG |
Modifier | Constructor and Description |
---|---|
private |
ClientMetaTableAccessor() |
Modifier and Type | Method and Description |
---|---|
private static Scan |
getMetaScan(AsyncTable<?> metaTable,
int rowUpperLimit) |
static CompletableFuture<Optional<HRegionLocation>> |
getRegionLocation(AsyncTable<?> metaTable,
byte[] regionName)
Returns the HRegionLocation from meta for the given region
|
private static Optional<RegionLocations> |
getRegionLocations(Result r)
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 name
|
static CompletableFuture<List<HRegionLocation>> |
getTableHRegionLocations(AsyncTable<AdvancedScanResultConsumer> metaTable,
TableName tableName)
Used to get all region locations for the specific table
|
private 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 type
|
static CompletableFuture<Optional<TableState>> |
getTableState(AsyncTable<?> metaTable,
TableName tableName) |
private static Optional<TableState> |
getTableState(Result r) |
static byte[] |
getTableStopRowForMeta(TableName tableName,
ClientMetaTableAccessor.QueryType type)
Returns stop row for scanning META according to query type
|
private 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) |
private static final org.slf4j.Logger LOG
private ClientMetaTableAccessor()
public static CompletableFuture<Boolean> tableExists(AsyncTable<?> metaTable, TableName tableName)
public static CompletableFuture<Optional<TableState>> getTableState(AsyncTable<?> metaTable, TableName tableName)
public static CompletableFuture<Optional<HRegionLocation>> getRegionLocation(AsyncTable<?> metaTable, byte[] regionName)
public static CompletableFuture<Optional<HRegionLocation>> getRegionLocationWithEncodedName(AsyncTable<?> metaTable, byte[] encodedRegionName)
private static Optional<TableState> getTableState(Result r) throws IOException
IOException
public static CompletableFuture<List<HRegionLocation>> getTableHRegionLocations(AsyncTable<AdvancedScanResultConsumer> metaTable, TableName tableName)
metaTable
- scanner over meta tabletableName
- table we're looking for, can be null for getting all regionsCompletableFuture
.private static CompletableFuture<List<Pair<RegionInfo,ServerName>>> getTableRegionsAndLocations(AsyncTable<AdvancedScanResultConsumer> metaTable, TableName tableName, boolean excludeOfflinedSplitParents)
metaTable
- scanner over meta tabletableName
- table we're looking for, can be null for getting all regionsexcludeOfflinedSplitParents
- don't return split parentsCompletableFuture
.private static CompletableFuture<Void> scanMeta(AsyncTable<AdvancedScanResultConsumer> metaTable, TableName tableName, ClientMetaTableAccessor.QueryType type, ClientMetaTableAccessor.Visitor visitor)
metaTable
- scanner over meta tabletableName
- table within we scantype
- scanned part of metavisitor
- Visitor invoked against each rowprivate static CompletableFuture<Void> scanMeta(AsyncTable<AdvancedScanResultConsumer> metaTable, byte[] startRow, byte[] stopRow, ClientMetaTableAccessor.QueryType type, int maxRows, ClientMetaTableAccessor.Visitor visitor)
metaTable
- scanner over meta tablestartRow
- Where to start the scanstopRow
- Where to stop the scantype
- scanned part of metamaxRows
- maximum rows to returnvisitor
- Visitor invoked against each rowprivate static Scan getMetaScan(AsyncTable<?> metaTable, int rowUpperLimit)
private static Optional<RegionLocations> getRegionLocations(Result r)
public static byte[] getTableStartRowForMeta(TableName tableName, ClientMetaTableAccessor.QueryType type)
public static byte[] getTableStopRowForMeta(TableName tableName, ClientMetaTableAccessor.QueryType type)
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.