anmolnar commented on code in PR #6632:
URL: https://github.com/apache/hbase/pull/6632#discussion_r1953562486
##########
hbase-common/src/main/java/org/apache/hadoop/hbase/TableName.java:
##########
@@ -65,9 +72,34 @@ public final class TableName implements
Comparable<TableName> {
public static final String VALID_USER_TABLE_REGEX = "(?:(?:(?:" +
VALID_NAMESPACE_REGEX + "\\"
+ NAMESPACE_DELIM + ")?)" + "(?:" + VALID_TABLE_QUALIFIER_REGEX + "))";
- /** The hbase:meta table's name. */
- public static final TableName META_TABLE_NAME =
- valueOf(NamespaceDescriptor.SYSTEM_NAMESPACE_NAME_STR, "meta");
+ /** The name of hbase meta table could either be hbase:meta_xxx or
'hbase:meta' otherwise.
+ * Config hbase.meta.table.suffix will govern the decision of adding suffix
to the habase:meta */
+ public static final TableName META_TABLE_NAME;
+ static {
+ Configuration conf = HBaseConfiguration.create();
+ META_TABLE_NAME = initializeHbaseMetaTableName(conf);
+ }
+
+ /* Visible for testing only */
+ @RestrictedApi(explanation = "Should only be called in tests", link = "",
+ allowedOnPath = ".*/src/test/.*")
+ public static TableName getDefaultNameOfMetaForReplica() {
+ return valueOf(NamespaceDescriptor.SYSTEM_NAMESPACE_NAME_STR, "meta");
+ }
+
+ public static TableName initializeHbaseMetaTableName(Configuration conf) {
+ String suffix_val = String.valueOf(conf.getStrings(
+ HConstants.HBASE_META_TABLE_SUFFIX,
HConstants.HBASE_META_TABLE_SUFFIX_DEFAULT_VALUE));
+
+ if (suffix_val == null || suffix_val.isEmpty()) {
+ LOG.info("Meta table name: {}", META_TABLE_NAME);
+ return TableName.META_TABLE_NAME;
+ }
Review Comment:
This is incorrect: META_TABLE_NAME is being initialized in this method, so
you end up returning null value.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]