maedhroz commented on code in PR #3274:
URL: https://github.com/apache/cassandra/pull/3274#discussion_r1591491986


##########
src/java/org/apache/cassandra/concurrent/FutureTask.java:
##########
@@ -89,6 +89,34 @@ protected boolean tryFailure(Throwable t)
 
     public static <T> Callable<T> callable(Runnable run)
     {
+        if (run instanceof DebuggableTask.RunnableDebuggableTask)
+        {
+            return new DebuggableTask.CallableDebuggableTask<T>()
+            {
+                final RunnableDebuggableTask task = (RunnableDebuggableTask) 
run;
+                public T call()
+                {
+                    run.run();
+                    return null;
+                }
+
+                public long creationTimeNanos()
+                {
+                    return task.creationTimeNanos();
+                }
+
+                public long startTimeNanos()
+                {
+                    return task.startTimeNanos();
+                }
+
+                public String description()
+                {
+                    return task.description();
+                }
+            };
+        }

Review Comment:
   Aside: I think there's actually a chance the changes I made to `TaskFactory` 
in CASSANDRA-19577 overlap w/ this. In other words, I think `callable()` doing 
this might actually make my `TaskFactory` changes unnecessary. I don't think 
our changes will break each other though...



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to