accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject [2/2] git commit: ACCUMULO-2978 double-check to make sure all the tablets are online
Date Fri, 11 Jul 2014 21:16:46 GMT
ACCUMULO-2978 double-check to make sure all the tablets are online


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/268c8bc3
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/268c8bc3
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/268c8bc3

Branch: refs/heads/master
Commit: 268c8bc33eb607e7e339147b7c5c216a12b5542e
Parents: ab03780
Author: Eric C. Newton <eric.newton@gmail.com>
Authored: Wed Jul 9 14:08:33 2014 -0400
Committer: Eric C. Newton <eric.newton@gmail.com>
Committed: Fri Jul 11 16:54:24 2014 -0400

----------------------------------------------------------------------
 .../org/apache/accumulo/test/BalanceFasterIT.java | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/268c8bc3/test/src/test/java/org/apache/accumulo/test/BalanceFasterIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/BalanceFasterIT.java b/test/src/test/java/org/apache/accumulo/test/BalanceFasterIT.java
index 74db66e..d4de5e7 100644
--- a/test/src/test/java/org/apache/accumulo/test/BalanceFasterIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/BalanceFasterIT.java
@@ -65,11 +65,19 @@ public class BalanceFasterIT extends ConfigurableMacIT {
     s.fetchColumnFamily(MetadataSchema.TabletsSection.CurrentLocationColumnFamily.NAME);
     s.setRange(MetadataSchema.TabletsSection.getRange());
     Map<String, Integer> counts = new HashMap<String, Integer>();
-    for (Entry<Key,Value> kv : s) {
-      String host = kv.getValue().toString();
-      if (!counts.containsKey(host))
-        counts.put(host, 0);
-      counts.put(host, counts.get(host) + 1);
+    while (true) {
+      int total = 0;
+      counts.clear();
+      for (Entry<Key,Value> kv : s) {
+        String host = kv.getValue().toString();
+        if (!counts.containsKey(host))
+          counts.put(host, 0);
+        counts.put(host, counts.get(host) + 1);
+        total++;
+      }
+      // are enough tablets online?
+      if (total > 1000)
+        break;
     }
     // should be on all three servers
     assertTrue(counts.size() == 3);


Mime
View raw message