commit 498fc92bad09507b19af08d88a898698812b3981 Author: Nicolas Spiegelberg Date: 5 weeks ago Disable show table metrics in bulk loader Summary: ODS team has run into this issue during build loader Reviewers: mbautin, kannan, nspiegelberg Reviewed By: nspiegelberg diff --git src/main/java/org/apache/hadoop/hbase/regionserver/metrics/SchemaConfigured.java src/main/java/org/apache/hadoop/hbase/regionserver/metrics/SchemaConfigured.java index d8ac453..0c01a89 100644 --- src/main/java/org/apache/hadoop/hbase/regionserver/metrics/SchemaConfigured.java +++ 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 src/main/java/org/apache/hadoop/hbase/regionserver/metrics/SchemaMetrics.java src/main/java/org/apache/hadoop/hbase/regionserver/metrics/SchemaMetrics.java index f8e9027..642338f 100644 --- src/main/java/org/apache/hadoop/hbase/regionserver/metrics/SchemaMetrics.java +++ src/main/java/org/apache/hadoop/hbase/regionserver/metrics/SchemaMetrics.java @@ -490,9 +490,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); + } } /**