hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdcry...@apache.org
Subject svn commit: r963951 - in /hbase/trunk/src: main/java/org/apache/hadoop/hbase/master/RegionManager.java main/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperWrapper.java test/java/org/apache/hadoop/hbase/master/TestRestartCluster.java
Date Wed, 14 Jul 2010 05:29:33 GMT
Author: jdcryans
Date: Wed Jul 14 05:29:32 2010
New Revision: 963951

URL: http://svn.apache.org/viewvc?rev=963951&view=rev
Log:
HBASE-2781 fixup

Modified:
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/RegionManager.java
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperWrapper.java
    hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestRestartCluster.java

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/RegionManager.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/RegionManager.java?rev=963951&r1=963950&r2=963951&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/RegionManager.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/RegionManager.java Wed Jul 14
05:29:32 2010
@@ -179,7 +179,8 @@ public class RegionManager {
         } catch (IOException e) {
           LOG.error("Error creating event data for " + HBaseEventType.M2ZK_REGION_OFFLINE,
e);
         }
-        zkWrapper.createUnassignedRegion(HRegionInfo.ROOT_REGIONINFO.getEncodedName(), data);
+        zkWrapper.createOrUpdateUnassignedRegion(
+            HRegionInfo.ROOT_REGIONINFO.getEncodedName(), data);
         LOG.debug("Created UNASSIGNED zNode " + regionName + " in state " + HBaseEventType.M2ZK_REGION_OFFLINE);
         RegionState s = new RegionState(HRegionInfo.ROOT_REGIONINFO, RegionState.State.UNASSIGNED);
         regionsInTransition.put(regionName, s);
@@ -343,7 +344,8 @@ public class RegionManager {
       } catch (IOException e) {
         LOG.error("Error creating event data for " + HBaseEventType.M2ZK_REGION_OFFLINE,
e);
       }
-      zkWrapper.createUnassignedRegion(rs.getRegionInfo().getEncodedName(), data);
+      zkWrapper.createOrUpdateUnassignedRegion(
+          rs.getRegionInfo().getEncodedName(), data);
       LOG.debug("Created UNASSIGNED zNode " + regionName + " in state " + HBaseEventType.M2ZK_REGION_OFFLINE);
       this.regionsInTransition.put(regionName, rs);
     }

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperWrapper.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperWrapper.java?rev=963951&r1=963950&r2=963951&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperWrapper.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperWrapper.java Wed
Jul 14 05:29:32 2010
@@ -1081,7 +1081,7 @@ public class ZooKeeperWrapper implements
    * @param regionName - encoded name of the region
    * @param data - new serialized data to update the region znode
    */
-  public void createUnassignedRegion(String regionName, byte[] data) {
+  private void createUnassignedRegion(String regionName, byte[] data) {
     String znode = getZNode(getRegionInTransitionZNode(), regionName);
     if(LOG.isDebugEnabled()) {
       // check if this node already exists - 

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestRestartCluster.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestRestartCluster.java?rev=963951&r1=963950&r2=963951&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestRestartCluster.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestRestartCluster.java Wed Jul
14 05:29:32 2010
@@ -71,8 +71,10 @@ public class TestRestartCluster {
     } catch (IOException e) {
       LOG.error("Error creating event data for " + hbEventType, e);
     }
-    zkWrapper.createUnassignedRegion(HRegionInfo.ROOT_REGIONINFO.getEncodedName(), data);
-    zkWrapper.createUnassignedRegion(HRegionInfo.FIRST_META_REGIONINFO.getEncodedName(),
data);
+    zkWrapper.createOrUpdateUnassignedRegion(
+        HRegionInfo.ROOT_REGIONINFO.getEncodedName(), data);
+    zkWrapper.createOrUpdateUnassignedRegion(
+        HRegionInfo.FIRST_META_REGIONINFO.getEncodedName(), data);
     LOG.debug("Created UNASSIGNED zNode for ROOT and META regions in state " + HBaseEventType.M2ZK_REGION_OFFLINE);
     
     // start the HB cluster



Mime
View raw message