diff --git hbase-client/src/main/java/org/apache/hadoop/hbase/HTableDescriptor.java hbase-client/src/main/java/org/apache/hadoop/hbase/HTableDescriptor.java index e3cf2ecb79..bf58d73941 100644 --- hbase-client/src/main/java/org/apache/hadoop/hbase/HTableDescriptor.java +++ hbase-client/src/main/java/org/apache/hadoop/hbase/HTableDescriptor.java @@ -37,8 +37,8 @@ import org.apache.hadoop.hbase.util.Bytes; /** * HTableDescriptor contains the details about an HBase table such as the descriptors of - * all the column families, is the table a catalog table, -ROOT- or - * hbase:meta , if the table is read only, the maximum size of the memstore, + * all the column families, is the table a catalog table, hbase:meta , + * if the table is read only, the maximum size of the memstore, * when the region split should occur, coprocessors associated with it etc... * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0. * use {@link TableDescriptorBuilder} to build {@link HTableDescriptor}. @@ -54,7 +54,7 @@ public class HTableDescriptor implements TableDescriptor, Comparable -ROOT- region. + * This is vestigial API. It will be removed in 3.0. * - * @return true if this is a -ROOT- region + * @return always return the false */ - @Override public boolean isRootRegion() { - return delegatee.isRootRegion(); + return false; } /** diff --git hbase-client/src/main/java/org/apache/hadoop/hbase/client/TableDescriptor.java hbase-client/src/main/java/org/apache/hadoop/hbase/client/TableDescriptor.java index 58a18ecd1c..6f7e20f104 100644 --- hbase-client/src/main/java/org/apache/hadoop/hbase/client/TableDescriptor.java +++ hbase-client/src/main/java/org/apache/hadoop/hbase/client/TableDescriptor.java @@ -29,8 +29,8 @@ import org.apache.hadoop.hbase.util.Bytes; /** * TableDescriptor contains the details about an HBase table such as the descriptors of - * all the column families, is the table a catalog table, -ROOT- or - * hbase:meta , if the table is read only, the maximum size of the memstore, + * all the column families, is the table a catalog table, hbase:meta , + * if the table is read only, the maximum size of the memstore, * when the region split should occur, coprocessors associated with it etc... */ @InterfaceAudience.Public @@ -246,11 +246,4 @@ public interface TableDescriptor { */ boolean isReadOnly(); - /** - * Check if the descriptor represents a -ROOT- region. - * - * @return true if this is a -ROOT- region - */ - boolean isRootRegion(); - } diff --git hbase-client/src/main/java/org/apache/hadoop/hbase/client/TableDescriptorBuilder.java hbase-client/src/main/java/org/apache/hadoop/hbase/client/TableDescriptorBuilder.java index a372cedcd5..6c0fa65f9e 100644 --- hbase-client/src/main/java/org/apache/hadoop/hbase/client/TableDescriptorBuilder.java +++ hbase-client/src/main/java/org/apache/hadoop/hbase/client/TableDescriptorBuilder.java @@ -52,92 +52,96 @@ public class TableDescriptorBuilder { private static final Log LOG = LogFactory.getLog(TableDescriptorBuilder.class); + @InterfaceAudience.Private public static final String SPLIT_POLICY = "SPLIT_POLICY"; /** - * INTERNAL Used by HBase Shell interface to access this metadata + * Used by HBase Shell interface to access this metadata * attribute which denotes the maximum size of the store file after which a * region split occurs. */ + @InterfaceAudience.Private public static final String MAX_FILESIZE = "MAX_FILESIZE"; private static final Bytes MAX_FILESIZE_KEY = new Bytes(Bytes.toBytes(MAX_FILESIZE)); + @InterfaceAudience.Private public static final String OWNER = "OWNER"; + @InterfaceAudience.Private public static final Bytes OWNER_KEY = new Bytes(Bytes.toBytes(OWNER)); /** - * INTERNAL Used by rest interface to access this metadata attribute + * Used by rest interface to access this metadata attribute * which denotes if the table is Read Only. */ + @InterfaceAudience.Private public static final String READONLY = "READONLY"; private static final Bytes READONLY_KEY = new Bytes(Bytes.toBytes(READONLY)); /** - * INTERNAL Used by HBase Shell interface to access this metadata + * Used by HBase Shell interface to access this metadata * attribute which denotes if the table is compaction enabled. */ + @InterfaceAudience.Private public static final String COMPACTION_ENABLED = "COMPACTION_ENABLED"; private static final Bytes COMPACTION_ENABLED_KEY = new Bytes(Bytes.toBytes(COMPACTION_ENABLED)); /** - * INTERNAL Used by HBase Shell interface to access this metadata + * Used by HBase Shell interface to access this metadata * attribute which represents the maximum size of the memstore after which its * contents are flushed onto the disk. */ + @InterfaceAudience.Private public static final String MEMSTORE_FLUSHSIZE = "MEMSTORE_FLUSHSIZE"; private static final Bytes MEMSTORE_FLUSHSIZE_KEY = new Bytes(Bytes.toBytes(MEMSTORE_FLUSHSIZE)); + @InterfaceAudience.Private public static final String FLUSH_POLICY = "FLUSH_POLICY"; /** - * INTERNAL Used by rest interface to access this metadata attribute - * which denotes if the table is a -ROOT- region or not. - */ - public static final String IS_ROOT = "IS_ROOT"; - private static final Bytes IS_ROOT_KEY - = new Bytes(Bytes.toBytes(IS_ROOT)); - - /** - * INTERNAL Used by rest interface to access this metadata attribute - * which denotes if it is a catalog table, either hbase:meta or -ROOT- - * . + * Used by rest interface to access this metadata attribute + * which denotes if it is a catalog table, either hbase:meta . */ + @InterfaceAudience.Private public static final String IS_META = "IS_META"; private static final Bytes IS_META_KEY = new Bytes(Bytes.toBytes(IS_META)); /** - * INTERNAL {@link Durability} setting for the table. + * {@link Durability} setting for the table. */ + @InterfaceAudience.Private public static final String DURABILITY = "DURABILITY"; private static final Bytes DURABILITY_KEY = new Bytes(Bytes.toBytes("DURABILITY")); /** - * INTERNAL number of region replicas for the table. + * The number of region replicas for the table. */ + @InterfaceAudience.Private public static final String REGION_REPLICATION = "REGION_REPLICATION"; private static final Bytes REGION_REPLICATION_KEY = new Bytes(Bytes.toBytes(REGION_REPLICATION)); /** - * INTERNAL flag to indicate whether or not the memstore should be + * The flag to indicate whether or not the memstore should be * replicated for read-replicas (CONSISTENCY => TIMELINE). */ + @InterfaceAudience.Private public static final String REGION_MEMSTORE_REPLICATION = "REGION_MEMSTORE_REPLICATION"; private static final Bytes REGION_MEMSTORE_REPLICATION_KEY = new Bytes(Bytes.toBytes(REGION_MEMSTORE_REPLICATION)); /** - * INTERNAL Used by shell/rest interface to access this metadata + * Used by shell/rest interface to access this metadata * attribute which denotes if the table should be treated by region * normalizer. */ + @InterfaceAudience.Private public static final String NORMALIZATION_ENABLED = "NORMALIZATION_ENABLED"; private static final Bytes NORMALIZATION_ENABLED_KEY = new Bytes(Bytes.toBytes(NORMALIZATION_ENABLED)); @@ -148,6 +152,7 @@ public class TableDescriptorBuilder { */ private static final Durability DEFAULT_DURABLITY = Durability.USE_DEFAULT; + @InterfaceAudience.Private public static final String PRIORITY = "PRIORITY"; private static final Bytes PRIORITY_KEY = new Bytes(Bytes.toBytes(PRIORITY)); @@ -208,12 +213,14 @@ public class TableDescriptorBuilder { DEFAULT_VALUES.put(PRIORITY, String.valueOf(DEFAULT_PRIORITY)); DEFAULT_VALUES.keySet().stream() .map(s -> new Bytes(Bytes.toBytes(s))).forEach(RESERVED_KEYWORDS::add); - RESERVED_KEYWORDS.add(IS_ROOT_KEY); RESERVED_KEYWORDS.add(IS_META_KEY); } + @InterfaceAudience.Private public final static String NAMESPACE_FAMILY_INFO = "info"; + @InterfaceAudience.Private public final static byte[] NAMESPACE_FAMILY_INFO_BYTES = Bytes.toBytes(NAMESPACE_FAMILY_INFO); + @InterfaceAudience.Private public final static byte[] NAMESPACE_COL_DESC_BYTES = Bytes.toBytes("d"); /** @@ -422,12 +429,7 @@ public class TableDescriptorBuilder { } /** - * ModifyableTableDescriptor contains the details about an HBase table such as the - * descriptors of all the column families, is the table a catalog table, -ROOT- - * or hbase:meta , if the table is read only, the - * maximum size of the memstore, when the region split should occur, - * coprocessors associated with it etc... TODO: make this private after - * removing the HTableDescriptor + * TODO: make this private after removing the HTableDescriptor */ @InterfaceAudience.Private public static class ModifyableTableDescriptor @@ -437,7 +439,7 @@ public class TableDescriptorBuilder { /** * A map which holds the metadata information of the table. This metadata - * includes values like IS_ROOT, IS_META, SPLIT_POLICY, MAX_FILE_SIZE, + * includes values like IS_META, SPLIT_POLICY, MAX_FILE_SIZE, * READONLY, MEMSTORE_FLUSHSIZE etc... */ private final Map values = new HashMap<>(); @@ -493,24 +495,12 @@ public class TableDescriptorBuilder { /* * Set meta flags on this table. - * IS_ROOT_KEY is set if its a -ROOT- table - * IS_META_KEY is set either if its a -ROOT- or a hbase:meta table + * IS_META_KEY is set if its a hbase:meta table * Called by constructors. * @param name */ private void setMetaFlags(final TableName name) { - values.put(IS_META_KEY, isRootRegion() - || name.equals(TableName.META_TABLE_NAME) ? TRUE : FALSE); - } - - /** - * Check if the descriptor represents a -ROOT- region. - * - * @return true if this is a -ROOT- region - */ - @Override - public boolean isRootRegion() { - return isSomething(IS_ROOT_KEY, false); + values.put(IS_META_KEY, name.equals(TableName.META_TABLE_NAME) ? TRUE : FALSE); } /** @@ -539,7 +529,7 @@ public class TableDescriptorBuilder { */ @Override public boolean isMetaTable() { - return isMetaRegion() && !isRootRegion(); + return isMetaRegion(); } /** @@ -1004,9 +994,9 @@ public class TableDescriptorBuilder { userKeys.add(entry.getKey()); continue; } - // only print out IS_ROOT/IS_META if true + // only print out IS_META if true String value = Bytes.toString(entry.getValue().get()); - if (key.equalsIgnoreCase(IS_ROOT) || key.equalsIgnoreCase(IS_META)) { + if (key.equalsIgnoreCase(IS_META)) { if (Boolean.valueOf(value) == false) { continue; } @@ -1560,7 +1550,7 @@ public class TableDescriptorBuilder { return Bytes.toString(getValue(OWNER_KEY)); } // Note that every table should have an owner (i.e. should have OWNER_KEY set). - // hbase:meta and -ROOT- should return system user as owner, not null (see + // hbase:meta should return system user as owner, not null (see // MasterFileSystem.java:bootstrap()). return null; }