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-3507 remove TraceRunnable wrapper from thread pool threads and remove uses of the endThread method of stopping tracing
Date Tue, 27 Jan 2015 18:06:59 GMT
Repository: accumulo
Updated Branches:
  refs/heads/master 2b2df4bd0 -> 46d3fa9df


ACCUMULO-3507 remove TraceRunnable wrapper from thread pool threads and remove uses of the
endThread method of stopping tracing


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

Branch: refs/heads/master
Commit: 46d3fa9dfb90f615e53fdf4184760212b56cc7f4
Parents: 2b2df4b
Author: Billie Rinaldi <billie.rinaldi@gmail.com>
Authored: Fri Jan 23 09:50:26 2015 -0800
Committer: Billie Rinaldi <billie.rinaldi@gmail.com>
Committed: Tue Jan 27 10:05:35 2015 -0800

----------------------------------------------------------------------
 .../accumulo/core/trace/wrappers/TraceCallable.java    |  2 +-
 .../core/trace/wrappers/TraceExecutorService.java      | 13 -------------
 .../accumulo/core/trace/wrappers/TraceRunnable.java    |  2 +-
 .../apache/accumulo/core/util/NamingThreadFactory.java |  3 +--
 .../org/apache/accumulo/trace/instrument/Trace.java    |  6 ++++--
 5 files changed, 7 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/46d3fa9d/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
index d8b9b78..f6a2841 100644
--- 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
@@ -52,7 +52,7 @@ public class TraceCallable<V> implements Callable<V> {
       try {
         return impl.call();
       } finally {
-        TraceExecutorService.endThread(chunk.getSpan());
+        chunk.close();
       }
     } else {
       return impl.call();

http://git-wip-us.apache.org/repos/asf/accumulo/blob/46d3fa9d/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
index 0ff5751..f2cf926 100644
--- 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
@@ -26,9 +26,6 @@ import java.util.concurrent.Future;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeoutException;
 
-import org.htrace.Span;
-import org.htrace.Tracer;
-
 public class TraceExecutorService implements ExecutorService {
 
   private final ExecutorService impl;
@@ -110,14 +107,4 @@ public class TraceExecutorService implements ExecutorService {
       TimeoutException {
     return impl.invokeAny(wrapCollection(tasks), timeout, unit);
   }
-
-  /**
-   * Finish a given trace and set the span for the current thread to null.
-   */
-  public static void endThread(Span span) {
-    if (span != null) {
-      span.stop();
-      Tracer.getInstance().continueSpan(null);
-    }
-  }
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/46d3fa9d/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
index a870cbf..629db06 100644
--- 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
@@ -51,7 +51,7 @@ public class TraceRunnable implements Runnable, Comparable<TraceRunnable>
{
       try {
         runnable.run();
       } finally {
-        TraceExecutorService.endThread(chunk.getSpan());
+        chunk.close();
       }
     } else {
       runnable.run();

http://git-wip-us.apache.org/repos/asf/accumulo/blob/46d3fa9d/core/src/main/java/org/apache/accumulo/core/util/NamingThreadFactory.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/util/NamingThreadFactory.java b/core/src/main/java/org/apache/accumulo/core/util/NamingThreadFactory.java
index ebe9002..7a0b6a2 100644
--- a/core/src/main/java/org/apache/accumulo/core/util/NamingThreadFactory.java
+++ b/core/src/main/java/org/apache/accumulo/core/util/NamingThreadFactory.java
@@ -19,7 +19,6 @@ package org.apache.accumulo.core.util;
 import java.util.concurrent.ThreadFactory;
 import java.util.concurrent.atomic.AtomicInteger;
 
-import org.apache.accumulo.core.trace.wrappers.TraceRunnable;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -34,7 +33,7 @@ public class NamingThreadFactory implements ThreadFactory {
   }
 
   public Thread newThread(Runnable r) {
-    return new Daemon(new LoggingRunnable(log, new TraceRunnable(r)), name + " " + threadNum.getAndIncrement());
+    return new Daemon(new LoggingRunnable(log, r), name + " " + threadNum.getAndIncrement());
   }
 
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/46d3fa9d/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 ddf3d69..a44512f 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
@@ -16,7 +16,6 @@
  */
 package org.apache.accumulo.trace.instrument;
 
-import org.apache.accumulo.core.trace.wrappers.TraceExecutorService;
 import org.apache.accumulo.trace.thrift.TInfo;
 
 /**
@@ -65,7 +64,10 @@ public class Trace extends org.apache.accumulo.core.trace.Trace {
 
   // Stop a trace in this thread, starting now
   public static void endThread(Span span) {
-    TraceExecutorService.endThread(span.getSpan());
+    if (span != null) {
+      span.stop();
+      org.htrace.Tracer.getInstance().continueSpan(null);
+    }
   }
 
   // Wrap the runnable in a new span, if tracing


Mime
View raw message