accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bil...@apache.org
Subject accumulo git commit: ACCUMULO-3528 upgrade htrace dependency to o.a.htrace 3.1.0-incubating
Date Fri, 20 Feb 2015 18:55:28 GMT
Repository: accumulo
Updated Branches:
  refs/heads/master 50d351201 -> 7e659af1a


ACCUMULO-3528 upgrade htrace dependency to o.a.htrace 3.1.0-incubating


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/7e659af1
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/7e659af1
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/7e659af1

Branch: refs/heads/master
Commit: 7e659af1ac439031a435c26a288efdda3950ea3e
Parents: 50d3512
Author: Billie Rinaldi <billie.rinaldi@gmail.com>
Authored: Tue Feb 17 11:51:24 2015 -0800
Committer: Billie Rinaldi <billie.rinaldi@gmail.com>
Committed: Fri Feb 20 10:53:37 2015 -0800

----------------------------------------------------------------------
 assemble/pom.xml                                |   8 +-
 assemble/src/main/assemblies/component.xml      |   2 +-
 core/pom.xml                                    |   8 +-
 .../impl/TabletServerBatchReaderIterator.java   |   2 +-
 .../accumulo/core/trace/CountSampler.java       |   8 +-
 .../accumulo/core/trace/DistributedTrace.java   |  40 ++-----
 .../org/apache/accumulo/core/trace/Span.java    |  21 ++--
 .../org/apache/accumulo/core/trace/Trace.java   |  28 ++---
 .../org/apache/accumulo/core/trace/Tracer.java  |   4 +-
 .../core/trace/wrappers/TraceCallable.java      |  69 ------------
 .../trace/wrappers/TraceExecutorService.java    | 110 -------------------
 .../core/trace/wrappers/TraceRunnable.java      |  79 -------------
 examples/simple/pom.xml                         |   4 +
 .../examples/simple/client/TracingExample.java  |   6 +-
 pom.xml                                         |  12 +-
 server/base/pom.xml                             |   4 +
 .../accumulo/server/client/BulkImporter.java    |   2 +-
 server/master/pom.xml                           |   4 +
 .../accumulo/master/tableOps/BulkImport.java    |   2 +-
 server/tracer/pom.xml                           |   8 +-
 .../accumulo/tracer/AsyncSpanReceiver.java      |  41 ++++---
 .../accumulo/tracer/SendSpansViaThrift.java     |  10 +-
 .../org/apache/accumulo/tracer/SpanTree.java    |   2 +-
 .../org/apache/accumulo/tracer/TraceDump.java   |   2 +-
 .../org/apache/accumulo/tracer/TraceServer.java |   2 +-
 .../apache/accumulo/tracer/ZooTraceClient.java  |  33 +++---
 .../org/apache/accumulo/tracer/TracerTest.java  |  21 ++--
 server/tserver/pom.xml                          |   4 +
 .../accumulo/tserver/CompactionQueue.java       |  30 +++--
 .../tserver/TabletServerResourceManager.java    |   2 +-
 trace/pom.xml                                   |   2 +-
 .../accumulo/trace/instrument/CountSampler.java |   8 +-
 .../accumulo/trace/instrument/Sampler.java      |   2 +-
 .../apache/accumulo/trace/instrument/Span.java  |   6 +-
 .../apache/accumulo/trace/instrument/Trace.java |   6 +-
 35 files changed, 175 insertions(+), 417 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/7e659af1/assemble/pom.xml
----------------------------------------------------------------------
diff --git a/assemble/pom.xml b/assemble/pom.xml
index 388a956..2a7156b 100644
--- a/assemble/pom.xml
+++ b/assemble/pom.xml
@@ -129,6 +129,10 @@
       <artifactId>commons-vfs2</artifactId>
     </dependency>
     <dependency>
+      <groupId>org.apache.htrace</groupId>
+      <artifactId>htrace-core</artifactId>
+    </dependency>
+    <dependency>
       <groupId>org.apache.thrift</groupId>
       <artifactId>libthrift</artifactId>
     </dependency>
@@ -157,10 +161,6 @@
       <artifactId>jetty-util</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.htrace</groupId>
-      <artifactId>htrace-core</artifactId>
-    </dependency>
-    <dependency>
       <groupId>org.slf4j</groupId>
       <artifactId>slf4j-api</artifactId>
     </dependency>

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7e659af1/assemble/src/main/assemblies/component.xml
----------------------------------------------------------------------
diff --git a/assemble/src/main/assemblies/component.xml b/assemble/src/main/assemblies/component.xml
index 8dfce4d..a48023e 100644
--- a/assemble/src/main/assemblies/component.xml
+++ b/assemble/src/main/assemblies/component.xml
@@ -42,7 +42,7 @@
         <include>org.eclipse.jetty:jetty-server</include>
         <include>org.eclipse.jetty:jetty-servlet</include>
         <include>org.eclipse.jetty:jetty-util</include>
-        <include>org.htrace:htrace-core</include>
+        <include>org.apache.htrace:htrace-core</include>
         <include>org.slf4j:slf4j-api</include>
         <include>org.slf4j:slf4j-log4j12</include>
       </includes>

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7e659af1/core/pom.xml
----------------------------------------------------------------------
diff --git a/core/pom.xml b/core/pom.xml
index 67b486e..a736a3d 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -96,6 +96,10 @@
       <artifactId>hadoop-client</artifactId>
     </dependency>
     <dependency>
+      <groupId>org.apache.htrace</groupId>
+      <artifactId>htrace-core</artifactId>
+    </dependency>
+    <dependency>
       <groupId>org.apache.thrift</groupId>
       <artifactId>libthrift</artifactId>
     </dependency>
@@ -104,10 +108,6 @@
       <artifactId>zookeeper</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.htrace</groupId>
-      <artifactId>htrace-core</artifactId>
-    </dependency>
-    <dependency>
       <groupId>org.slf4j</groupId>
       <artifactId>slf4j-api</artifactId>
     </dependency>

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7e659af1/core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchReaderIterator.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchReaderIterator.java b/core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchReaderIterator.java
index b1966b7..61f6d15 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchReaderIterator.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchReaderIterator.java
@@ -59,10 +59,10 @@ import org.apache.accumulo.core.security.Authorizations;
 import org.apache.accumulo.core.tabletserver.thrift.NoSuchScanIDException;
 import org.apache.accumulo.core.tabletserver.thrift.TabletClientService;
 import org.apache.accumulo.core.trace.Tracer;
-import org.apache.accumulo.core.trace.wrappers.TraceRunnable;
 import org.apache.accumulo.core.util.ByteBufferUtil;
 import org.apache.accumulo.core.util.OpTimer;
 import org.apache.hadoop.io.Text;
+import org.apache.htrace.wrappers.TraceRunnable;
 import org.apache.log4j.Level;
 import org.apache.log4j.Logger;
 import org.apache.thrift.TApplicationException;

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7e659af1/core/src/main/java/org/apache/accumulo/core/trace/CountSampler.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/trace/CountSampler.java b/core/src/main/java/org/apache/accumulo/core/trace/CountSampler.java
index df1a02a..852fa9d 100644
--- a/core/src/main/java/org/apache/accumulo/core/trace/CountSampler.java
+++ b/core/src/main/java/org/apache/accumulo/core/trace/CountSampler.java
@@ -16,8 +16,12 @@
  */
 package org.apache.accumulo.core.trace;
 
