|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hadoop.hbase.catalog.MetaReader
public class MetaReader
Reads region and assignment information from .META..
| Nested Class Summary | |
|---|---|
static interface |
MetaReader.Visitor
Implementations 'visit' a catalog table row. |
| Constructor Summary | |
|---|---|
MetaReader()
|
|
| Method Summary | |
|---|---|
static List<Result> |
fullScan(CatalogTracker catalogTracker)
Performs a full scan of .META.. |
static void |
fullScan(CatalogTracker catalogTracker,
MetaReader.Visitor visitor)
Performs a full scan of .META.. |
static void |
fullScan(CatalogTracker catalogTracker,
MetaReader.Visitor visitor,
byte[] startrow)
Performs a full scan of .META.. |
static Map<HRegionInfo,ServerName> |
fullScan(CatalogTracker catalogTracker,
Set<String> disabledTables)
Performs a full scan of .META., skipping regions from any
tables in the specified set of disabled tables. |
static Map<HRegionInfo,ServerName> |
fullScan(CatalogTracker catalogTracker,
Set<String> disabledTables,
boolean excludeOfflinedSplitParents)
Performs a full scan of .META., skipping regions from any
tables in the specified set of disabled tables. |
static void |
fullScan(HRegionInterface hRegionInterface,
MetaReader.Visitor visitor,
byte[] regionName,
byte[] startrow)
Deprecated. Does not retry; use fullScan xxx instead. x |
static void |
fullScanMetaAndPrint(CatalogTracker catalogTracker)
|
static List<Result> |
fullScanOfRoot(CatalogTracker catalogTracker)
Performs a full scan of a -ROOT- table. |
static Pair<HRegionInfo,ServerName> |
getRegion(CatalogTracker catalogTracker,
byte[] regionName)
Gets the region info and assignment for the specified region. |
static Scan |
getScanForTableName(byte[] tableName)
This method creates a Scan object that will only scan catalog rows that belong to the specified table. |
static ServerName |
getServerNameFromCatalogResult(Result r)
Extract a ServerName
For use on catalog table Result. |
static NavigableMap<HRegionInfo,Result> |
getServerUserRegions(CatalogTracker catalogTracker,
ServerName serverName)
|
static List<HRegionInfo> |
getTableRegions(CatalogTracker catalogTracker,
byte[] tableName)
Gets all of the regions of the specified table. |
static List<HRegionInfo> |
getTableRegions(CatalogTracker catalogTracker,
byte[] tableName,
boolean excludeOfflinedSplitParents)
Gets all of the regions of the specified table. |
static List<Pair<HRegionInfo,ServerName>> |
getTableRegionsAndLocations(CatalogTracker catalogTracker,
byte[] tableName,
boolean excludeOfflinedSplitParents)
|
static List<Pair<HRegionInfo,ServerName>> |
getTableRegionsAndLocations(CatalogTracker catalogTracker,
String tableName)
|
static Pair<HRegionInfo,ServerName> |
parseCatalogResult(Result r)
Extract a HRegionInfo and ServerName. |
static HRegionInfo |
parseHRegionInfoFromCatalogResult(Result r,
byte[] qualifier)
Parse the content of the cell at HConstants.CATALOG_FAMILY and
qualifier as an HRegionInfo and return it, or null. |
static ServerName |
readMetaLocation(HRegionInterface metaServer)
Deprecated. Does not retry; use #getMetaRegionLocation(CatalogTracker) |
static boolean |
tableExists(CatalogTracker catalogTracker,
String tableName)
Checks if the specified table exists. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MetaReader()
| Method Detail |
|---|
public static Map<HRegionInfo,ServerName> fullScan(CatalogTracker catalogTracker,
Set<String> disabledTables)
throws IOException
.META., skipping regions from any
tables in the specified set of disabled tables.
catalogTracker - disabledTables - set of disabled tables that will not be returned
IOException
public static Map<HRegionInfo,ServerName> fullScan(CatalogTracker catalogTracker,
Set<String> disabledTables,
boolean excludeOfflinedSplitParents)
throws IOException
.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
.META..
Result
IOException
public static List<Result> fullScanOfRoot(CatalogTracker catalogTracker)
throws IOException
-ROOT- table.
Result
IOException
public static void fullScan(CatalogTracker catalogTracker,
MetaReader.Visitor visitor)
throws IOException
.META..
catalogTracker - visitor - Visitor invoked against each row.
IOException
public static void fullScan(CatalogTracker catalogTracker,
MetaReader.Visitor visitor,
byte[] startrow)
throws IOException
.META..
catalogTracker - visitor - Visitor invoked against each row.startrow - Where to start the scan. Pass null if want to begin scan
at first row (The visitor will stop the Scan when its done so no need to
pass a stoprow).
IOException
public static ServerName readMetaLocation(HRegionInterface metaServer)
throws IOException
metaServer - connection to server hosting ROOT
IOException
public static Pair<HRegionInfo,ServerName> getRegion(CatalogTracker catalogTracker,
byte[] regionName)
throws IOException
catalogTracker - regionName - Region to lookup.
regionName
IOExceptionpublic static ServerName getServerNameFromCatalogResult(Result r)
ServerName
For use on catalog table Result.
r - Result to pull from
public static Pair<HRegionInfo,ServerName> parseCatalogResult(Result r)
throws IOException
Result.
r - Result to pull from
HRegionInfo and the ServerName
(or null for server address if no address set in .META.).
IOException
public static HRegionInfo parseHRegionInfoFromCatalogResult(Result r,
byte[] qualifier)
throws IOException
HConstants.CATALOG_FAMILY and
qualifier as an HRegionInfo and return it, or null.
For use on catalog table Result.
r - Result instance to pull from.qualifier - Column family qualifier -- either
HConstants.SPLITA_QUALIFIER, HConstants.SPLITB_QUALIFIER or
HConstants.REGIONINFO_QUALIFIER.
IOException
public static boolean tableExists(CatalogTracker catalogTracker,
String tableName)
throws IOException
catalogTracker - tableName - table to check
IOException
public static List<HRegionInfo> getTableRegions(CatalogTracker catalogTracker,
byte[] tableName)
throws IOException
catalogTracker - tableName -
HRegionInfo.
IOException
public static List<HRegionInfo> getTableRegions(CatalogTracker catalogTracker,
byte[] tableName,
boolean excludeOfflinedSplitParents)
throws IOException
catalogTracker - tableName - excludeOfflinedSplitParents - If true, do not include offlined split
parents in the return.
HRegionInfo.
IOExceptionpublic static Scan getScanForTableName(byte[] tableName)
tableName - bytes of table's name
public static List<Pair<HRegionInfo,ServerName>> getTableRegionsAndLocations(CatalogTracker catalogTracker,
String tableName)
throws IOException,
InterruptedException
catalogTracker - tableName -
IOException
InterruptedException
public static List<Pair<HRegionInfo,ServerName>> getTableRegionsAndLocations(CatalogTracker catalogTracker,
byte[] 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(HRegionInterface hRegionInterface,
MetaReader.Visitor visitor,
byte[] regionName,
byte[] startrow)
throws IOException
hRegionInterface - region servervisitor - visitorregionName - name of regionstartrow - start row
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||