hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajeshb...@apache.org
Subject svn commit: r1568188 - in /hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master: AssignmentManager.java LoadBalancer.java balancer/BaseLoadBalancer.java
Date Fri, 14 Feb 2014 02:21:17 GMT
Author: rajeshbabu
Date: Fri Feb 14 02:21:16 2014
New Revision: 1568188

URL: http://svn.apache.org/r1568188
Log:
HBASE-10498 Add new APIs to load balancer interface(Rajesh)

Modified:
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/LoadBalancer.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/BaseLoadBalancer.java

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java?rev=1568188&r1=1568187&r2=1568188&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
(original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
Fri Feb 14 02:21:16 2014
@@ -1279,6 +1279,7 @@ public class AssignmentManager extends Z
     clearRegionPlan(regionInfo);
     // Add the server to serversInUpdatingTimer
     addToServersInUpdatingTimer(sn);
+    balancer.regionOnline(regionInfo, sn);
   }
 
   /**
@@ -2667,6 +2668,7 @@ public class AssignmentManager extends Z
         if (!disabledOrEnablingTables.contains(tableName)) {
           regionStates.updateRegionState(regionInfo, State.OPEN, regionLocation);
           regionStates.regionOnline(regionInfo, regionLocation);
+          balancer.regionOnline(regionInfo, regionLocation);
         }
         // need to enable the table if not disabled or disabling or enabling
         // this will be used in rolling restarts
@@ -3514,6 +3516,7 @@ public class AssignmentManager extends Z
     removeClosedRegion(regionInfo);
     // remove the region plan as well just in case.
     clearRegionPlan(regionInfo);
+    balancer.regionOffline(regionInfo);
   }
 
   /**

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/LoadBalancer.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/LoadBalancer.java?rev=1568188&r1=1568187&r2=1568188&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/LoadBalancer.java
(original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/LoadBalancer.java
Fri Feb 14 02:21:16 2014
@@ -117,4 +117,17 @@ public interface LoadBalancer extends Co
    * @throws HBaseIOException
    */
   void initialize() throws HBaseIOException;
+
+  /**
+   * Marks the region as online at balancer.
+   * @param regionInfo
+   * @param sn
+   */
+  void regionOnline(HRegionInfo regionInfo, ServerName sn);
+
+  /**
+   * Marks the region as offline at balancer.
+   * @param regionInfo
+   */
+  void regionOffline(HRegionInfo regionInfo);
 }

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/BaseLoadBalancer.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/BaseLoadBalancer.java?rev=1568188&r1=1568187&r2=1568188&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/BaseLoadBalancer.java
(original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/BaseLoadBalancer.java
Fri Feb 14 02:21:16 2014
@@ -586,6 +586,14 @@ public abstract class BaseLoadBalancer i
   }
 
   @Override
+  public void regionOnline(HRegionInfo regionInfo, ServerName sn) {
+  }
+
+  @Override
+  public void regionOffline(HRegionInfo regionInfo) {
+  }
+
+  @Override
   public boolean isStopped() {
     return stopped;
   }



Mime
View raw message