diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/metrics/SchemaConfigured.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/metrics/SchemaConfigured.java index 259e32a0c95..525298468ef 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/metrics/SchemaConfigured.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/metrics/SchemaConfigured.java @@ -76,12 +76,10 @@ public class SchemaConfigured implements HeapSize, SchemaAware { /** A helper constructor that configures the "use table name" flag. */ private SchemaConfigured(Configuration conf) { - if (conf != null) { - SchemaMetrics.configureGlobally(conf); - // Even though we now know if table-level metrics are used, we can't - // initialize schemaMetrics yet, because CF and table name are only known - // to the calling constructor. - } + SchemaMetrics.configureGlobally(conf); + // Even though we now know if table-level metrics are used, we can't + // initialize schemaMetrics yet, because CF and table name are only known + // to the calling constructor. } /** diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/metrics/SchemaMetrics.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/metrics/SchemaMetrics.java index 6ca1f0bbdef..7a824ac2d40 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/metrics/SchemaMetrics.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/metrics/SchemaMetrics.java @@ -522,9 +522,13 @@ public class SchemaMetrics { * instantiating HFile readers/writers. */ public static void configureGlobally(Configuration conf) { - final boolean useTableNameNew = - conf.getBoolean(SHOW_TABLE_NAME_CONF_KEY, false); - setUseTableName(useTableNameNew); + if (conf != null) { + final boolean useTableNameNew = + conf.getBoolean(SHOW_TABLE_NAME_CONF_KEY, false); + setUseTableName(useTableNameNew); + } else { + setUseTableName(false); + } } /**