hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject svn commit: r1174108 - in /hbase/branches/0.92/src: main/java/org/apache/hadoop/hbase/regionserver/RegionServerServices.java test/java/org/apache/hadoop/hbase/master/TestZKBasedOpenCloseRegion.java
Date Thu, 22 Sep 2011 13:04:37 GMT
Author: tedyu
Date: Thu Sep 22 13:04:37 2011
New Revision: 1174108

URL: http://svn.apache.org/viewvc?rev=1174108&view=rev
Log:
HBASE-4153 Ramkrishna's fix for TestZKBasedOpenCloseRegion#testRSAlreadyProcessingRegion

Modified:
    hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/regionserver/RegionServerServices.java
    hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/master/TestZKBasedOpenCloseRegion.java

Modified: hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/regionserver/RegionServerServices.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/regionserver/RegionServerServices.java?rev=1174108&r1=1174107&r2=1174108&view=diff
==============================================================================
--- hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/regionserver/RegionServerServices.java
(original)
+++ hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/regionserver/RegionServerServices.java
Thu Sep 22 13:04:37 2011
@@ -20,13 +20,12 @@
 package org.apache.hadoop.hbase.regionserver;
 
 import java.io.IOException;
+import java.util.Map;
 
 import org.apache.hadoop.hbase.catalog.CatalogTracker;
 import org.apache.hadoop.hbase.ipc.RpcServer;
 import org.apache.hadoop.hbase.regionserver.wal.HLog;
 import org.apache.zookeeper.KeeperException;
-import java.util.Set;
-import java.util.concurrent.ConcurrentSkipListMap;
 
 /**
  * Services provided by {@link HRegionServer}
@@ -77,6 +76,6 @@ public interface RegionServerServices ex
    * Get the regions that are currently being opened or closed in the RS
    * @return map of regions in transition in this RS
    */
-  public ConcurrentSkipListMap<byte[], Boolean> getRegionsInTransitionInRS();
+  public Map<byte[], Boolean> getRegionsInTransitionInRS();
   
 }

Modified: hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/master/TestZKBasedOpenCloseRegion.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/master/TestZKBasedOpenCloseRegion.java?rev=1174108&r1=1174107&r2=1174108&view=diff
==============================================================================
--- hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/master/TestZKBasedOpenCloseRegion.java
(original)
+++ hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/master/TestZKBasedOpenCloseRegion.java
Thu Sep 22 13:04:37 2011
@@ -257,21 +257,29 @@ public class TestZKBasedOpenCloseRegion 
     // make sure the region came back
     assertEquals(hr1.getOnlineRegion(hri.getEncodedNameAsBytes()), null);
 
-
     // remove the block and reset the boolean
     hr1.getRegionsInTransitionInRS().remove(hri.getEncodedNameAsBytes());
     reopenEventProcessed.set(false);
-
-    // move the region again, but this time it will work
+    
+    // now try moving a region when there is no region in transition.
+    hri = getNonMetaRegion(hr1.getOnlineRegions());
+
+    openListener =
+      new ReopenEventListener(hri.getRegionNameAsString(),
+          reopenEventProcessed, EventType.RS_ZK_REGION_OPENED);
+
+    cluster.getMaster().executorService.
+      registerListener(EventType.RS_ZK_REGION_OPENED, openListener);
+    
     TEST_UTIL.getHBaseAdmin().move(hri.getEncodedNameAsBytes(),
-        Bytes.toBytes(hr1.getServerName().toString()));
+        Bytes.toBytes(hr0.getServerName().toString()));
 
     while (!reopenEventProcessed.get()) {
       Threads.sleep(100);
     }
 
     // make sure the region has moved from the original RS
-    assertTrue(hr0.getOnlineRegion(hri.getEncodedNameAsBytes()) == null);
+    assertTrue(hr1.getOnlineRegion(hri.getEncodedNameAsBytes()) == null);
 
   }
 



Mime
View raw message