From 58af0ecb42072141e05fc422d6079944642173f4 Mon Sep 17 00:00:00 2001 From: Michael Stack Date: Thu, 27 Sep 2012 20:45:00 +0000 Subject: [PATCH] HBASE-4802 Disable show table metrics in bulk loader git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1391206 13f79535-47bb-0310-9956-ffa450edef68 --- .../hbase/regionserver/metrics/SchemaConfigured.java | 10 ++++------ .../hbase/regionserver/metrics/SchemaMetrics.java | 10 +++++++--- 2 files changed, 11 insertions(+), 9 deletions(-) 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); + } } /**