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 2015/02/19 21:51:40 UTC

[3/3] accumulo git commit: ACCUMULO-3601 transfer migration information to the metadata table filtering iterator

ACCUMULO-3601 transfer migration information to the metadata table filtering iterator


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

Branch: refs/heads/master
Commit: d97a6a2b187062fb97606df658eb7004cb949d80
Parents: f6635fa
Author: Eric Newton <Eric Newton>
Authored: Thu Feb 19 15:49:11 2015 -0500
Committer: Eric Newton <Eric Newton>
Committed: Thu Feb 19 15:49:11 2015 -0500

----------------------------------------------------------------------
 .../master/state/TabletStateChangeIterator.java |  2 +-
 .../java/org/apache/accumulo/master/Master.java |  1 -
 .../org/apache/accumulo/test/BalanceIT.java     | 45 +-------------------
 3 files changed, 2 insertions(+), 46 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/d97a6a2b/server/base/src/main/java/org/apache/accumulo/server/master/state/TabletStateChangeIterator.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/master/state/TabletStateChangeIterator.java b/server/base/src/main/java/org/apache/accumulo/server/master/state/TabletStateChangeIterator.java
index 3b5eb16..77b598c 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/master/state/TabletStateChangeIterator.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/master/state/TabletStateChangeIterator.java
@@ -160,7 +160,7 @@ public class TabletStateChangeIterator extends SkippingIterator {
         // could make this smarter by only returning if the tablet is involved in the merge
         return;
       }
-      // always return the informatin for migrating tablets
+      // always return the information for migrating tablets
       if (migrations.contains(tls.extent)) {
         return;
       }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/d97a6a2b/server/master/src/main/java/org/apache/accumulo/master/Master.java
----------------------------------------------------------------------
diff --git a/server/master/src/main/java/org/apache/accumulo/master/Master.java b/server/master/src/main/java/org/apache/accumulo/master/Master.java
index aaa68e5..81339ad 100644
--- a/server/master/src/main/java/org/apache/accumulo/master/Master.java
+++ b/server/master/src/main/java/org/apache/accumulo/master/Master.java
@@ -1480,7 +1480,6 @@ public class Master extends AccumuloServerContext implements LiveTServerSet.List
     }
   }
 
-<<<<<<< HEAD
   public void waitForBalance(TInfo tinfo) {
     synchronized (balancedNotifier) {
       long eventCounter;

http://git-wip-us.apache.org/repos/asf/accumulo/blob/d97a6a2b/test/src/test/java/org/apache/accumulo/test/BalanceIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/BalanceIT.java b/test/src/test/java/org/apache/accumulo/test/BalanceIT.java
index 7c8e452..f793925 100644
--- a/test/src/test/java/org/apache/accumulo/test/BalanceIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/BalanceIT.java
@@ -16,21 +16,10 @@
  */
 package org.apache.accumulo.test;
 
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Map.Entry;
 import java.util.SortedSet;
 import java.util.TreeSet;
 
 import org.apache.accumulo.core.client.Connector;
-import org.apache.accumulo.core.client.Scanner;
-import org.apache.accumulo.core.data.Key;
-import org.apache.accumulo.core.data.Value;
-import org.apache.accumulo.core.metadata.MetadataTable;
-import org.apache.accumulo.core.metadata.schema.MetadataSchema;
-import org.apache.accumulo.core.security.Authorizations;
-import org.apache.accumulo.fate.util.UtilWaitThread;
 import org.apache.accumulo.test.functional.ConfigurableMacIT;
 import org.apache.hadoop.io.Text;
 import org.junit.Test;
@@ -50,38 +39,6 @@ public class BalanceIT extends ConfigurableMacIT {
     System.out.println("Adding splits");
     c.tableOperations().addSplits(tableName, splits);
     System.out.println("Waiting for balance");
-    waitForBalance(c);
+    c.instanceOperations().waitForBalance();
   }
-
-  private void waitForBalance(Connector c) throws Exception {
-    while (!isBalanced(c)) {
-      UtilWaitThread.sleep(1000);
-    }
-  }
-
-  private boolean isBalanced(Connector c) throws Exception {
-    Map<String, Integer> counts = new HashMap<String, Integer>();
-    Scanner scanner = c.createScanner(MetadataTable.NAME, Authorizations.EMPTY);
-    scanner.setRange(MetadataSchema.TabletsSection.getRange());
-    scanner.fetchColumnFamily(MetadataSchema.TabletsSection.CurrentLocationColumnFamily.NAME);
-    for (Entry<Key,Value> entry : scanner) {
-      String host = entry.getKey().getColumnQualifier().toString();
-      Integer count = counts.get(host);
-      if (count == null) {
-        count = new Integer(0);
-      }
-      counts.put(host, count.intValue() + 1);
-    }
-    if (counts.size() < 2) {
-      return false;
-    }
-    Iterator<Integer> iter = counts.values().iterator();
-    int initial = iter.next().intValue();
-    while (iter.hasNext()) {
-      if (Math.abs(iter.next().intValue() - initial) > 2)
-        return false;
-    }
-    return true;
-  }
-
 }