You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by en...@apache.org on 2015/01/23 04:05:58 UTC
hbase git commit: HBASE-12899 HBase should prefix htrace
configuration keys with "hbase.htrace" rather than just "hbase." (Colin
Patrick McCabe)
Repository: hbase
Updated Branches:
refs/heads/master 71ab4ddb1 -> 38701ea8e
HBASE-12899 HBase should prefix htrace configuration keys with "hbase.htrace" rather than just "hbase." (Colin Patrick McCabe)
Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/38701ea8
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/38701ea8
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/38701ea8
Branch: refs/heads/master
Commit: 38701ea8ec8c112f31548b7d9697810a8af953ec
Parents: 71ab4dd
Author: Enis Soztutar <en...@apache.org>
Authored: Thu Jan 22 19:04:35 2015 -0800
Committer: Enis Soztutar <en...@apache.org>
Committed: Thu Jan 22 19:04:35 2015 -0800
----------------------------------------------------------------------
.../hbase/trace/HBaseHTraceConfiguration.java | 33 +++++++++++++++++++-
1 file changed, 32 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hbase/blob/38701ea8/hbase-common/src/main/java/org/apache/hadoop/hbase/trace/HBaseHTraceConfiguration.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/trace/HBaseHTraceConfiguration.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/trace/HBaseHTraceConfiguration.java
index 42347ce..56de264 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/trace/HBaseHTraceConfiguration.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/trace/HBaseHTraceConfiguration.java
@@ -21,15 +21,46 @@ package org.apache.hadoop.hbase.trace;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.classification.InterfaceAudience;
import org.apache.htrace.HTraceConfiguration;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
@InterfaceAudience.Private
public class HBaseHTraceConfiguration extends HTraceConfiguration {
+ private static final Log LOG =
+ LogFactory.getLog(HBaseHTraceConfiguration.class);
+
+ public static final String KEY_PREFIX = "hbase.htrace.";
- public static final String KEY_PREFIX = "hbase.";
private Configuration conf;
+ private void handleDeprecation(String key) {
+ String oldKey = "hbase." + key;
+ String newKey = KEY_PREFIX + key;
+ String oldValue = conf.get(oldKey);
+ if (oldValue != null) {
+ LOG.warn("Warning: using deprecated configuration key " + oldKey +
+ ". Please use " + newKey + " instead.");
+ String newValue = conf.get(newKey);
+ if (newValue == null) {
+ conf.set(newKey, oldValue);
+ } else {
+ LOG.warn("Conflicting values for " + newKey + " and " + oldKey +
+ ". Using " + newValue);
+ }
+ }
+ }
+
public HBaseHTraceConfiguration(Configuration conf) {
this.conf = conf;
+ handleDeprecation("local-file-span-receiver.path");
+ handleDeprecation("local-file-span-receiver.capacity");
+ handleDeprecation("sampler.frequency");
+ handleDeprecation("sampler.fraction");
+ handleDeprecation("zipkin.collector-hostname");
+ handleDeprecation("zipkin.collector-port");
+ handleDeprecation("zipkin.num-threads");
+ handleDeprecation("zipkin.traced-service-hostname");
+ handleDeprecation("zipkin.traced-service-port");
}
@Override