accumulo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] jschmidt10 commented on a change in pull request #402: ACCUMULO-4615: Updated get status for thread safety and with a per-task timeout
Date Mon, 26 Mar 2018 00:03:22 GMT
jschmidt10 commented on a change in pull request #402: ACCUMULO-4615: Updated get status for
thread safety and with a per-task timeout
URL: https://github.com/apache/accumulo/pull/402#discussion_r176959726
 
 

 ##########
 File path: server/master/src/main/java/org/apache/accumulo/master/TimeoutTaskExecutor.java
 ##########
 @@ -152,15 +172,24 @@ public void close() {
   }
 
   /*
-   * A wrapper for keeping a callable and its future together.
+   * A wrapper for a Callable that keeps additional information. This tracks if the callable
has been started, has completed (either finished or cancelled), and
+   * keeps the associated future.
    */
-  private class WrappedTask {
+  private class WrappedTask implements Callable<T> {
     public final C callable;
-    public final Future<T> future;
 
-    public WrappedTask(C callable, Future<T> future) {
+    public volatile boolean hasStarted = false;
+    public boolean hasCompleted = false;
+    public Future<T> future;
+
+    public WrappedTask(C callable) {
       this.callable = callable;
-      this.future = future;
+    }
+
+    @Override
+    public T call() throws Exception {
+      hasStarted = true;
 
 Review comment:
   Sounds good! 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message