|
||||||||||
| 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..
Uses the CatalogTracker to obtain locations and connections to
catalogs.
| Nested Class Summary | |
|---|---|
static interface |
MetaReader.Visitor
Implementations 'visit' a catalog table row. |
| Field Summary | |
|---|---|
static byte[] |
META_REGION_PREFIX
|
| Constructor Summary | |
|---|---|
MetaReader()
|
|
| Method Summary | |
|---|---|
static Map<HRegionInfo,HServerAddress> |
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,HServerAddress> |
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,HServerAddress> |
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 List<Result> |
fullScanOfResults(CatalogTracker catalogTracker)
Performs a full scan of .META.. |
static Pair<HRegionInfo,HServerAddress> |
getRegion(CatalogTracker catalogTracker,
byte[] regionName)
Gets the region info and assignment for the specified region from META. |
static Scan |
getScanForTableName(byte[] 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,
HServerInfo hsi)
|
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,HServerAddress>> |
getTableRegionsAndLocations(CatalogTracker catalogTracker,
String tableName)
|
static Pair<HRegionInfo,HServerAddress> |
metaRowToRegionPair(Result data)
|
static Pair<HRegionInfo,HServerInfo> |
metaRowToRegionPairWithInfo(Result data)
|
static HServerAddress |
readMetaLocation(HRegionInterface metaServer)
Reads the location of META from ROOT. |
static HServerAddress |
readRegionLocation(CatalogTracker catalogTracker,
byte[] regionName)
Reads the location of the specified region from META. |
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 |
| Field Detail |
|---|
public static final byte[] META_REGION_PREFIX
| Constructor Detail |
|---|
public MetaReader()
| Method Detail |
|---|
public static Map<HRegionInfo,HServerAddress> fullScan(CatalogTracker catalogTracker)
throws IOException
.META..
Returns a map of every region to it's currently assigned server, according to META. If the region does not have an assignment it will have a null value in the map.
IOException
public static Map<HRegionInfo,HServerAddress> fullScan(CatalogTracker catalogTracker,
Set<String> disabledTables)
throws IOException
.META., skipping regions from any
tables in the specified set of disabled tables.
Returns a map of every region to it's currently assigned server, according to META. If the region does not have an assignment it will have a null value in the map.
catalogTracker - disabledTables - set of disabled tables that will not be returned
IOException
public static Map<HRegionInfo,HServerAddress> fullScan(CatalogTracker catalogTracker,
Set<String> disabledTables,
boolean excludeOfflinedSplitParents)
throws IOException
.META., skipping regions from any
tables in the specified set of disabled tables.
Returns a map of every region to it's currently assigned server, according to META. If the region does not have an assignment it will have a null value in the map.
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> fullScanOfResults(CatalogTracker catalogTracker)
throws IOException
.META..
Returns a map of every region to it's currently assigned server, according to META. If the region does not have an assignment it will have a null value in the map.
Returns HServerInfo which includes server startcode.
IOException
public static void fullScan(CatalogTracker catalogTracker,
MetaReader.Visitor visitor)
throws IOException
.META..
Returns a map of every region to it's currently assigned server, according to META. If the region does not have an assignment it will have a null value in the map.
catalogTracker - visitor -
IOException
public static void fullScan(CatalogTracker catalogTracker,
MetaReader.Visitor visitor,
byte[] startrow)
throws IOException
.META..
Returns a map of every region to it's currently assigned server, according to META. If the region does not have an assignment it will have a null value in the map.
catalogTracker - visitor - startrow - Where to start the scan. Pass null if want to begin scan
at first row.
IOException
public static HServerAddress readMetaLocation(HRegionInterface metaServer)
throws IOException
metaServer - connection to server hosting ROOT
IOException
public static HServerAddress readRegionLocation(CatalogTracker catalogTracker,
byte[] regionName)
throws IOException
catalogTracker - regionName - region to read location of
IOException
public static Pair<HRegionInfo,HServerAddress> getRegion(CatalogTracker catalogTracker,
byte[] regionName)
throws IOException
catalogTracker - regionName -
IOException
public static Pair<HRegionInfo,HServerAddress> metaRowToRegionPair(Result data)
throws IOException
data - A .META. table row.
data
or null for server address if no address set in .META. or null for a result
if no HRegionInfo found.
IOException
public static Pair<HRegionInfo,HServerInfo> metaRowToRegionPairWithInfo(Result data)
throws IOException
data - A .META. table row.
data
(or null for server address if no address set in .META.).
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,HServerAddress>> getTableRegionsAndLocations(CatalogTracker catalogTracker,
String tableName)
throws IOException,
InterruptedException
catalogTracker - tableName -
IOException
InterruptedException
public static NavigableMap<HRegionInfo,Result> getServerUserRegions(CatalogTracker catalogTracker,
HServerInfo hsi)
throws IOException
catalogTracker - hsi - Server specification
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||