-public class CountSampler extends org.htrace.impl.CountSampler {
+import org.apache.htrace.HTraceConfiguration;
+
+import java.util.Collections;
+
+public class CountSampler extends org.apache.htrace.impl.CountSampler {
   public CountSampler(long frequency) {
-    super(frequency);
+    super(HTraceConfiguration.fromMap(Collections.singletonMap(CountSampler.SAMPLER_FREQUENCY_CONF_KEY, Long.toString(frequency))));
   }
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7e659af1/core/src/main/java/org/apache/accumulo/core/trace/DistributedTrace.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/trace/DistributedTrace.java b/core/src/main/java/org/apache/accumulo/core/trace/DistributedTrace.java
index ab81f30..9970415 100644
--- a/core/src/main/java/org/apache/accumulo/core/trace/DistributedTrace.java
+++ b/core/src/main/java/org/apache/accumulo/core/trace/DistributedTrace.java
@@ -28,12 +28,12 @@ import org.apache.accumulo.core.conf.AccumuloConfiguration;
 import org.apache.accumulo.core.conf.Property;
 import org.apache.accumulo.fate.zookeeper.ZooReader;
 import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.util.ReflectionUtils;
 import org.apache.hadoop.util.ShutdownHookManager;
+import org.apache.htrace.HTraceConfiguration;
+import org.apache.htrace.SpanReceiver;
+import org.apache.htrace.SpanReceiverBuilder;
 import org.apache.log4j.Logger;
 import org.apache.zookeeper.KeeperException;
-import org.htrace.HTraceConfiguration;
-import org.htrace.SpanReceiver;
 
 /**
  * Utility class to enable tracing for Accumulo server processes.
@@ -128,7 +128,7 @@ public class DistributedTrace {
     if (service != null) {
       setProperty(conf, TRACE_SERVICE_PROPERTY, service);
     }
-    org.htrace.Trace.setProcessId(service);
+    org.apache.htrace.Trace.setProcessId(service);
     ShutdownHookManager.get().addShutdownHook(new Runnable() {
       public void run() {
         Trace.off();
@@ -156,36 +156,18 @@ public class DistributedTrace {
       return;
     }
     for (String className : receiverNames) {
-      try {
-        implClass = Class.forName(className);
-        receivers.add(loadInstance(implClass, conf));
+      SpanReceiverBuilder builder = new SpanReceiverBuilder(wrapHadoopConf(conf));
+      SpanReceiver rcvr = builder.spanReceiverClass(className.trim()).build();
+      if (rcvr == null) {
+        log.warn("Failed to load SpanReceiver " + className);
+      } else {
+        receivers.add(rcvr);
         log.info("SpanReceiver " + className + " was loaded successfully.");
-      } catch (ClassNotFoundException e) {
-        log.warn("Class " + className + " cannot be found.", e);
-      } catch (IOException e) {
-        log.warn("Load SpanReceiver " + className + " failed.", e);
       }
     }
     for (SpanReceiver rcvr : receivers) {
-      org.htrace.Trace.addReceiver(rcvr);
-    }
-  }
-
-  private static SpanReceiver loadInstance(Class<?> implClass, Configuration conf) throws IOException {
-    SpanReceiver impl;
-    try {
-      Object o = ReflectionUtils.newInstance(implClass, conf);
-      impl = (SpanReceiver) o;
-      impl.configure(wrapHadoopConf(conf));
-    } catch (SecurityException e) {
-      throw new IOException(e);
-    } catch (IllegalArgumentException e) {
-      throw new IOException(e);
-    } catch (RuntimeException e) {
-      throw new IOException(e);
+      org.apache.htrace.Trace.addReceiver(rcvr);
     }
-
-    return impl;
   }
 
   private static void setProperty(Configuration conf, String key, String value) {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7e659af1/core/src/main/java/org/apache/accumulo/core/trace/Span.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/trace/Span.java b/core/src/main/java/org/apache/accumulo/core/trace/Span.java
index b72e6ee..702c9c1 100644
--- a/core/src/main/java/org/apache/accumulo/core/trace/Span.java
+++ b/core/src/main/java/org/apache/accumulo/core/trace/Span.java
@@ -16,29 +16,29 @@
  */
 package org.apache.accumulo.core.trace;
 
+import org.apache.htrace.NullScope;
+import org.apache.htrace.TimelineAnnotation;
+import org.apache.htrace.TraceScope;
+
 import static java.nio.charset.StandardCharsets.UTF_8;
 
 import java.util.List;
 import java.util.Map;
 
-import org.htrace.NullScope;
-import org.htrace.TimelineAnnotation;
-import org.htrace.TraceScope;
-
 /**
  * This is a wrapper for a TraceScope object, which is a wrapper for a Span and its parent. Not recommended for client use.
  */
-public class Span implements org.htrace.Span {
+public class Span implements org.apache.htrace.Span {
   public static final Span NULL_SPAN = new Span(NullScope.INSTANCE);
   private TraceScope scope = null;
-  protected org.htrace.Span span = null;
+  protected org.apache.htrace.Span span = null;
 
   public Span(TraceScope scope) {
     this.scope = scope;
     this.span = scope.getSpan();
   }
 
-  public Span(org.htrace.Span span) {
+  public Span(org.apache.htrace.Span span) {
     this.span = span;
   }
 
@@ -46,7 +46,7 @@ public class Span implements org.htrace.Span {
     return scope;
   }
 
-  public org.htrace.Span getSpan() {
+  public org.apache.htrace.Span getSpan() {
     return span;
   }
 
@@ -141,6 +141,11 @@ public class Span implements org.htrace.Span {
   }
 
   @Override
+  public String toJson() {
+    return span.toJson();
+  }
+
+  @Override
   public String toString() {
     return span.toString();
   }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7e659af1/core/src/main/java/org/apache/accumulo/core/trace/Trace.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/trace/Trace.java b/core/src/main/java/org/apache/accumulo/core/trace/Trace.java
index eba19ab..052c772 100644
--- a/core/src/main/java/org/apache/accumulo/core/trace/Trace.java
+++ b/core/src/main/java/org/apache/accumulo/core/trace/Trace.java
@@ -19,10 +19,10 @@ package org.apache.accumulo.core.trace;
 import static java.nio.charset.StandardCharsets.UTF_8;
 
 import org.apache.accumulo.core.trace.thrift.TInfo;
-import org.apache.accumulo.core.trace.wrappers.TraceRunnable;
-import org.htrace.Sampler;
-import org.htrace.TraceInfo;
-import org.htrace.wrappers.TraceProxy;
+import org.apache.htrace.Sampler;
+import org.apache.htrace.TraceInfo;
+import org.apache.htrace.wrappers.TraceProxy;
+import org.apache.htrace.wrappers.TraceRunnable;
 
 /**
  * Utility class for tracing within Accumulo. Not intended for client use!
@@ -40,17 +40,17 @@ public class Trace {
    * Start a trace span with a given description with the given sampler.
    */
   public static <T> Span on(String description, Sampler<T> sampler) {
-    return new Span(org.htrace.Trace.startSpan(description, sampler));
+    return new Span(org.apache.htrace.Trace.startSpan(description, sampler));
   }
 
   /**
    * Finish the current trace.
    */
   public static void off() {
-    org.htrace.Span span = org.htrace.Trace.currentSpan();
+    org.apache.htrace.Span span = org.apache.htrace.Trace.currentSpan();
     if (span != null) {
       span.stop();
-      org.htrace.Tracer.getInstance().continueSpan(null);
+      org.apache.htrace.Tracer.getInstance().continueSpan(null);
     }
   }
 
@@ -66,7 +66,7 @@ public class Trace {
    * Returns whether tracing is currently on.
    */
   public static boolean isTracing() {
-    return org.htrace.Trace.isTracing();
+    return org.apache.htrace.Trace.isTracing();
   }
 
   /**
@@ -76,21 +76,21 @@ public class Trace {
    */
   @Deprecated
   public static Span currentTrace() {
-    return new Span(org.htrace.Trace.currentSpan());
+    return new Span(org.apache.htrace.Trace.currentSpan());
   }
 
   /**
    * Get the trace id of the current span.
    */
   public static long currentTraceId() {
-    return org.htrace.Trace.currentSpan().getTraceId();
+    return org.apache.htrace.Trace.currentSpan().getTraceId();
   }
 
   /**
    * Start a new span with a given name, if already tracing.
    */
   public static Span start(String description) {
-    return new Span(org.htrace.Trace.startSpan(description));
+    return new Span(org.apache.htrace.Trace.startSpan(description));
   }
 
   /**
@@ -101,14 +101,14 @@ public class Trace {
       return Span.NULL_SPAN;
     }
     TraceInfo ti = new TraceInfo(info.traceId, info.parentId);
-    return new Span(org.htrace.Trace.startSpan(description, ti));
+    return new Span(org.apache.htrace.Trace.startSpan(description, ti));
   }
 
   /**
    * Add data to the current span.
    */
   public static void data(String k, String v) {
-    org.htrace.Span span = org.htrace.Trace.currentSpan();
+    org.apache.htrace.Span span = org.apache.htrace.Trace.currentSpan();
     if (span != null)
       span.addKVAnnotation(k.getBytes(UTF_8), v.getBytes(UTF_8));
   }
@@ -118,7 +118,7 @@ public class Trace {
    */
   public static Runnable wrap(Runnable runnable) {
     if (isTracing()) {
-      return new TraceRunnable(org.htrace.Trace.currentSpan(), runnable);
+      return new TraceRunnable(org.apache.htrace.Trace.currentSpan(), runnable);
     } else {
       return runnable;
     }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7e659af1/core/src/main/java/org/apache/accumulo/core/trace/Tracer.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/trace/Tracer.java b/core/src/main/java/org/apache/accumulo/core/trace/Tracer.java
index 1b42683..36895de 100644
--- a/core/src/main/java/org/apache/accumulo/core/trace/Tracer.java
+++ b/core/src/main/java/org/apache/accumulo/core/trace/Tracer.java
@@ -17,7 +17,7 @@
 package org.apache.accumulo.core.trace;
 
 import org.apache.accumulo.core.trace.thrift.TInfo;
-import org.htrace.Span;
+import org.apache.htrace.Span;
 
 public class Tracer {
   private static final TInfo DONT_TRACE = new TInfo(0, 0);
@@ -26,7 +26,7 @@ public class Tracer {
    * Obtain {@link org.apache.accumulo.core.trace.thrift.TInfo} for the current span.
    */
   public static TInfo traceInfo() {
-    Span span = org.htrace.Trace.currentSpan();
+    Span span = org.apache.htrace.Trace.currentSpan();
     if (span != null) {
       return new TInfo(span.getTraceId(), span.getSpanId());
     }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7e659af1/core/src/main/java/org/apache/accumulo/core/trace/wrappers/TraceCallable.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/trace/wrappers/TraceCallable.java b/core/src/main/java/org/apache/accumulo/core/trace/wrappers/TraceCallable.java
deleted file mode 100644
index f6a2841..0000000
--- a/core/src/main/java/org/apache/accumulo/core/trace/wrappers/TraceCallable.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.accumulo.core.trace.wrappers;
-
-import java.util.concurrent.Callable;
-
-import org.htrace.Span;
-import org.htrace.Trace;
-import org.htrace.TraceScope;
-
-/**
- * Wrap a Callable with a Span that survives a change in threads.
- *
- */
-public class TraceCallable<V> implements Callable<V> {
-  private final Callable<V> impl;
-  private final Span parent;
-  private final String description;
-
-  TraceCallable(Callable<V> impl) {
-    this(Trace.currentSpan(), impl);
-  }
-
-  TraceCallable(Span parent, Callable<V> impl) {
-    this(parent, impl, null);
-  }
-
-  TraceCallable(Span parent, Callable<V> impl, String description) {
-    this.impl = impl;
-    this.parent = parent;
-    this.description = description;
-  }
-
-  @Override
-  public V call() throws Exception {
-    if (parent != null) {
-      TraceScope chunk = Trace.startSpan(getDescription(), parent);
-      try {
-        return impl.call();
-      } finally {
-        chunk.close();
-      }
-    } else {
-      return impl.call();
-    }
-  }
-
-  public Callable<V> getImpl() {
-    return impl;
-  }
-
-  private String getDescription() {
-    return this.description == null ? Thread.currentThread().getName() : description;
-  }
-}

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7e659af1/core/src/main/java/org/apache/accumulo/core/trace/wrappers/TraceExecutorService.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/trace/wrappers/TraceExecutorService.java b/core/src/main/java/org/apache/accumulo/core/trace/wrappers/TraceExecutorService.java
deleted file mode 100644
index f2cf926..0000000
--- a/core/src/main/java/org/apache/accumulo/core/trace/wrappers/TraceExecutorService.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.accumulo.core.trace.wrappers;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.concurrent.Callable;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Future;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.TimeoutException;
-
-public class TraceExecutorService implements ExecutorService {
-
-  private final ExecutorService impl;
-
-  public TraceExecutorService(ExecutorService impl) {
-    this.impl = impl;
-  }
-
-  @Override
-  public void execute(Runnable command) {
-    impl.execute(new TraceRunnable(command));
-  }
-
-  @Override
-  public void shutdown() {
-    impl.shutdown();
-  }
-
-  @Override
-  public List<Runnable> shutdownNow() {
-    return impl.shutdownNow();
-  }
-
-  @Override
-  public boolean isShutdown() {
-    return impl.isShutdown();
-  }
-
-  @Override
-  public boolean isTerminated() {
-    return impl.isTerminated();
-  }
-
-  @Override
-  public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException {
-    return impl.awaitTermination(timeout, unit);
-  }
-
-  @Override
-  public <T> Future<T> submit(Callable<T> task) {
-    return impl.submit(new TraceCallable<T>(task));
-  }
-
-  @Override
-  public <T> Future<T> submit(Runnable task, T result) {
-    return impl.submit(new TraceRunnable(task), result);
-  }
-
-  @Override
-  public Future<?> submit(Runnable task) {
-    return impl.submit(new TraceRunnable(task));
-  }
-
-  private <T> Collection<? extends Callable<T>> wrapCollection(Collection<? extends Callable<T>> tasks) {
-    List<Callable<T>> result = new ArrayList<Callable<T>>();
-    for (Callable<T> task : tasks) {
-      result.add(new TraceCallable<T>(task));
-    }
-    return result;
-  }
-
-  @Override
-  public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks) throws InterruptedException {
-    return impl.invokeAll(wrapCollection(tasks));
-  }
-
-  @Override
-  public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) throws InterruptedException {
-    return impl.invokeAll(wrapCollection(tasks), timeout, unit);
-  }
-
-  @Override
-  public <T> T invokeAny(Collection<? extends Callable<T>> tasks) throws InterruptedException, ExecutionException {
-    return impl.invokeAny(wrapCollection(tasks));
-  }
-
-  @Override
-  public <T> T invokeAny(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) throws InterruptedException, ExecutionException,
-      TimeoutException {
-    return impl.invokeAny(wrapCollection(tasks), timeout, unit);
-  }
-}

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7e659af1/core/src/main/java/org/apache/accumulo/core/trace/wrappers/TraceRunnable.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/trace/wrappers/TraceRunnable.java b/core/src/main/java/org/apache/accumulo/core/trace/wrappers/TraceRunnable.java
deleted file mode 100644
index 629db06..0000000
--- a/core/src/main/java/org/apache/accumulo/core/trace/wrappers/TraceRunnable.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.accumulo.core.trace.wrappers;
-
-import org.htrace.Span;
-import org.htrace.Trace;
-import org.htrace.TraceScope;
-
-/**
- * Wrap a Runnable with a Span that survives a change in threads.
- *
- */
-public class TraceRunnable implements Runnable, Comparable<TraceRunnable> {
-
-  private final Span parent;
-  private final Runnable runnable;
-  private final String description;
-
-  public TraceRunnable(Runnable runnable) {
-    this(Trace.currentSpan(), runnable);
-  }
-
-  public TraceRunnable(Span parent, Runnable runnable) {
-    this(parent, runnable, null);
-  }
-
-  public TraceRunnable(Span parent, Runnable runnable, String description) {
-    this.parent = parent;
-    this.runnable = runnable;
-    this.description = description;
-  }
-
-  @Override
-  public void run() {
-    if (parent != null) {
-      TraceScope chunk = Trace.startSpan(getDescription(), parent);
-      try {
-        runnable.run();
-      } finally {
-        chunk.close();
-      }
-    } else {
-      runnable.run();
-    }
-  }
-
-  private String getDescription() {
-    return this.description == null ? Thread.currentThread().getName() : description;
-  }
-
-  @Override
-  public boolean equals(Object o) {
-    if (o instanceof TraceRunnable) {
-      return 0 == this.compareTo((TraceRunnable) o);
-    }
-
-    return false;
-  }
-
-  @SuppressWarnings({"rawtypes", "unchecked"})
-  @Override
-  public int compareTo(TraceRunnable o) {
-    return ((Comparable) this.runnable).compareTo(o.runnable);
-  }
-}

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7e659af1/examples/simple/pom.xml
----------------------------------------------------------------------
diff --git a/examples/simple/pom.xml b/examples/simple/pom.xml
index 649ff59..aa2f118 100644
--- a/examples/simple/pom.xml
+++ b/examples/simple/pom.xml
@@ -77,6 +77,10 @@
       <artifactId>hadoop-client</artifactId>
     </dependency>
     <dependency>
+      <groupId>org.apache.htrace</groupId>
+      <artifactId>htrace-core</artifactId>
+    </dependency>
+    <dependency>
       <groupId>commons-httpclient</groupId>
       <artifactId>commons-httpclient</artifactId>
       <scope>test</scope>

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7e659af1/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/TracingExample.java
----------------------------------------------------------------------
diff --git a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/TracingExample.java b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/TracingExample.java
index 2c4a8a9..6214f29 100644
--- a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/TracingExample.java
+++ b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/TracingExample.java
@@ -35,10 +35,10 @@ import org.apache.accumulo.core.data.Mutation;
 import org.apache.accumulo.core.data.Value;
 import org.apache.accumulo.core.security.Authorizations;
 import org.apache.accumulo.core.trace.DistributedTrace;
+import org.apache.htrace.Sampler;
+import org.apache.htrace.Trace;
+import org.apache.htrace.TraceScope;
 import org.apache.log4j.Logger;
-import org.htrace.Sampler;
-import org.htrace.Trace;
-import org.htrace.TraceScope;
 
 import com.beust.jcommander.Parameter;
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7e659af1/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 1629757..9ea3bee 100644
--- a/pom.xml
+++ b/pom.xml
@@ -123,7 +123,7 @@
     <forkCount>1</forkCount>
     <!-- overwritten in hadoop profiles -->
     <hadoop.version>2.2.0</hadoop.version>
-    <htrace.version>3.0.4</htrace.version>
+    <htrace.version>3.1.0-incubating</htrace.version>
     <httpclient.version>3.1</httpclient.version>
     <jetty.version>9.1.5.v20140505</jetty.version>
     <maven.compiler.source>1.7</maven.compiler.source>
@@ -380,6 +380,11 @@
         <version>${hadoop.version}</version>
       </dependency>
       <dependency>
+        <groupId>org.apache.htrace</groupId>
+        <artifactId>htrace-core</artifactId>
+        <version>${htrace.version}</version>
+      </dependency>
+      <dependency>
         <groupId>org.apache.httpcomponents</groupId>
         <artifactId>httpclient</artifactId>
         <version>4.3.1</version>
@@ -475,11 +480,6 @@
         <version>${jetty.version}</version>
       </dependency>
       <dependency>
-        <groupId>org.htrace</groupId>
-        <artifactId>htrace-core</artifactId>
-        <version>${htrace.version}</version>
-      </dependency>
-      <dependency>
         <groupId>org.powermock</groupId>
         <artifactId>powermock-api-easymock</artifactId>
         <version>${powermock.version}</version>

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7e659af1/server/base/pom.xml
----------------------------------------------------------------------
diff --git a/server/base/pom.xml b/server/base/pom.xml
index e01da1c..fbface8 100644
--- a/server/base/pom.xml
+++ b/server/base/pom.xml
@@ -85,6 +85,10 @@
       <artifactId>hadoop-client</artifactId>
     </dependency>
     <dependency>
+      <groupId>org.apache.htrace</groupId>
+      <artifactId>htrace-core</artifactId>
+    </dependency>
+    <dependency>
       <groupId>org.apache.thrift</groupId>
       <artifactId>libthrift</artifactId>
     </dependency>

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7e659af1/server/base/src/main/java/org/apache/accumulo/server/client/BulkImporter.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/client/BulkImporter.java b/server/base/src/main/java/org/apache/accumulo/server/client/BulkImporter.java
index 1d4cd08..d7284eb 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/client/BulkImporter.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/client/BulkImporter.java
@@ -55,7 +55,6 @@ import org.apache.accumulo.core.metadata.MetadataTable;
 import org.apache.accumulo.core.rpc.ThriftUtil;
 import org.apache.accumulo.core.tabletserver.thrift.TabletClientService;
 import org.apache.accumulo.core.trace.Tracer;
-import org.apache.accumulo.core.trace.wrappers.TraceRunnable;
 import org.apache.accumulo.core.util.CachedConfiguration;
 import org.apache.accumulo.core.util.LoggingRunnable;
 import org.apache.accumulo.core.util.NamingThreadFactory;
@@ -68,6 +67,7 @@ import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.io.Text;
+import org.apache.htrace.wrappers.TraceRunnable;
 import org.apache.thrift.TServiceClient;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7e659af1/server/master/pom.xml
----------------------------------------------------------------------
diff --git a/server/master/pom.xml b/server/master/pom.xml
index dbeb429..cf92d4a 100644
--- a/server/master/pom.xml
+++ b/server/master/pom.xml
@@ -65,6 +65,10 @@
       <artifactId>hadoop-client</artifactId>
     </dependency>
     <dependency>
+      <groupId>org.apache.htrace</groupId>
+      <artifactId>htrace-core</artifactId>
+    </dependency>
+    <dependency>
       <groupId>org.apache.thrift</groupId>
       <artifactId>libthrift</artifactId>
     </dependency>

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7e659af1/server/master/src/main/java/org/apache/accumulo/master/tableOps/BulkImport.java
----------------------------------------------------------------------
diff --git a/server/master/src/main/java/org/apache/accumulo/master/tableOps/BulkImport.java b/server/master/src/main/java/org/apache/accumulo/master/tableOps/BulkImport.java
index 16c317a..e40137b 100644
--- a/server/master/src/main/java/org/apache/accumulo/master/tableOps/BulkImport.java
+++ b/server/master/src/main/java/org/apache/accumulo/master/tableOps/BulkImport.java
@@ -60,7 +60,6 @@ import org.apache.accumulo.core.metadata.MetadataTable;
 import org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection;
 import org.apache.accumulo.core.security.Authorizations;
 import org.apache.accumulo.core.trace.Tracer;
-import org.apache.accumulo.core.trace.wrappers.TraceExecutorService;
 import org.apache.accumulo.core.util.Pair;
 import org.apache.accumulo.core.util.SimpleThreadPool;
 import org.apache.accumulo.core.util.UtilWaitThread;
@@ -81,6 +80,7 @@ import org.apache.hadoop.fs.FileStatus;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.io.MapFile;
 import org.apache.hadoop.io.Text;
+import org.apache.htrace.wrappers.TraceExecutorService;
 import org.apache.log4j.Logger;
 import org.apache.thrift.TException;
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7e659af1/server/tracer/pom.xml
----------------------------------------------------------------------
diff --git a/server/tracer/pom.xml b/server/tracer/pom.xml
index b895d67..57e1df1 100644
--- a/server/tracer/pom.xml
+++ b/server/tracer/pom.xml
@@ -57,6 +57,10 @@
       <artifactId>hadoop-client</artifactId>
     </dependency>
     <dependency>
+      <groupId>org.apache.htrace</groupId>
+      <artifactId>htrace-core</artifactId>
+    </dependency>
+    <dependency>
       <groupId>org.apache.thrift</groupId>
       <artifactId>libthrift</artifactId>
     </dependency>
@@ -65,10 +69,6 @@
       <artifactId>zookeeper</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.htrace</groupId>
-      <artifactId>htrace-core</artifactId>
-    </dependency>
-    <dependency>
       <groupId>org.slf4j</groupId>
       <artifactId>slf4j-api</artifactId>
     </dependency>

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7e659af1/server/tracer/src/main/java/org/apache/accumulo/tracer/AsyncSpanReceiver.java
----------------------------------------------------------------------
diff --git a/server/tracer/src/main/java/org/apache/accumulo/tracer/AsyncSpanReceiver.java b/server/tracer/src/main/java/org/apache/accumulo/tracer/AsyncSpanReceiver.java
index 55378ad..59596a2 100644
--- a/server/tracer/src/main/java/org/apache/accumulo/tracer/AsyncSpanReceiver.java
+++ b/server/tracer/src/main/java/org/apache/accumulo/tracer/AsyncSpanReceiver.java
@@ -32,11 +32,11 @@ import java.util.concurrent.ConcurrentLinkedQueue;
 import org.apache.accumulo.core.trace.DistributedTrace;
 import org.apache.accumulo.tracer.thrift.Annotation;
 import org.apache.accumulo.tracer.thrift.RemoteSpan;
+import org.apache.htrace.HTraceConfiguration;
+import org.apache.htrace.Span;
+import org.apache.htrace.SpanReceiver;
+import org.apache.htrace.TimelineAnnotation;
 import org.apache.log4j.Logger;
-import org.htrace.HTraceConfiguration;
-import org.htrace.Span;
-import org.htrace.SpanReceiver;
-import org.htrace.TimelineAnnotation;
 
 /**
  * Deliver Span information periodically to a destination.
@@ -50,6 +50,8 @@ public abstract class AsyncSpanReceiver<SpanKey,Destination> implements SpanRece
 
   private static final Logger log = Logger.getLogger(AsyncSpanReceiver.class);
 
+  public static final String SEND_TIMER_MILLIS = "send.timer.millis";
+
   private final Map<SpanKey,Destination> clients = new HashMap<SpanKey,Destination>();
 
   protected String host = null;
@@ -64,11 +66,21 @@ public abstract class AsyncSpanReceiver<SpanKey,Destination> implements SpanRece
   Timer timer = new Timer("SpanSender", true);
   protected final AbstractQueue<RemoteSpan> sendQueue = new ConcurrentLinkedQueue<RemoteSpan>();
 
-  public AsyncSpanReceiver() {
-    this(1000);
-  }
+  // Visible for testing
+  AsyncSpanReceiver() {}
+
+  public AsyncSpanReceiver(HTraceConfiguration conf) {
+    host = conf.get(DistributedTrace.TRACE_HOST_PROPERTY, host);
+    if (host == null) {
+      try {
+        host = InetAddress.getLocalHost().getCanonicalHostName().toString();
+      } catch (UnknownHostException e) {
+        host = "unknown";
+      }
+    }
+    service = conf.get(DistributedTrace.TRACE_SERVICE_PROPERTY, service);
 
-  public AsyncSpanReceiver(long millis) {
+    int millis = conf.getInt(SEND_TIMER_MILLIS, 1000);
     timer.schedule(new TimerTask() {
       @Override
       public void run() {
@@ -158,17 +170,4 @@ public abstract class AsyncSpanReceiver<SpanKey,Destination> implements SpanRece
     }
   }
 
-  @Override
-  public void configure(HTraceConfiguration conf) {
-    host = conf.get(DistributedTrace.TRACE_HOST_PROPERTY, host);
-    if (host == null) {
-      try {
-        host = InetAddress.getLocalHost().getCanonicalHostName().toString();
-      } catch (UnknownHostException e) {
-        host = "unknown";
-      }
-    }
-    service = conf.get(DistributedTrace.TRACE_SERVICE_PROPERTY, service);
-  }
-
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7e659af1/server/tracer/src/main/java/org/apache/accumulo/tracer/SendSpansViaThrift.java
----------------------------------------------------------------------
diff --git a/server/tracer/src/main/java/org/apache/accumulo/tracer/SendSpansViaThrift.java b/server/tracer/src/main/java/org/apache/accumulo/tracer/SendSpansViaThrift.java
index c585cc1..c17d2c8 100644
--- a/server/tracer/src/main/java/org/apache/accumulo/tracer/SendSpansViaThrift.java
+++ b/server/tracer/src/main/java/org/apache/accumulo/tracer/SendSpansViaThrift.java
@@ -25,6 +25,7 @@ import java.util.Map;
 
 import org.apache.accumulo.tracer.thrift.RemoteSpan;
 import org.apache.accumulo.tracer.thrift.SpanReceiver.Client;
+import org.apache.htrace.HTraceConfiguration;
 import org.apache.thrift.protocol.TBinaryProtocol;
 import org.apache.thrift.protocol.TProtocol;
 import org.apache.thrift.transport.TSocket;
@@ -39,12 +40,11 @@ public class SendSpansViaThrift extends AsyncSpanReceiver<String,Client> {
 
   private static final String THRIFT = "thrift://";
 
-  public SendSpansViaThrift() {
-    super();
-  }
+  // Visible for testing
+  SendSpansViaThrift() {}
 
-  public SendSpansViaThrift(long millis) {
-    super(millis);
+  public SendSpansViaThrift(HTraceConfiguration conf) {
+    super(conf);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7e659af1/server/tracer/src/main/java/org/apache/accumulo/tracer/SpanTree.java
----------------------------------------------------------------------
diff --git a/server/tracer/src/main/java/org/apache/accumulo/tracer/SpanTree.java b/server/tracer/src/main/java/org/apache/accumulo/tracer/SpanTree.java
index e8f8056..c7682c1 100644
--- a/server/tracer/src/main/java/org/apache/accumulo/tracer/SpanTree.java
+++ b/server/tracer/src/main/java/org/apache/accumulo/tracer/SpanTree.java
@@ -24,7 +24,7 @@ import java.util.Map;
 import java.util.Set;
 
 import org.apache.accumulo.tracer.thrift.RemoteSpan;
-import org.htrace.Span;
+import org.apache.htrace.Span;
 
 public class SpanTree {
   final Map<Long,List<Long>> parentChildren = new HashMap<Long,List<Long>>();

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7e659af1/server/tracer/src/main/java/org/apache/accumulo/tracer/TraceDump.java
----------------------------------------------------------------------
diff --git a/server/tracer/src/main/java/org/apache/accumulo/tracer/TraceDump.java b/server/tracer/src/main/java/org/apache/accumulo/tracer/TraceDump.java
index 64fee7e..e4eb70e 100644
--- a/server/tracer/src/main/java/org/apache/accumulo/tracer/TraceDump.java
+++ b/server/tracer/src/main/java/org/apache/accumulo/tracer/TraceDump.java
@@ -37,7 +37,7 @@ import org.apache.accumulo.core.data.Range;
 import org.apache.accumulo.core.data.Value;
 import org.apache.accumulo.tracer.thrift.RemoteSpan;
 import org.apache.hadoop.io.Text;
-import org.htrace.Span;
+import org.apache.htrace.Span;
 
 import com.beust.jcommander.Parameter;
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7e659af1/server/tracer/src/main/java/org/apache/accumulo/tracer/TraceServer.java
----------------------------------------------------------------------
diff --git a/server/tracer/src/main/java/org/apache/accumulo/tracer/TraceServer.java b/server/tracer/src/main/java/org/apache/accumulo/tracer/TraceServer.java
index f855d9c..3e4cded 100644
--- a/server/tracer/src/main/java/org/apache/accumulo/tracer/TraceServer.java
+++ b/server/tracer/src/main/java/org/apache/accumulo/tracer/TraceServer.java
@@ -58,6 +58,7 @@ import org.apache.accumulo.tracer.thrift.RemoteSpan;
 import org.apache.accumulo.tracer.thrift.SpanReceiver.Iface;
 import org.apache.accumulo.tracer.thrift.SpanReceiver.Processor;
 import org.apache.hadoop.io.Text;
+import org.apache.htrace.Span;
 import org.apache.log4j.Logger;
 import org.apache.thrift.TByteArrayOutputStream;
 import org.apache.thrift.TException;
@@ -72,7 +73,6 @@ import org.apache.zookeeper.WatchedEvent;
 import org.apache.zookeeper.Watcher;
 import org.apache.zookeeper.Watcher.Event.EventType;
 import org.apache.zookeeper.Watcher.Event.KeeperState;
-import org.htrace.Span;
 
 public class TraceServer implements Watcher {
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7e659af1/server/tracer/src/main/java/org/apache/accumulo/tracer/ZooTraceClient.java
----------------------------------------------------------------------
diff --git a/server/tracer/src/main/java/org/apache/accumulo/tracer/ZooTraceClient.java b/server/tracer/src/main/java/org/apache/accumulo/tracer/ZooTraceClient.java
index 3db77f0..1599534 100644
--- a/server/tracer/src/main/java/org/apache/accumulo/tracer/ZooTraceClient.java
+++ b/server/tracer/src/main/java/org/apache/accumulo/tracer/ZooTraceClient.java
@@ -30,11 +30,11 @@ import java.util.concurrent.TimeUnit;
 import org.apache.accumulo.core.Constants;
 import org.apache.accumulo.core.trace.DistributedTrace;
 import org.apache.accumulo.fate.zookeeper.ZooReader;
+import org.apache.htrace.HTraceConfiguration;
 import org.apache.log4j.Logger;
 import org.apache.zookeeper.KeeperException;
 import org.apache.zookeeper.WatchedEvent;
 import org.apache.zookeeper.Watcher;
-import org.htrace.HTraceConfiguration;
 
 import com.google.common.util.concurrent.ThreadFactoryBuilder;
 
@@ -53,15 +53,22 @@ public class ZooTraceClient extends SendSpansViaThrift implements Watcher {
   final List<String> hosts = new ArrayList<String>();
   long retryPause = 5000l;
 
-  public ZooTraceClient() {
-    super();
-  }
+  // Visible for testing
+  ZooTraceClient() {}
+
+  public ZooTraceClient(HTraceConfiguration conf) {
+    super(conf);
 
-  public ZooTraceClient(long millis) {
-    super(millis);
+    String keepers = conf.get(DistributedTrace.TRACER_ZK_HOST);
+    if (keepers == null)
+      throw new IllegalArgumentException("Must configure " + DistributedTrace.TRACER_ZK_HOST);
+    int timeout = conf.getInt(DistributedTrace.TRACER_ZK_TIMEOUT, DEFAULT_TIMEOUT);
+    zoo = new ZooReader(keepers, timeout);
+    path = conf.get(DistributedTrace.TRACER_ZK_PATH, Constants.ZTRACERS);
+    setInitialTraceHosts();
   }
 
-  // Visibile for testing
+  // Visible for testing
   protected void setRetryPause(long pause) {
     retryPause = pause;
   }
@@ -76,18 +83,6 @@ public class ZooTraceClient extends SendSpansViaThrift implements Watcher {
   }
 
   @Override
-  public void configure(HTraceConfiguration conf) {
-    super.configure(conf);
-    String keepers = conf.get(DistributedTrace.TRACER_ZK_HOST);
-    if (keepers == null)
-      throw new IllegalArgumentException("Must configure " + DistributedTrace.TRACER_ZK_HOST);
-    int timeout = conf.getInt(DistributedTrace.TRACER_ZK_TIMEOUT, DEFAULT_TIMEOUT);
-    zoo = new ZooReader(keepers, timeout);
-    path = conf.get(DistributedTrace.TRACER_ZK_PATH, Constants.ZTRACERS);
-    setInitialTraceHosts();
-  }
-
-  @Override
   public void process(WatchedEvent event) {
     log.debug("Processing event for trace server zk watch");
     try {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7e659af1/server/tracer/src/test/java/org/apache/accumulo/tracer/TracerTest.java
----------------------------------------------------------------------
diff --git a/server/tracer/src/test/java/org/apache/accumulo/tracer/TracerTest.java b/server/tracer/src/test/java/org/apache/accumulo/tracer/TracerTest.java
index 76ed910..e389679 100644
--- a/server/tracer/src/test/java/org/apache/accumulo/tracer/TracerTest.java
+++ b/server/tracer/src/test/java/org/apache/accumulo/tracer/TracerTest.java
@@ -38,6 +38,10 @@ import org.apache.accumulo.core.trace.wrappers.TraceWrap;
 import org.apache.accumulo.tracer.thrift.TestService;
 import org.apache.accumulo.tracer.thrift.TestService.Iface;
 import org.apache.accumulo.tracer.thrift.TestService.Processor;
+import org.apache.htrace.HTraceConfiguration;
+import org.apache.htrace.Sampler;
+import org.apache.htrace.SpanReceiver;
+import org.apache.htrace.wrappers.TraceProxy;
 import org.apache.thrift.TException;
 import org.apache.thrift.protocol.TBinaryProtocol;
 import org.apache.thrift.server.TServer;
@@ -45,10 +49,6 @@ import org.apache.thrift.server.TThreadPoolServer;
 import org.apache.thrift.transport.TServerSocket;
 import org.apache.thrift.transport.TSocket;
 import org.apache.thrift.transport.TTransport;
-import org.htrace.HTraceConfiguration;
-import org.htrace.Sampler;
-import org.htrace.SpanReceiver;
-import org.htrace.wrappers.TraceProxy;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -81,8 +81,12 @@ public class TracerTest {
   static class TestReceiver implements SpanReceiver {
     public Map<Long,List<SpanStruct>> traces = new HashMap<Long,List<SpanStruct>>();
 
+    public TestReceiver() {}
+
+    public TestReceiver(HTraceConfiguration conf) {}
+
     @Override
-    public void receiveSpan(org.htrace.Span s) {
+    public void receiveSpan(org.apache.htrace.Span s) {
       long traceId = s.getTraceId();
       SpanStruct span = new SpanStruct(traceId, s.getSpanId(), s.getParentId(), s.getStartTimeMillis(), s.getStopTimeMillis(), s.getDescription(),
           s.getKVAnnotations());
@@ -92,9 +96,6 @@ public class TracerTest {
     }
 
     @Override
-    public void configure(HTraceConfiguration conf) {}
-
-    @Override
     public void close() throws IOException {}
   }
 
@@ -102,7 +103,7 @@ public class TracerTest {
   @Test
   public void testTrace() throws Exception {
     TestReceiver tracer = new TestReceiver();
-    org.htrace.Trace.addReceiver(tracer);
+    org.apache.htrace.Trace.addReceiver(tracer);
 
     assertFalse(Trace.isTracing());
     Trace.start("nop").stop();
@@ -160,7 +161,7 @@ public class TracerTest {
   @Test
   public void testThrift() throws Exception {
     TestReceiver tracer = new TestReceiver();
-    org.htrace.Trace.addReceiver(tracer);
+    org.apache.htrace.Trace.addReceiver(tracer);
 
     ServerSocket socket = new ServerSocket(0);
     TServerSocket transport = new TServerSocket(socket);

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7e659af1/server/tserver/pom.xml
----------------------------------------------------------------------
diff --git a/server/tserver/pom.xml b/server/tserver/pom.xml
index 96eb046..a4bc3de 100644
--- a/server/tserver/pom.xml
+++ b/server/tserver/pom.xml
@@ -81,6 +81,10 @@
       <artifactId>hadoop-client</artifactId>
     </dependency>
     <dependency>
+      <groupId>org.apache.htrace</groupId>
+      <artifactId>htrace-core</artifactId>
+    </dependency>
+    <dependency>
       <groupId>org.apache.thrift</groupId>
       <artifactId>libthrift</artifactId>
     </dependency>

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7e659af1/server/tserver/src/main/java/org/apache/accumulo/tserver/CompactionQueue.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/CompactionQueue.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/CompactionQueue.java
index 0cb04a7..3ba7a5c 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/CompactionQueue.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/CompactionQueue.java
@@ -16,9 +16,12 @@
  */
 package org.apache.accumulo.tserver;
 
+import org.apache.htrace.wrappers.TraceRunnable;
+
 import java.util.AbstractQueue;
 import java.util.Collection;
 import java.util.Collections;
+import java.util.Comparator;
 import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.List;
@@ -28,14 +31,21 @@ import java.util.concurrent.TimeUnit;
 @SuppressWarnings({"rawtypes", "unchecked"})
 public class CompactionQueue extends AbstractQueue<Runnable> implements BlockingQueue<Runnable> {
 
-  private List<Comparable> task = new LinkedList<Comparable>();
+  private List<TraceRunnable> task = new LinkedList<TraceRunnable>();
+
+  private static final Comparator<TraceRunnable> comparator = new Comparator<TraceRunnable>() {
+    @Override
+    public int compare(TraceRunnable o1, TraceRunnable o2) {
+      return ((Comparable) o1.getRunnable()).compareTo(o2.getRunnable());
+    }
+  };
 
   @Override
   public synchronized Runnable poll() {
     if (task.size() == 0)
       return null;
 
-    Comparable min = Collections.min(task);
+    TraceRunnable min = Collections.min(task, comparator);
     task.remove(min);
     return (Runnable) min;
   }
@@ -45,26 +55,26 @@ public class CompactionQueue extends AbstractQueue<Runnable> implements Blocking
     if (task.size() == 0)
       return null;
 
-    Comparable min = Collections.min(task);
+    TraceRunnable min = Collections.min(task, comparator);
     return (Runnable) min;
   }
 
   @Override
   public synchronized boolean offer(Runnable e) {
-    task.add((Comparable) e);
+    task.add((TraceRunnable) e);
     notify();
     return true;
   }
 
   @Override
   public synchronized void put(Runnable e) throws InterruptedException {
-    task.add((Comparable) e);
+    task.add((TraceRunnable) e);
     notify();
   }
 
   @Override
   public synchronized boolean offer(Runnable e, long timeout, TimeUnit unit) throws InterruptedException {
-    task.add((Comparable) e);
+    task.add((TraceRunnable) e);
     notify();
     return true;
   }
@@ -102,11 +112,11 @@ public class CompactionQueue extends AbstractQueue<Runnable> implements Blocking
 
   @Override
   public synchronized int drainTo(Collection<? super Runnable> c, int maxElements) {
-    Collections.sort(task);
+    Collections.sort(task, comparator);
 
     int num = Math.min(task.size(), maxElements);
 
-    Iterator<Comparable> iter = task.iterator();
+    Iterator<TraceRunnable> iter = task.iterator();
     for (int i = 0; i < num; i++) {
       c.add((Runnable) iter.next());
       iter.remove();
@@ -117,9 +127,9 @@ public class CompactionQueue extends AbstractQueue<Runnable> implements Blocking
 
   @Override
   public synchronized Iterator<Runnable> iterator() {
-    Collections.sort(task);
+    Collections.sort(task, comparator);
 
-    final Iterator<Comparable> iter = task.iterator();
+    final Iterator<TraceRunnable> iter = task.iterator();
 
     return new Iterator<Runnable>() {
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7e659af1/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServerResourceManager.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServerResourceManager.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServerResourceManager.java
index 351d526..67e5652 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServerResourceManager.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServerResourceManager.java
@@ -40,7 +40,6 @@ import org.apache.accumulo.core.conf.Property;
 import org.apache.accumulo.core.data.KeyExtent;
 import org.apache.accumulo.core.file.blockfile.cache.LruBlockCache;
 import org.apache.accumulo.core.metadata.schema.DataFileValue;
-import org.apache.accumulo.core.trace.wrappers.TraceExecutorService;
 import org.apache.accumulo.core.util.Daemon;
 import org.apache.accumulo.core.util.LoggingRunnable;
 import org.apache.accumulo.core.util.NamingThreadFactory;
@@ -60,6 +59,7 @@ import org.apache.accumulo.tserver.compaction.DefaultCompactionStrategy;
 import org.apache.accumulo.tserver.compaction.MajorCompactionReason;
 import org.apache.accumulo.tserver.compaction.MajorCompactionRequest;
 import org.apache.accumulo.tserver.tablet.Tablet;
+import org.apache.htrace.wrappers.TraceExecutorService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7e659af1/trace/pom.xml
----------------------------------------------------------------------
diff --git a/trace/pom.xml b/trace/pom.xml
index b4e4b7e..7777bb3 100644
--- a/trace/pom.xml
+++ b/trace/pom.xml
@@ -31,7 +31,7 @@
       <artifactId>accumulo-core</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.htrace</groupId>
+      <groupId>org.apache.htrace</groupId>
       <artifactId>htrace-core</artifactId>
     </dependency>
   </dependencies>

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7e659af1/trace/src/main/java/org/apache/accumulo/trace/instrument/CountSampler.java
----------------------------------------------------------------------
diff --git a/trace/src/main/java/org/apache/accumulo/trace/instrument/CountSampler.java b/trace/src/main/java/org/apache/accumulo/trace/instrument/CountSampler.java
index f6d256a..05d9acb 100644
--- a/trace/src/main/java/org/apache/accumulo/trace/instrument/CountSampler.java
+++ b/trace/src/main/java/org/apache/accumulo/trace/instrument/CountSampler.java
@@ -16,13 +16,17 @@
  */
 package org.apache.accumulo.trace.instrument;
 
+import org.apache.htrace.HTraceConfiguration;
+
+import java.util.Collections;
+
 /**
  * @deprecated since 1.7, use org.htrace.impl.CountSampler instead
  */
 @Deprecated
-public class CountSampler extends org.htrace.impl.CountSampler implements Sampler {
+public class CountSampler extends org.apache.htrace.impl.CountSampler implements Sampler {
   public CountSampler(long frequency) {
-    super(frequency);
+    super(HTraceConfiguration.fromMap(Collections.singletonMap(CountSampler.SAMPLER_FREQUENCY_CONF_KEY, Long.toString(frequency))));
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7e659af1/trace/src/main/java/org/apache/accumulo/trace/instrument/Sampler.java
----------------------------------------------------------------------
diff --git a/trace/src/main/java/org/apache/accumulo/trace/instrument/Sampler.java b/trace/src/main/java/org/apache/accumulo/trace/instrument/Sampler.java
index 9563f8f..b82d72f 100644
--- a/trace/src/main/java/org/apache/accumulo/trace/instrument/Sampler.java
+++ b/trace/src/main/java/org/apache/accumulo/trace/instrument/Sampler.java
@@ -20,7 +20,7 @@ package org.apache.accumulo.trace.instrument;
  * @deprecated since 1.7, use org.htrace.Sampler instead
  */
 @Deprecated
-public interface Sampler extends org.htrace.Sampler<Object> {
+public interface Sampler extends org.apache.htrace.Sampler<Object> {
 
   boolean next();
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7e659af1/trace/src/main/java/org/apache/accumulo/trace/instrument/Span.java
----------------------------------------------------------------------
diff --git a/trace/src/main/java/org/apache/accumulo/trace/instrument/Span.java b/trace/src/main/java/org/apache/accumulo/trace/instrument/Span.java
index dbd8882..9104d5f 100644
--- a/trace/src/main/java/org/apache/accumulo/trace/instrument/Span.java
+++ b/trace/src/main/java/org/apache/accumulo/trace/instrument/Span.java
@@ -27,17 +27,17 @@ import java.util.Map.Entry;
  */
 @Deprecated
 public class Span extends org.apache.accumulo.core.trace.Span implements CloudtraceSpan {
-  public static final long ROOT_SPAN_ID = org.htrace.Span.ROOT_SPAN_ID;
+  public static final long ROOT_SPAN_ID = org.apache.htrace.Span.ROOT_SPAN_ID;
 
   public Span(org.apache.accumulo.core.trace.Span span) {
     super(span.getScope());
   }
 
-  public Span(org.htrace.TraceScope scope) {
+  public Span(org.apache.htrace.TraceScope scope) {
     super(scope);
   }
 
-  public Span(org.htrace.Span span) {
+  public Span(org.apache.htrace.Span span) {
     super(span);
   }
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7e659af1/trace/src/main/java/org/apache/accumulo/trace/instrument/Trace.java
----------------------------------------------------------------------
diff --git a/trace/src/main/java/org/apache/accumulo/trace/instrument/Trace.java b/trace/src/main/java/org/apache/accumulo/trace/instrument/Trace.java
index 557d381..0d4b0cc 100644
--- a/trace/src/main/java/org/apache/accumulo/trace/instrument/Trace.java
+++ b/trace/src/main/java/org/apache/accumulo/trace/instrument/Trace.java
@@ -42,7 +42,7 @@ public class Trace extends org.apache.accumulo.core.trace.Trace {
 
   // If we are tracing, return the current span, else null
   public static Span currentTrace() {
-    return new Span(org.htrace.Trace.currentSpan());
+    return new Span(org.apache.htrace.Trace.currentSpan());
   }
 
   // Create a new time span, if tracing is on
@@ -57,14 +57,14 @@ public class Trace extends org.apache.accumulo.core.trace.Trace {
 
   // Initiate a trace in this thread, starting now
   public static Span startThread(Span parent, String description) {
-    return new Span(org.htrace.Trace.startSpan(description, parent.getSpan()));
+    return new Span(org.apache.htrace.Trace.startSpan(description, parent.getSpan()));
   }
 
   // Stop a trace in this thread, starting now
   public static void endThread(Span span) {
     if (span != null) {
       span.stop();
-      org.htrace.Tracer.getInstance().continueSpan(null);
+      org.apache.htrace.Tracer.getInstance().continueSpan(null);
     }
   }
 


Mime
View raw message