accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject [2/3] accumulo git commit: ACCUMULO-4381 Cease use of Process#isAlive()
Date Wed, 20 Jul 2016 21:33:08 GMT
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 <elserj@apache.org>
Authored: Wed Jul 20 17:32:09 2016 -0400
Committer: Josh Elser <elserj@apache.org>
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<ProcessReference> 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);
             }
           }


Mime
View raw message