incubator-accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vi...@apache.org
Subject svn commit: r1294701 - in /incubator/accumulo/trunk: ./ src/server/ src/server/src/main/java/org/apache/accumulo/server/master/balancer/ChaoticLoadBalancer.java
Date Tue, 28 Feb 2012 15:46:14 GMT
Author: vines
Date: Tue Feb 28 15:46:14 2012
New Revision: 1294701

URL: http://svn.apache.org/viewvc?rev=1294701&view=rev
Log:
Merging ACCUMULO-426


Modified:
    incubator/accumulo/trunk/   (props changed)
    incubator/accumulo/trunk/src/server/   (props changed)
    incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/master/balancer/ChaoticLoadBalancer.java

Propchange: incubator/accumulo/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Feb 28 15:46:14 2012
@@ -1,3 +1,3 @@
 /incubator/accumulo/branches/1.3:1190280,1190413,1190420,1190427,1190500,1195622,1195625,1195629,1195635,1196044,1196054,1196057,1196071-1196072,1196106,1197066,1198935,1199383,1203683,1204625,1205547,1205880,1206169,1208031,1209124,1209526,1209532,1209539,1209541,1209587,1209657,1210518,1210571,1210596,1210598,1213424,1214320,1225006,1227215,1227231,1227611,1228195,1230180,1230736,1231043,1236873,1245632
 /incubator/accumulo/branches/1.3.5rc:1209938
-/incubator/accumulo/branches/1.4:1201902-1294682
+/incubator/accumulo/branches/1.4:1201902-1294700

Propchange: incubator/accumulo/trunk/src/server/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Feb 28 15:46:14 2012
@@ -1,3 +1,3 @@
 /incubator/accumulo/branches/1.3/src/server:1190280,1190413,1190420,1190427,1190500,1195622,1195625,1195629,1195635,1196044,1196054,1196057,1196071-1196072,1196106,1197066,1198935,1199383,1203683,1204625,1205547,1205880,1206169,1208031,1209124,1209526,1209532,1209539,1209541,1209587,1209657,1210518,1210571,1210596,1210598,1213424,1214320,1225006,1227215,1227231,1227611
 /incubator/accumulo/branches/1.3.5rc/src/server:1209938
-/incubator/accumulo/branches/1.4/src/server:1201902-1294682
+/incubator/accumulo/branches/1.4/src/server:1201902-1294700

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/master/balancer/ChaoticLoadBalancer.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/master/balancer/ChaoticLoadBalancer.java?rev=1294701&r1=1294700&r2=1294701&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/master/balancer/ChaoticLoadBalancer.java
(original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/master/balancer/ChaoticLoadBalancer.java
Tue Feb 28 15:46:14 2012
@@ -85,6 +85,9 @@ public class ChaoticLoadBalancer extends
     Map<TServerInstance,Long> numTablets = new HashMap<TServerInstance,Long>();
     List<TServerInstance> underCapacityTServer = new ArrayList<TServerInstance>();
 
+    if (!migrations.isEmpty())
+      return 100;
+
     long totalTablets = 0;
     for (Entry<TServerInstance,TabletServerStatus> e : current.entrySet()) {
       long tabletCount = 0;
@@ -105,17 +108,20 @@ public class ChaoticLoadBalancer extends
       {
         try {
           for (TabletStats ts : getOnlineTabletsForTable(e.getKey(), table)) {
-            
+            KeyExtent ke = new KeyExtent(ts.extent);
             int index = r.nextInt(underCapacityTServer.size());
             TServerInstance dest = underCapacityTServer.get(index);
             if (dest.equals(e.getKey()))
               continue;
-            migrationsOut.add(new TabletMigration(new KeyExtent(ts.extent), e.getKey(), dest));
+            migrationsOut.add(new TabletMigration(ke, e.getKey(), dest));
             if (numTablets.put(dest, numTablets.get(dest) + 1) > avg)
               underCapacityTServer.remove(index);
             if (numTablets.put(e.getKey(), numTablets.get(e.getKey()) - 1) <= avg &&
!underCapacityTServer.contains(e.getKey()))
               underCapacityTServer.add(e.getKey());
-
+            
+            // We can get some craziness with only 1 tserver, so lets make sure there's always
an option!
+            if (underCapacityTServer.isEmpty())
+              underCapacityTServer.addAll(numTablets.keySet());
           }
         } catch (ThriftSecurityException e1) {
           // Shouldn't happen, but carry on if it does
@@ -127,8 +133,7 @@ public class ChaoticLoadBalancer extends
       }
     }
     
-    // Yes, it can run every 5ms
-    return 5;
+    return 100;
   }
   
 }



Mime
View raw message