From notifications-return-42639-archive-asf-public=cust-asf.ponee.io@accumulo.apache.org Thu Mar 22 16:39:57 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id CC19918067E for ; Thu, 22 Mar 2018 16:39:56 +0100 (CET) Received: (qmail 47683 invoked by uid 500); 22 Mar 2018 15:39:55 -0000 Mailing-List: contact notifications-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jira@apache.org Delivered-To: mailing list notifications@accumulo.apache.org Received: (qmail 47651 invoked by uid 99); 22 Mar 2018 15:39:55 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Mar 2018 15:39:55 +0000 From: GitBox To: notifications@accumulo.apache.org Subject: [GitHub] keith-turner commented on a change in pull request #402: ACCUMULO-4615: Updated get status for thread safety and with a per-task timeout Message-ID: <152173319527.25713.6700649986301720293.gitbox@gitbox.apache.org> Date: Thu, 22 Mar 2018 15:39:55 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit keith-turner 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_r176468279 ########## 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 { public final C callable; - public final Future future; - public WrappedTask(C callable, Future future) { + public volatile boolean hasStarted = false; + public boolean hasCompleted = false; + public Future future; + + public WrappedTask(C callable) { this.callable = callable; - this.future = future; + } + + @Override + public T call() throws Exception { + hasStarted = true; Review comment: What do you think about recording the time here instead of having a boolean? Then that could be used to determine how long to wait for the task. ---------------------------------------------------------------- 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