@InterfaceAudience.Private public class MetaScanner extends Object
hbase:meta
table scanning logic.
Provided visitors will be called for each row.
Although public visibility, this is not a public-facing API and may evolve in
minor releases.
Note that during concurrent region splits, the scanner might not see
hbase:meta changes across rows (for parent and daughter entries) consistently.
see HBASE-5986, and MetaScanner.DefaultMetaScannerVisitor
for details.
Modifier and Type | Class and Description |
---|---|
static class |
MetaScanner.DefaultMetaScannerVisitor
A MetaScannerVisitor that skips offline regions and split parents
|
static interface |
MetaScanner.MetaScannerVisitor
Visitor class called to process each row of the hbase:meta table
|
static class |
MetaScanner.MetaScannerVisitorBase |
static class |
MetaScanner.TableMetaScannerVisitor
A MetaScannerVisitor for a table.
|
Constructor and Description |
---|
MetaScanner() |
Modifier and Type | Method and Description |
---|---|
static NavigableMap<HRegionInfo,ServerName> |
allTableRegions(org.apache.hadoop.conf.Configuration conf,
Connection connection,
TableName tableName,
boolean offlined)
Deprecated.
Use
allTableRegions(Connection, TableName) instead |
static NavigableMap<HRegionInfo,ServerName> |
allTableRegions(Connection connection,
TableName tableName)
Lists all of the table regions currently in META.
|
static HRegionInfo |
getHRegionInfo(Result data)
Deprecated.
|
static List<HRegionInfo> |
listAllRegions(org.apache.hadoop.conf.Configuration conf,
Connection connection,
boolean offlined)
Lists all of the regions currently in META.
|
static List<RegionLocations> |
listTableRegionLocations(org.apache.hadoop.conf.Configuration conf,
Connection connection,
TableName tableName)
Lists table regions and locations grouped by region range from META.
|
static void |
metaScan(Connection connection,
MetaScanner.MetaScannerVisitor visitor)
Scans the meta table and calls a visitor on each RowResult and uses a empty
start row value as table name.
|
static void |
metaScan(Connection connection,
MetaScanner.MetaScannerVisitor visitor,
TableName userTableName)
Scans the meta table and calls a visitor on each RowResult.
|
static void |
metaScan(Connection connection,
MetaScanner.MetaScannerVisitor visitor,
TableName userTableName,
byte[] row,
int rowLimit)
Scans the meta table and calls a visitor on each RowResult.
|
public static void metaScan(Connection connection, MetaScanner.MetaScannerVisitor visitor) throws IOException
Visible for testing. Use metaScan(Connection, MetaScannerVisitor, TableName)
instead.
visitor
- A custom visitorIOException
- epublic static void metaScan(Connection connection, MetaScanner.MetaScannerVisitor visitor, TableName userTableName) throws IOException
connection
- connection to use internally (null to use a new instance)visitor
- visitor objectuserTableName
- User table name in meta table to start scan at. Pass
null if not interested in a particular table.IOException
- epublic static void metaScan(Connection connection, MetaScanner.MetaScannerVisitor visitor, TableName userTableName, byte[] row, int rowLimit) throws IOException
rowLimit
of rows.
Visible for testing. Use metaScan(Connection, MetaScannerVisitor, TableName)
instead.
connection
- to scan onvisitor
- Visitor object.userTableName
- User table name in meta table to start scan at. Pass
null if not interested in a particular table.row
- Name of the row at the user table. The scan will start from
the region row where the row resides.rowLimit
- Max of processed rows. If it is less than 0, it
will be set to default value Integer.MAX_VALUE
.IOException
- e@Deprecated public static HRegionInfo getHRegionInfo(Result data)
MetaTableAccessor.getRegionLocations(Result)
data
- a Result object from the catalog table scanpublic static List<HRegionInfo> listAllRegions(org.apache.hadoop.conf.Configuration conf, Connection connection, boolean offlined) throws IOException
conf
- configurationconnection
- to connect withofflined
- True if we are to include offlined regions, false and we'll
leave out offlined regions from returned list.IOException
@Deprecated public static NavigableMap<HRegionInfo,ServerName> allTableRegions(org.apache.hadoop.conf.Configuration conf, Connection connection, TableName tableName, boolean offlined) throws IOException
allTableRegions(Connection, TableName)
insteadconf
- offlined
- True if we are to include offlined regions, false and we'll
leave out offlined regions from returned list.IOException
public static NavigableMap<HRegionInfo,ServerName> allTableRegions(Connection connection, TableName tableName) throws IOException
connection
- tableName
- IOException
public static List<RegionLocations> listTableRegionLocations(org.apache.hadoop.conf.Configuration conf, Connection connection, TableName tableName) throws IOException
IOException
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.