incubator-accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r1190413 - /incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/client/admin/InstanceOperations.java
Date Fri, 28 Oct 2011 15:58:51 GMT
Author: ecn
Date: Fri Oct 28 15:58:50 2011
New Revision: 1190413

URL: http://svn.apache.org/viewvc?rev=1190413&view=rev
Log:
ACCUMULO-93: change getTabletServers() to return only the active servers

Modified:
    incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/client/admin/InstanceOperations.java

Modified: incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/client/admin/InstanceOperations.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/client/admin/InstanceOperations.java?rev=1190413&r1=1190412&r2=1190413&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/client/admin/InstanceOperations.java
(original)
+++ incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/client/admin/InstanceOperations.java
Fri Oct 28 15:58:50 2011
@@ -115,13 +115,22 @@ public class InstanceOperations {
   }
   
   /**
-   * List the current tablet servers participating in the accumulo instance
+   * List the currently active tablet servers participating in the accumulo instance
    * 
    * @return
    */
   
   public List<String> getTabletServers() {
-    return ZooCache.getInstance(instance.getZooKeepers(), instance.getZooKeepersSessionTimeOut()).getChildren(ZooUtil.getRoot(instance)
+ Constants.ZTSERVERS);
+    ZooCache cache = ZooCache.getInstance(instance.getZooKeepers(), instance.getZooKeepersSessionTimeOut());
+    String path = ZooUtil.getRoot(instance) + Constants.ZTSERVERS;
+    List<String> results = new ArrayList<String>();
+    for (String candidate : cache.getChildren(path)) {
+      List<String> lockEntries = cache.getChildren(path + "/" + candidate);
+      if (lockEntries != null && lockEntries.size() == 2) {
+        results.add(candidate);
+      }
+    }
+    return results;
   }
   
   /**



Mime
View raw message