accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r1360897 - /accumulo/trunk/server/src/main/java/org/apache/accumulo/server/test/randomwalk/concurrent/StopTabletServer.java
Date Thu, 12 Jul 2012 19:59:42 GMT
Author: ecn
Date: Thu Jul 12 19:59:42 2012
New Revision: 1360897

URL: http://svn.apache.org/viewvc?rev=1360897&view=rev
Log:
ACCUMULO-686 handle disappearing tablet servers during the test

Modified:
    accumulo/trunk/server/src/main/java/org/apache/accumulo/server/test/randomwalk/concurrent/StopTabletServer.java

Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/test/randomwalk/concurrent/StopTabletServer.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/test/randomwalk/concurrent/StopTabletServer.java?rev=1360897&r1=1360896&r2=1360897&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/test/randomwalk/concurrent/StopTabletServer.java
(original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/test/randomwalk/concurrent/StopTabletServer.java
Thu Jul 12 19:59:42 2012
@@ -26,14 +26,18 @@ public class StopTabletServer extends Te
     ZooReader rdr = new ZooReader(instance.getZooKeepers(), instance.getZooKeepersSessionTimeOut());
     String base = ZooUtil.getRoot(instance) + Constants.ZTSERVERS;
     for (String child : rdr.getChildren(base)) {
-      List<String> children = rdr.getChildren(base + "/" + child);
-      if (children.size() > 0) {
-        Collections.sort(children);
-        Stat stat = new Stat();
-        byte[] data = rdr.getData(base + "/" + child + "/" + children.get(0), stat);
-        if (!"master".equals(new String(data))) {
-          result.add(new TServerInstance(AddressUtil.parseAddress(child, Property.TSERV_CLIENTPORT),
stat.getEphemeralOwner()));
+      try {
+        List<String> children = rdr.getChildren(base + "/" + child);
+        if (children.size() > 0) {
+          Collections.sort(children);
+          Stat stat = new Stat();
+          byte[] data = rdr.getData(base + "/" + child + "/" + children.get(0), stat);
+          if (!"master".equals(new String(data))) {
+            result.add(new TServerInstance(AddressUtil.parseAddress(child, Property.TSERV_CLIENTPORT),
stat.getEphemeralOwner()));
+          }
         }
+      } catch (KeeperException.NoNodeException ex) {
+        // someone beat us too it
       }
     }
     return result;



Mime
View raw message