hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmhs...@apache.org
Subject svn commit: r1303621 - in /hbase/branches/0.92: CHANGES.txt src/main/java/org/apache/hadoop/hbase/ipc/HMasterInterface.java src/main/java/org/apache/hadoop/hbase/master/HMaster.java
Date Wed, 21 Mar 2012 23:48:45 GMT
Author: jmhsieh
Date: Wed Mar 21 23:48:45 2012
New Revision: 1303621

URL: http://svn.apache.org/viewvc?rev=1303621&view=rev
Log:
HBASE-5589 Add of the offline call to the Master Interface


Modified:
    hbase/branches/0.92/CHANGES.txt
    hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/ipc/HMasterInterface.java
    hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/master/HMaster.java

Modified: hbase/branches/0.92/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/CHANGES.txt?rev=1303621&r1=1303620&r2=1303621&view=diff
==============================================================================
--- hbase/branches/0.92/CHANGES.txt (original)
+++ hbase/branches/0.92/CHANGES.txt Wed Mar 21 23:48:45 2012
@@ -15,6 +15,7 @@ Release 0.92.2 - Unreleased
   IMPROVEMENTS
    HBASE-5592  Make it easier to get a table from shell (Ben West)
    HBASE-5588  Deprecate/remove AssignmentManager#clearRegionFromTransition
+   HBASE-5589  Add of the offline call to the Master Interface
 
 Release 0.92.1 - March 17th, 2012
   INCOMPATIBLE CHANGES

Modified: hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/ipc/HMasterInterface.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/ipc/HMasterInterface.java?rev=1303621&r1=1303620&r2=1303621&view=diff
==============================================================================
--- hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/ipc/HMasterInterface.java (original)
+++ hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/ipc/HMasterInterface.java Wed
Mar 21 23:48:45 2012
@@ -51,6 +51,10 @@ public interface HMasterInterface extend
   // meant all HBase RPC was broke though only one of the three RPC Interfaces
   // had changed.  This has since been undone.
   // 29:  4/3/2010 - changed ClusterStatus serialization
+  // 30: 3/20/2012 - HBASE-5589: Added offline method 
+	
+  // NOTE: Not bumped from 29 to maintain compatibility since this addition is
+  // after the v0.92.0 release.
   public static final long VERSION = 29L;
 
   /** @return true if master is available */
@@ -213,6 +217,18 @@ public interface HMasterInterface extend
   public void unassign(final byte [] regionName, final boolean force)
   throws IOException;
 
+  
+  /**
+   * Offline a region from the assignment manager's in-memory state.  The
+   * region should be in a closed state and there will be no attempt to
+   * automatically reassign the region as in unassign.   This is a special
+   * method, and should only be used by experts or hbck.
+   * @param regionName Region to offline.  Will clear any existing RegionPlan
+   * if one found.
+   * @throws IOException
+   */
+  public void offline(final byte[] regionName) throws IOException;
+
   /**
    * Run the balancer.  Will run the balancer and if regions to move, it will
    * go ahead and do the reassignments.  Can NOT run for various reasons.  Check

Modified: hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/master/HMaster.java?rev=1303621&r1=1303620&r2=1303621&view=diff
==============================================================================
--- hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/master/HMaster.java (original)
+++ hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/master/HMaster.java Wed Mar
21 23:48:45 2012
@@ -1623,6 +1623,19 @@ Server {
   public double getAverageLoad() {
     return this.assignmentManager.getAverageLoad();
   }
+  
+  /**
+   * Special method, only used by hbck.
+   */
+  @Override
+  public void offline(final byte[] regionName) 
+  throws IOException {
+    Pair<HRegionInfo, ServerName> pair =
+      MetaReader.getRegion(this.catalogTracker, regionName);
+    if (pair == null) throw new UnknownRegionException(Bytes.toStringBinary(regionName));
+    HRegionInfo hri = pair.getFirst();
+    this.assignmentManager.regionOffline(hri);    
+  }
 
   /**
    * Utility for constructing an instance of the passed HMaster class.



Mime
View raw message