@InterfaceAudience.Private public class MetaReader extends Object
hbase:meta
.Modifier and Type | Class and Description |
---|---|
static interface |
MetaReader.Visitor
Implementations 'visit' a catalog table row.
|
Constructor and Description |
---|
MetaReader() |
Modifier and Type | Method and Description |
---|---|
static List<Result> |
fullScan(CatalogTracker catalogTracker)
Performs a full scan of
hbase:meta . |
static void |
fullScan(CatalogTracker catalogTracker,
MetaReader.Visitor visitor)
Performs a full scan of
hbase:meta . |
static void |
fullScan(CatalogTracker catalogTracker,
MetaReader.Visitor visitor,
byte[] startrow)
Performs a full scan of a catalog table.
|
static Map<HRegionInfo,ServerName> |
fullScan(CatalogTracker catalogTracker,
Set<TableName> disabledTables)
Performs a full scan of
hbase:meta , skipping regions from any
tables in the specified set of disabled tables. |
static Map<HRegionInfo,ServerName> |
fullScan(CatalogTracker catalogTracker,
Set<TableName> disabledTables,
boolean excludeOfflinedSplitParents)
Performs a full scan of
hbase:meta , skipping regions from any
tables in the specified set of disabled tables. |
static void |
fullScanMetaAndPrint(CatalogTracker catalogTracker) |
static List<Result> |
fullScanOfMeta(CatalogTracker catalogTracker)
Performs a full scan of a
hbase:meta table. |
static Pair<HRegionInfo,ServerName> |
getRegion(CatalogTracker catalogTracker,
byte[] regionName)
Gets the region info and assignment for the specified region.
|
static int |
getRegionCount(org.apache.hadoop.conf.Configuration c,
String tableName)
Count regions in
hbase:meta for passed table. |
static Result |
getRegionResult(CatalogTracker catalogTracker,
byte[] regionName)
Gets the result in hbase:meta for the specified region.
|
static Pair<HRegionInfo,HRegionInfo> |
getRegionsFromMergeQualifier(CatalogTracker catalogTracker,
byte[] regionName)
Get regions from the merge qualifier of the specified merged region
|
static Scan |
getScanForTableName(TableName tableName)
This method creates a Scan object that will only scan catalog rows that
belong to the specified table.
|
static NavigableMap<HRegionInfo,Result> |
getServerUserRegions(CatalogTracker catalogTracker,
ServerName serverName) |
static List<HRegionInfo> |
getTableRegions(CatalogTracker catalogTracker,
TableName tableName)
Gets all of the regions of the specified table.
|
static List<HRegionInfo> |
getTableRegions(CatalogTracker catalogTracker,
TableName tableName,
boolean excludeOfflinedSplitParents)
Gets all of the regions of the specified table.
|
static List<Pair<HRegionInfo,ServerName>> |
getTableRegionsAndLocations(CatalogTracker catalogTracker,
TableName tableName) |
static List<Pair<HRegionInfo,ServerName>> |
getTableRegionsAndLocations(CatalogTracker catalogTracker,
TableName tableName,
boolean excludeOfflinedSplitParents) |
static boolean |
tableExists(CatalogTracker catalogTracker,
TableName tableName)
Checks if the specified table exists.
|
public static Map<HRegionInfo,ServerName> fullScan(CatalogTracker catalogTracker, Set<TableName> disabledTables) throws IOException
hbase:meta
, skipping regions from any
tables in the specified set of disabled tables.catalogTracker
- disabledTables
- set of disabled tables that will not be returnedIOException
public static Map<HRegionInfo,ServerName> fullScan(CatalogTracker catalogTracker, Set<TableName> disabledTables, boolean excludeOfflinedSplitParents) throws IOException
hbase:meta
, skipping regions from any
tables in the specified set of disabled tables.catalogTracker
- disabledTables
- set of disabled tables that will not be returnedexcludeOfflinedSplitParents
- If true, do not include offlined split
parents in the return.IOException
public static List<Result> fullScan(CatalogTracker catalogTracker) throws IOException
hbase:meta
.Result
IOException
public static List<Result> fullScanOfMeta(CatalogTracker catalogTracker) throws IOException
hbase:meta
table.Result
IOException
public static void fullScan(CatalogTracker catalogTracker, MetaReader.Visitor visitor) throws IOException
hbase:meta
.catalogTracker
- visitor
- Visitor invoked against each row.IOException
public static Pair<HRegionInfo,ServerName> getRegion(CatalogTracker catalogTracker, byte[] regionName) throws IOException
catalogTracker
- regionName
- Region to lookup.regionName
IOException
public static Result getRegionResult(CatalogTracker catalogTracker, byte[] regionName) throws IOException
catalogTracker
- regionName
- IOException
public static Pair<HRegionInfo,HRegionInfo> getRegionsFromMergeQualifier(CatalogTracker catalogTracker, byte[] regionName) throws IOException
IOException
public static boolean tableExists(CatalogTracker catalogTracker, TableName tableName) throws IOException
catalogTracker
- tableName
- table to checkIOException
public static List<HRegionInfo> getTableRegions(CatalogTracker catalogTracker, TableName tableName) throws IOException
catalogTracker
- tableName
- HRegionInfo
.IOException
public static List<HRegionInfo> getTableRegions(CatalogTracker catalogTracker, TableName tableName, boolean excludeOfflinedSplitParents) throws IOException
catalogTracker
- tableName
- excludeOfflinedSplitParents
- If true, do not include offlined split
parents in the return.HRegionInfo
.IOException
public static Scan getScanForTableName(TableName tableName)
tableName
- bytes of table's namepublic static List<Pair<HRegionInfo,ServerName>> getTableRegionsAndLocations(CatalogTracker catalogTracker, TableName tableName) throws IOException, InterruptedException
catalogTracker
- tableName
- IOException
InterruptedException
public static List<Pair<HRegionInfo,ServerName>> getTableRegionsAndLocations(CatalogTracker catalogTracker, TableName tableName, boolean excludeOfflinedSplitParents) throws IOException, InterruptedException
catalogTracker
- tableName
- IOException
InterruptedException
public static NavigableMap<HRegionInfo,Result> getServerUserRegions(CatalogTracker catalogTracker, ServerName serverName) throws IOException
catalogTracker
- serverName
- IOException
public static void fullScanMetaAndPrint(CatalogTracker catalogTracker) throws IOException
IOException
public static void fullScan(CatalogTracker catalogTracker, MetaReader.Visitor visitor, byte[] startrow) throws IOException
catalogTracker
- visitor
- Visitor invoked against each row.startrow
- Where to start the scan. Pass null if want to begin scan
at first row.
hbase:meta
, the default (pass false to scan hbase:meta)IOException
public static int getRegionCount(org.apache.hadoop.conf.Configuration c, String tableName) throws IOException
hbase:meta
for passed table.c
- tableName
- tableName
IOException
Copyright © 2014 The Apache Software Foundation. All Rights Reserved.