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
This commit is contained in:
Michael Stack 2012-09-27 20:45:00 +00:00
parent dd10bfe8a7
commit 58af0ecb42
2 changed files with 11 additions and 9 deletions

View File

@ -76,12 +76,10 @@ public class SchemaConfigured implements HeapSize, SchemaAware {
/** A helper constructor that configures the "use table name" flag. */ /** A helper constructor that configures the "use table name" flag. */
private SchemaConfigured(Configuration conf) { private SchemaConfigured(Configuration conf) {
if (conf != null) { SchemaMetrics.configureGlobally(conf);
SchemaMetrics.configureGlobally(conf); // Even though we now know if table-level metrics are used, we can't
// 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
// initialize schemaMetrics yet, because CF and table name are only known // to the calling constructor.
// to the calling constructor.
}
} }
/** /**

View File

@ -522,9 +522,13 @@ public class SchemaMetrics {
* instantiating HFile readers/writers. * instantiating HFile readers/writers.
*/ */
public static void configureGlobally(Configuration conf) { public static void configureGlobally(Configuration conf) {
final boolean useTableNameNew = if (conf != null) {
conf.getBoolean(SHOW_TABLE_NAME_CONF_KEY, false); final boolean useTableNameNew =
setUseTableName(useTableNameNew); conf.getBoolean(SHOW_TABLE_NAME_CONF_KEY, false);
setUseTableName(useTableNameNew);
} else {
setUseTableName(false);
}
} }
/** /**