Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 098B7200B5A for ; Wed, 20 Jul 2016 23:33:09 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 085A6160A5B; Wed, 20 Jul 2016 21:33:09 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 4EF0C160A64 for ; Wed, 20 Jul 2016 23:33:08 +0200 (CEST) Received: (qmail 60055 invoked by uid 500); 20 Jul 2016 21:33:07 -0000 Mailing-List: contact commits-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@accumulo.apache.org Delivered-To: mailing list commits@accumulo.apache.org Received: (qmail 60045 invoked by uid 99); 20 Jul 2016 21:33:07 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Jul 2016 21:33:07 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 42511E08E8; Wed, 20 Jul 2016 21:33:07 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: elserj@apache.org To: commits@accumulo.apache.org Date: Wed, 20 Jul 2016 21:33:08 -0000 Message-Id: <903e01caddfd429b8731e30a6aa4e0fe@git.apache.org> In-Reply-To: <9f660445226b43b28e02a7a4d44e5805@git.apache.org> References: <9f660445226b43b28e02a7a4d44e5805@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [2/3] accumulo git commit: ACCUMULO-4381 Cease use of Process#isAlive() archived-at: Wed, 20 Jul 2016 21:33:09 -0000 ACCUMULO-4381 Cease use of Process#isAlive() This method only exists in JDK8. We cannot use it in Accumulo 1.8 Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/1aceaa01 Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/1aceaa01 Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/1aceaa01 Branch: refs/heads/master Commit: 1aceaa01453ebc1709eac1f3eb3908280310a78e Parents: 3e5524c Author: Josh Elser Authored: Wed Jul 20 17:32:09 2016 -0400 Committer: Josh Elser Committed: Wed Jul 20 17:32:09 2016 -0400 ---------------------------------------------------------------------- .../apache/accumulo/test/master/SuspendedTabletsIT.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/1aceaa01/test/src/main/java/org/apache/accumulo/test/master/SuspendedTabletsIT.java ---------------------------------------------------------------------- diff --git a/test/src/main/java/org/apache/accumulo/test/master/SuspendedTabletsIT.java b/test/src/main/java/org/apache/accumulo/test/master/SuspendedTabletsIT.java index edd1aff..898f429 100644 --- a/test/src/main/java/org/apache/accumulo/test/master/SuspendedTabletsIT.java +++ b/test/src/main/java/org/apache/accumulo/test/master/SuspendedTabletsIT.java @@ -88,6 +88,15 @@ public class SuspendedTabletsIT extends ConfigurableMacBase { cfg.setNumTservers(TSERVERS); } + private boolean isAlive(Process p) { + try { + p.exitValue(); + return false; + } catch (IllegalThreadStateException e) { + return true; + } + } + @Test public void crashAndResumeTserver() throws Exception { // Run the test body. When we get to the point where we need a tserver to go away, get rid of it via crashing @@ -137,7 +146,7 @@ public class SuspendedTabletsIT extends ConfigurableMacBase { List deadProcs = new ArrayList<>(); for (ProcessReference pr : getCluster().getProcesses().get(ServerType.TABLET_SERVER)) { Process p = pr.getProcess(); - if (!p.isAlive()) { + if (!isAlive(p)) { deadProcs.add(pr); } }