hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e...@apache.org
Subject hbase git commit: HBASE-12899 HBase should prefix htrace configuration keys with "hbase.htrace" rather than just "hbase." (Colin Patrick McCabe)
Date Fri, 23 Jan 2015 03:08:28 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1 7e1f030f2 -> ea566fc1f


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/ea566fc1
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/ea566fc1
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/ea566fc1

Branch: refs/heads/branch-1
Commit: ea566fc1f5e1464a177e8c0926cc3a890f7a5e18
Parents: 7e1f030
Author: Enis Soztutar <enis@apache.org>
Authored: Thu Jan 22 19:04:35 2015 -0800
Committer: Enis Soztutar <enis@apache.org>
Committed: Thu Jan 22 19:06:13 2015 -0800

----------------------------------------------------------------------
 .../hbase/trace/HBaseHTraceConfiguration.java   | 33 +++++++++++++++++++-
 1 file changed, 32 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/ea566fc1/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


Mime
View raw message