You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by ec...@apache.org on 2013/02/19 18:44:47 UTC

svn commit: r1447849 - /accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/util/FindOfflineTablets.java

Author: ecn
Date: Tue Feb 19 17:44:47 2013
New Revision: 1447849

URL: http://svn.apache.org/r1447849
Log:
ACCUMULO-1053 merge inadvertent commit in trunk back to 1.5 branch

Modified:
    accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/util/FindOfflineTablets.java

Modified: accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/util/FindOfflineTablets.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/util/FindOfflineTablets.java?rev=1447849&r1=1447848&r2=1447849&view=diff
==============================================================================
--- accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/util/FindOfflineTablets.java (original)
+++ accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/util/FindOfflineTablets.java Tue Feb 19 17:44:47 2013
@@ -17,8 +17,10 @@
 package org.apache.accumulo.server.util;
 
 import java.util.Set;
+import java.util.concurrent.atomic.AtomicBoolean;
 
 import org.apache.accumulo.server.cli.ClientOpts;
+import org.apache.accumulo.core.Constants;
 import org.apache.accumulo.core.client.Instance;
 import org.apache.accumulo.core.conf.DefaultConfiguration;
 import org.apache.accumulo.core.data.Range;
@@ -41,23 +43,26 @@ public class FindOfflineTablets {
   public static void main(String[] args) throws Exception {
     ClientOpts opts = new ClientOpts();
     opts.parseArgs(FindOfflineTablets.class.getName(), args);
-    
+    final AtomicBoolean scanning = new AtomicBoolean(false); 
     Instance instance = opts.getInstance();
     MetaDataTableScanner scanner = new MetaDataTableScanner(instance, opts.getCredentials(), new Range());
     LiveTServerSet tservers = new LiveTServerSet(instance, DefaultConfiguration.getDefaultConfiguration(), new Listener() {
       @Override
       public void update(LiveTServerSet current, Set<TServerInstance> deleted, Set<TServerInstance> added) {
-        if (!deleted.isEmpty())
+        if (!deleted.isEmpty() && scanning.get())
           log.warn("Tablet servers deleted while scanning: " + deleted);
-        if (!added.isEmpty())
+        if (!added.isEmpty() && scanning.get())
           log.warn("Tablet servers added while scanning: " + added);
       }
     });
+    tservers.startListeningForTabletServerChanges();
+    scanning.set(true);
     while (scanner.hasNext()) {
       TabletLocationState locationState = scanner.next();
       TabletState state = locationState.getState(tservers.getCurrentServers());
       if (state != TabletState.HOSTED && TableManager.getInstance().getTableState(locationState.extent.getTableId().toString()) != TableState.OFFLINE)
-        System.out.println(locationState + " is " + state);
+        if (!locationState.extent.equals(Constants.ROOT_TABLET_EXTENT))
+          System.out.println(locationState + " is " + state);
     }
   }