Search in sources :

Example 6 with TableState

use of org.apache.hadoop.hbase.client.TableState in project hbase by apache.

the class MetaTableAccessor method fullScanMetaAndPrint.

public static void fullScanMetaAndPrint(Connection connection) throws IOException {
    Visitor v = new Visitor() {

        @Override
        public boolean visit(Result r) throws IOException {
            if (r == null || r.isEmpty())
                return true;
            LOG.info("fullScanMetaAndPrint.Current Meta Row: " + r);
            TableState state = getTableState(r);
            if (state != null) {
                LOG.info("Table State: " + state);
            } else {
                RegionLocations locations = getRegionLocations(r);
                if (locations == null)
                    return true;
                for (HRegionLocation loc : locations.getRegionLocations()) {
                    if (loc != null) {
                        LOG.info("fullScanMetaAndPrint.HRI Print= " + loc.getRegionInfo());
                    }
                }
            }
            return true;
        }
    };
    scanMeta(connection, null, null, QueryType.ALL, v);
}
Also used : Result(org.apache.hadoop.hbase.client.Result) TableState(org.apache.hadoop.hbase.client.TableState)

Aggregations

TableState (org.apache.hadoop.hbase.client.TableState)6 TableName (org.apache.hadoop.hbase.TableName)3 Result (org.apache.hadoop.hbase.client.Result)3 Nullable (edu.umd.cs.findbugs.annotations.Nullable)1 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1 Collection (java.util.Collection)1 LinkedHashMap (java.util.LinkedHashMap)1 AtomicReference (java.util.concurrent.atomic.AtomicReference)1 DoNotRetryIOException (org.apache.hadoop.hbase.DoNotRetryIOException)1 HRegionInfo (org.apache.hadoop.hbase.HRegionInfo)1 Put (org.apache.hadoop.hbase.client.Put)1 ServiceException (org.apache.hadoop.hbase.shaded.com.google.protobuf.ServiceException)1 GetTableStateResponse (org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.GetTableStateResponse)1