accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject git commit: ACCUMULO-2952 keep better info on what tablet counts will be after balancing
Date Mon, 30 Jun 2014 20:37:03 GMT
Repository: accumulo
Updated Branches:
  refs/heads/master d618aeaf5 -> 11d11e0da


ACCUMULO-2952 keep better info on what tablet counts will be after balancing


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

Branch: refs/heads/master
Commit: 11d11e0da910b6242c764ab6365bc11c66ee56f0
Parents: d618aea
Author: Eric C. Newton <eric.newton@gmail.com>
Authored: Mon Jun 30 16:36:42 2014 -0400
Committer: Eric C. Newton <eric.newton@gmail.com>
Committed: Mon Jun 30 16:36:42 2014 -0400

----------------------------------------------------------------------
 .../accumulo/server/master/balancer/DefaultLoadBalancer.java  | 7 ++++---
 .../server/master/balancer/DefaultLoadBalancerTest.java       | 2 +-
 2 files changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/11d11e0d/server/base/src/main/java/org/apache/accumulo/server/master/balancer/DefaultLoadBalancer.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/master/balancer/DefaultLoadBalancer.java
b/server/base/src/main/java/org/apache/accumulo/server/master/balancer/DefaultLoadBalancer.java
index 46b9b5f..3490405 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/master/balancer/DefaultLoadBalancer.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/master/balancer/DefaultLoadBalancer.java
@@ -86,7 +86,7 @@ public class DefaultLoadBalancer extends TabletBalancer {
   
   static class ServerCounts implements Comparable<ServerCounts> {
     public final TServerInstance server;
-    public final int count;
+    public int count;
     public final TabletServerStatus status;
     
     ServerCounts(int count, TServerInstance server, TabletServerStatus status) {
@@ -145,7 +145,7 @@ public class DefaultLoadBalancer extends TabletBalancer {
       int end = totals.size() - 1;
       int movedAlready = 0;
       int tooManyIndex = 0;
-      while (tooManyIndex < totals.size() && end > tooManyIndex) {
+      while (tooManyIndex < end) {
         ServerCounts tooMany = totals.get(tooManyIndex);
         int goal = even;
         if (tooManyIndex < numServersOverEven) {
@@ -255,7 +255,8 @@ public class DefaultLoadBalancer extends TabletBalancer {
         tooLittleCount = 0;
       }
       tooLittleMap.put(table, tooLittleCount + 1);
-      
+      tooMuch.count--;
+      tooLittle.count++;
       result.add(new TabletMigration(extent, tooMuch.server, tooLittle.server));
     }
     return result;

http://git-wip-us.apache.org/repos/asf/accumulo/blob/11d11e0d/server/base/src/test/java/org/apache/accumulo/server/master/balancer/DefaultLoadBalancerTest.java
----------------------------------------------------------------------
diff --git a/server/base/src/test/java/org/apache/accumulo/server/master/balancer/DefaultLoadBalancerTest.java
b/server/base/src/test/java/org/apache/accumulo/server/master/balancer/DefaultLoadBalancerTest.java
index 0439429..9f99b1c 100644
--- a/server/base/src/test/java/org/apache/accumulo/server/master/balancer/DefaultLoadBalancerTest.java
+++ b/server/base/src/test/java/org/apache/accumulo/server/master/balancer/DefaultLoadBalancerTest.java
@@ -203,7 +203,7 @@ public class DefaultLoadBalancerTest {
         servers.get(migration.newServer).extents.add(migration.tablet);
       }
     }
-    assertEquals(9, moved);
+    assertEquals(8, moved);
   }
   
   @Test


Mime
View raw message