hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmhs...@apache.org
Subject svn commit: r1303522 - in /hbase/branches/0.90: CHANGES.txt src/main/java/org/apache/hadoop/hbase/ipc/HBaseRPCProtocolVersion.java 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 19:32:04 GMT
Author: jmhsieh
Date: Wed Mar 21 19:32:04 2012
New Revision: 1303522

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


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

Modified: hbase/branches/0.90/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/CHANGES.txt?rev=1303522&r1=1303521&r2=1303522&view=diff
==============================================================================
--- hbase/branches/0.90/CHANGES.txt (original)
+++ hbase/branches/0.90/CHANGES.txt Wed Mar 21 19:32:04 2012
@@ -10,6 +10,7 @@ Release 0.90.7 - Unreleased
 
   IMPROVEMENT
    HBASE-5588 Deprecate/remove AssignmentManager#clearRegionFromTransition
+   HBASE-5589 Add of the offline call to the Master Interface
 
 Release 0.90.6 - March 16, 2012
   INCOMPATIBLE CHANGES

Modified: hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/ipc/HBaseRPCProtocolVersion.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/ipc/HBaseRPCProtocolVersion.java?rev=1303522&r1=1303521&r2=1303522&view=diff
==============================================================================
--- hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/ipc/HBaseRPCProtocolVersion.java
(original)
+++ hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/ipc/HBaseRPCProtocolVersion.java
Wed Mar 21 19:32:04 2012
@@ -80,7 +80,10 @@ public interface HBaseRPCProtocolVersion
    * <li>Version 26: New master and Increment, 0.90 version bump.</li>
    * <li>Version 27: HBASE-3168, Added serverCurrentTime to regionServerStartup
    * in HMasterRegionInterface.</li>
+   * <li>Version 30: HBASE-5589. Added offline method to HMasterRegionInterface.</li>
    * </ul>
+   * 
+   * <p>Note, keeping version at 27 since offline was added after 0.90.0 release. 

    */
   public static final long versionID = 27L;
 }

Modified: hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/ipc/HMasterInterface.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/ipc/HMasterInterface.java?rev=1303522&r1=1303521&r2=1303522&view=diff
==============================================================================
--- hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/ipc/HMasterInterface.java (original)
+++ hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/ipc/HMasterInterface.java Wed
Mar 21 19:32:04 2012
@@ -184,6 +184,18 @@ public interface HMasterInterface extend
    */
   public boolean balance();
 
+  
+  /**
+   * 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;
+
   /**
    * Turn the load balancer on or off.
    * @param b If true, enable balancer. If false, disable balancer.

Modified: hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/master/HMaster.java?rev=1303522&r1=1303521&r2=1303522&view=diff
==============================================================================
--- hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/master/HMaster.java (original)
+++ hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/master/HMaster.java Wed Mar
21 19:32:04 2012
@@ -1111,6 +1111,19 @@ implements HMasterInterface, HMasterRegi
           e.getCause().getMessage(): ""), e);
     }
   }
+  
+  /**
+   * 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);    
+  }
 
 
   /**



Mime
View raw message