You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by jb...@apache.org on 2013/06/21 20:33:38 UTC
[2/7] git commit: restore fetching global trace state in default
.execute method
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/110d283a
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/110d283a
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/110d283a
Branch: refs/heads/trunk
Commit: 110d283afd780774a44368b17177b5e8e781e37f
Parents: e75e33f
Author: Jonathan Ellis <jb...@apache.org>
Authored: Fri Jun 21 11:13:21 2013 -0500
Committer: Jonathan Ellis <jb...@apache.org>
Committed: Fri Jun 21 11:13:21 2013 -0500
----------------------------------------------------------------------
.../concurrent/DebuggableThreadPoolExecutor.java | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cassandra/blob/110d283a/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);