accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject [2/3] accumulo git commit: ACCUMULO-3356 Get ChaoticBalancerIT running correctly again.
Date Mon, 02 Nov 2015 00:51:51 GMT
ACCUMULO-3356 Get ChaoticBalancerIT running correctly again.

Balancer needs to handle no tservers. Class needs a one-string
constructor.


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

Branch: refs/heads/master
Commit: c996151074c97c706fd596b1f3a07eb594b7aa8a
Parents: 0eaece7
Author: Josh Elser <elserj@apache.org>
Authored: Sun Nov 1 19:50:59 2015 -0500
Committer: Josh Elser <elserj@apache.org>
Committed: Sun Nov 1 19:50:59 2015 -0500

----------------------------------------------------------------------
 .../server/master/balancer/ChaoticLoadBalancer.java    | 13 +++++++++++++
 1 file changed, 13 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/c9961510/server/base/src/main/java/org/apache/accumulo/server/master/balancer/ChaoticLoadBalancer.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/master/balancer/ChaoticLoadBalancer.java
b/server/base/src/main/java/org/apache/accumulo/server/master/balancer/ChaoticLoadBalancer.java
index dc58495..f9aac77 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/master/balancer/ChaoticLoadBalancer.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/master/balancer/ChaoticLoadBalancer.java
@@ -50,6 +50,14 @@ import org.slf4j.LoggerFactory;
 public class ChaoticLoadBalancer extends TabletBalancer {
   private static final Logger log = LoggerFactory.getLogger(ChaoticLoadBalancer.class);
 
+  @SuppressWarnings("unused")
+  private final String tableName;
+
+  // Required constructor
+  public ChaoticLoadBalancer(String tableName) {
+    this.tableName = tableName;
+  }
+
   Random r = new Random();
 
   @Override
@@ -70,6 +78,11 @@ public class ChaoticLoadBalancer extends TabletBalancer {
       }
     }
 
+    if (tServerArray.isEmpty()) {
+      // No tservers to assign to
+      return;
+    }
+
     for (KeyExtent ke : unassigned.keySet()) {
       int index = r.nextInt(tServerArray.size());
       TServerInstance dest = tServerArray.get(index);


Mime
View raw message