restore fetching global trace state in default .execute method
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/b8b96bdb Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/b8b96bdb Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/b8b96bdb Branch: refs/heads/trunk Commit: b8b96bdb733aed87197df3f01834fe47cc756ae8 Parents: ded233e Author: Jonathan Ellis <[email protected]> Authored: Fri Jun 21 11:13:21 2013 -0500 Committer: Jason Brown <[email protected]> Committed: Fri Jun 21 09:55:34 2013 -0700 ---------------------------------------------------------------------- .../concurrent/DebuggableThreadPoolExecutor.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/b8b96bdb/src/java/org/apache/cassandra/concurrent/DebuggableThreadPoolExecutor.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/concurrent/DebuggableThreadPoolExecutor.java b/src/java/org/apache/cassandra/concurrent/DebuggableThreadPoolExecutor.java index 26441ec..46a3216 100644 --- a/src/java/org/apache/cassandra/concurrent/DebuggableThreadPoolExecutor.java +++ b/src/java/org/apache/cassandra/concurrent/DebuggableThreadPoolExecutor.java @@ -133,7 +133,9 @@ public class DebuggableThreadPoolExecutor extends ThreadPoolExecutor implements public void execute(Runnable command, TraceState state) { - super.execute(state == null ? command : new TraceSessionWrapper<Object>(command, state)); + super.execute(state == null || command instanceof TraceSessionWrapper + ? command + : new TraceSessionWrapper<Object>(command, state)); } // execute does not call newTaskFor @@ -141,7 +143,7 @@ public class DebuggableThreadPoolExecutor extends ThreadPoolExecutor implements public void execute(Runnable command) { super.execute(isTracing() && !(command instanceof TraceSessionWrapper) - ? new TraceSessionWrapper<Object>(command) + ? new TraceSessionWrapper<Object>(Executors.callable(command, null)) : command); } @@ -261,11 +263,6 @@ public class DebuggableThreadPoolExecutor extends ThreadPoolExecutor implements { private final TraceState state; - public TraceSessionWrapper(Runnable command) - { - this(command, null); - } - public TraceSessionWrapper(Callable<T> callable) { super(callable);
