hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ramkris...@apache.org
Subject svn commit: r1340422 - in /hbase/trunk/src: main/java/org/apache/hadoop/hbase/master/AssignmentManager.java test/java/org/apache/hadoop/hbase/master/TestAssignmentManager.java
Date Sat, 19 May 2012 12:02:13 GMT
Author: ramkrishna
Date: Sat May 19 12:02:12 2012
New Revision: 1340422

URL: http://svn.apache.org/viewvc?rev=1340422&view=rev
Log:
HBASE-5882 (Revert) TestAssginmentManager needs some cleanup

Modified:
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
    hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestAssignmentManager.java

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java?rev=1340422&r1=1340421&r2=1340422&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java Sat May
19 12:02:12 2012
@@ -582,12 +582,8 @@ public class AssignmentManager extends Z
           // So we will assign the ROOT and .META. region immediately.
           processOpeningState(regionInfo);
           break;
-        } else if (deadServers.keySet().contains(sn)) {
-          // if the region is found on a dead server, we can assign
-          // it to a new RS. (HBASE-5882)
-          processOpeningState(regionInfo);
-          break;
-        } 
+
+        }
         regionsInTransition.put(encodedRegionName,
           getRegionState(regionInfo, RegionState.State.OPENING, rt));
         failoverProcessedRegions.put(encodedRegionName, regionInfo);
@@ -625,6 +621,7 @@ public class AssignmentManager extends Z
     }
   }
   
+
   /**
    * Put the region <code>hri</code> into an offline state up in zk.
    * @param hri

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestAssignmentManager.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestAssignmentManager.java?rev=1340422&r1=1340421&r2=1340422&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestAssignmentManager.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestAssignmentManager.java Sat
May 19 12:02:12 2012
@@ -472,7 +472,6 @@ public class TestAssignmentManager {
             am.regionsInTransition.isEmpty());
       }
     } finally {
-      am.setEnabledTable(REGIONINFO.getTableNameAsString());
       executor.shutdown();
       am.shutdown();
       // Clean up all znodes
@@ -678,35 +677,6 @@ public class TestAssignmentManager {
   }
   
   /**
-   * Test the scenario when the master is in failover and trying to process a
-   * region which is in Opening state on a dead RS. Master should immediately
-   * assign the region and not wait for Timeout Monitor.(Hbase-5882).
-   */
-  @Test
-  public void testRegionInOpeningStateOnDeadRSWhileMasterFailover() throws IOException,
-      KeeperException, ServiceException, InterruptedException {
-    AssignmentManagerWithExtrasForTesting am = setUpMockedAssignmentManager(this.server,
-        this.serverManager);
-    ZKAssign.createNodeOffline(this.watcher, REGIONINFO, SERVERNAME_A);
-    int version = ZKAssign.getVersion(this.watcher, REGIONINFO);
-    ZKAssign.transitionNode(this.watcher, REGIONINFO, SERVERNAME_A, EventType.M_ZK_REGION_OFFLINE,
-        EventType.RS_ZK_REGION_OPENING, version);
-    RegionTransition rt = RegionTransition.createRegionTransition(EventType.RS_ZK_REGION_OPENING,
-        REGIONINFO.getRegionName(), SERVERNAME_A, HConstants.EMPTY_BYTE_ARRAY);
-    Map<ServerName, List<Pair<HRegionInfo, Result>>> deadServers = 
-      new HashMap<ServerName, List<Pair<HRegionInfo, Result>>>();
-    deadServers.put(SERVERNAME_A, null);
-    version = ZKAssign.getVersion(this.watcher, REGIONINFO);
-    am.gate.set(false);
-    am.processRegionsInTransition(rt, REGIONINFO, deadServers, version);
-    // Waiting for the assignment to get completed.
-    while (!am.gate.get()) {
-      Thread.sleep(10);
-    }
-    assertTrue("The region should be assigned immediately.", null != am.regionPlans.get(REGIONINFO
-        .getEncodedName()));
-  }
-  /**
    * Creates a new ephemeral node in the SPLITTING state for the specified region.
    * Create it ephemeral in case regionserver dies mid-split.
    *
@@ -840,13 +810,7 @@ public class TestAssignmentManager {
       while (this.gate.get()) Threads.sleep(1);
       super.processRegionsInTransition(rt, regionInfo, deadServers, expectedVersion);
     }
-
-    @Override
-    public void assign(HRegionInfo region, boolean setOfflineInZK, boolean forceNewPlan,
-        boolean hijack) {
-      super.assign(region, setOfflineInZK, forceNewPlan, hijack);
-      this.gate.set(true);
-    }
+    
     /** reset the watcher */
     void setWatcher(ZooKeeperWatcher watcher) {
       this.watcher = watcher;



Mime
View raw message