hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r1454613 [3/3] - in /hbase/branches/0.95: hbase-client/src/main/java/org/apache/hadoop/hbase/ hbase-client/src/main/java/org/apache/hadoop/hbase/catalog/ hbase-client/src/main/java/org/apache/hadoop/hbase/client/ hbase-client/src/main/java/...
Date Fri, 08 Mar 2013 22:46:17 GMT
Modified: hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/catalog/TestMetaReaderEditor.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/catalog/TestMetaReaderEditor.java?rev=1454613&r1=1454612&r2=1454613&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/catalog/TestMetaReaderEditor.java
(original)
+++ hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/catalog/TestMetaReaderEditor.java
Fri Mar  8 22:46:16 2013
@@ -42,7 +42,7 @@ import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
 /**
- * Test {@link MetaReader}, {@link MetaEditor}, and {@link RootLocationEditor}.
+ * Test {@link MetaReader}, {@link MetaEditor}.
  */
 @Category(MediumTests.class)
 public class TestMetaReaderEditor {
@@ -218,8 +218,6 @@ public class TestMetaReaderEditor {
     assertTrue(regions.size() >= 1);
     assertTrue(MetaReader.getTableRegionsAndLocations(CT,
       Bytes.toString(HConstants.META_TABLE_NAME)).size() >= 1);
-    assertTrue(MetaReader.getTableRegionsAndLocations(CT,
-      Bytes.toString(HConstants.ROOT_TABLE_NAME)).size() == 1);
   }
 
   @Test public void testTableExists() throws IOException {
@@ -234,8 +232,6 @@ public class TestMetaReaderEditor {
     assertFalse(MetaReader.tableExists(CT, name));
     assertTrue(MetaReader.tableExists(CT,
       Bytes.toString(HConstants.META_TABLE_NAME)));
-    assertTrue(MetaReader.tableExists(CT,
-      Bytes.toString(HConstants.ROOT_TABLE_NAME)));
   }
 
   @Test public void testGetRegion() throws IOException, InterruptedException {
@@ -245,11 +241,6 @@ public class TestMetaReaderEditor {
     Pair<HRegionInfo, ServerName> pair =
       MetaReader.getRegion(CT, Bytes.toBytes("nonexistent-region"));
     assertNull(pair);
-    // Test it works getting a region from meta/root.
-    pair =
-      MetaReader.getRegion(CT, HRegionInfo.FIRST_META_REGIONINFO.getRegionName());
-    assertEquals(HRegionInfo.FIRST_META_REGIONINFO.getEncodedName(),
-      pair.getFirst().getEncodedName());
     LOG.info("Finished " + name);
   }
 

Modified: hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java?rev=1454613&r1=1454612&r2=1454613&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java
(original)
+++ hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java
Fri Mar  8 22:46:16 2013
@@ -1621,18 +1621,4 @@ public class TestAdmin {
       ct.stop();
     }
   }
-  
-  @Test
-  public void testRootTableSplit() throws Exception {
-    ServerName serverName = TEST_UTIL.getMiniHBaseCluster().getServerHoldingRoot();
-    Scan s = new Scan();
-    HTable rootTable = new HTable(TEST_UTIL.getConfiguration(), HConstants.ROOT_TABLE_NAME);
-    ResultScanner scanner = rootTable.getScanner(s);
-    Result metaEntry = scanner.next();
-    this.admin.split(HConstants.ROOT_TABLE_NAME, metaEntry.getRow());
-    Thread.sleep(1000);
-    List<HRegionInfo> onlineRegions = this.admin.getOnlineRegions(serverName);
-    assertTrue(onlineRegions != null && onlineRegions.contains(HRegionInfo.ROOT_REGIONINFO));
-  }
-
 }

Modified: hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/master/MockRegionServer.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/master/MockRegionServer.java?rev=1454613&r1=1454612&r2=1454613&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/master/MockRegionServer.java
(original)
+++ hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/master/MockRegionServer.java
Fri Mar  8 22:46:16 2013
@@ -402,7 +402,7 @@ class MockRegionServer implements AdminP
   public GetRegionInfoResponse getRegionInfo(RpcController controller,
       GetRegionInfoRequest request) throws ServiceException {
     GetRegionInfoResponse.Builder builder = GetRegionInfoResponse.newBuilder();
-    builder.setRegionInfo(HRegionInfo.convert(HRegionInfo.ROOT_REGIONINFO));
+    builder.setRegionInfo(HRegionInfo.convert(HRegionInfo.FIRST_META_REGIONINFO));
     return builder.build();
   }
 

Modified: hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestDistributedLogSplitting.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestDistributedLogSplitting.java?rev=1454613&r1=1454612&r2=1454613&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestDistributedLogSplitting.java
(original)
+++ hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestDistributedLogSplitting.java
Fri Mar  8 22:46:16 2013
@@ -260,7 +260,7 @@ public class TestDistributedLogSplitting
     }
 
     start = EnvironmentEdgeManager.currentTimeMillis();
-    while (getAllOnlineRegions(cluster).size() < (NUM_REGIONS_TO_CREATE + 2)) {
+    while (getAllOnlineRegions(cluster).size() < (NUM_REGIONS_TO_CREATE + 1)) {
       if (EnvironmentEdgeManager.currentTimeMillis() - start > 60000) {
         assertTrue("Timedout", false);
       }
@@ -357,18 +357,18 @@ public class TestDistributedLogSplitting
     blockUntilNoRIT(zkw, master);
     NavigableSet<String> regions = getAllOnlineRegions(cluster);
     LOG.debug("Verifying only catalog regions are assigned\n");
-    if (regions.size() != 2) {
+    if (regions.size() != 1) {
       for (String oregion : regions)
         LOG.debug("Region still online: " + oregion);
     }
-    assertEquals(2, regions.size());
+    assertEquals(1, regions.size());
     LOG.debug("Enabling table\n");
     TEST_UTIL.getHBaseAdmin().enableTable(table);
     LOG.debug("Waiting for no more RIT\n");
     blockUntilNoRIT(zkw, master);
     LOG.debug("Verifying there are " + numRegions + " assigned on cluster\n");
     regions = getAllOnlineRegions(cluster);
-    assertEquals(numRegions + 2, regions.size());
+    assertEquals(numRegions + 1, regions.size());
     return ht;
   }
 

Modified: hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterFailover.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterFailover.java?rev=1454613&r1=1454612&r2=1454613&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterFailover.java
(original)
+++ hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterFailover.java
Fri Mar  8 22:46:16 2013
@@ -215,7 +215,7 @@ public class TestMasterFailover {
     log("Regions in META have been created");
 
     // at this point we only expect 2 regions to be assigned out (catalogs)
-    assertEquals(2, cluster.countServedRegions());
+    assertEquals(1, cluster.countServedRegions());
 
     // Let's just assign everything to first RS
     HRegionServer hrs = cluster.getRegionServer(0);
@@ -523,7 +523,7 @@ public class TestMasterFailover {
     log("Regions in META have been created");
 
     // at this point we only expect 2 regions to be assigned out (catalogs)
-    assertEquals(2, cluster.countServedRegions());
+    assertEquals(1, cluster.countServedRegions());
 
     // The first RS will stay online
     List<RegionServerThread> regionservers =

Modified: hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterMetrics.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterMetrics.java?rev=1454613&r1=1454612&r2=1454613&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterMetrics.java
(original)
+++ hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterMetrics.java
Fri Mar  8 22:46:16 2013
@@ -88,7 +88,7 @@ public class TestMasterMetrics {
   public void testDefaultMasterMetrics() throws Exception {
     MetricsMasterSource masterSource = master.getMetrics().getMetricsSource();
     metricsHelper.assertGauge( "numRegionServers", 1, masterSource);
-    metricsHelper.assertGauge( "averageLoad", 2, masterSource);
+    metricsHelper.assertGauge( "averageLoad", 1, masterSource);
     metricsHelper.assertGauge( "numDeadRegionServers", 0, masterSource);
 
     metricsHelper.assertGauge("masterStartTime", master.getMasterStartTime(), masterSource);

Modified: hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterNoCluster.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterNoCluster.java?rev=1454613&r1=1454612&r2=1454613&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterNoCluster.java
(original)
+++ hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterNoCluster.java
Fri Mar  8 22:46:16 2013
@@ -43,7 +43,7 @@ import org.apache.hadoop.hbase.client.Re
 import org.apache.hadoop.hbase.regionserver.RegionOpeningState;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.hbase.util.Threads;
-import org.apache.hadoop.hbase.zookeeper.RootRegionTracker;
+import org.apache.hadoop.hbase.zookeeper.MetaRegionTracker;
 import org.apache.hadoop.hbase.zookeeper.ZKUtil;
 import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher;
 import org.apache.hadoop.hbase.MediumTests;
@@ -121,7 +121,7 @@ public class TestMasterNoCluster {
   throws IOException, KeeperException, InterruptedException {
     HMaster master = new HMaster(TESTUTIL.getConfiguration());
     master.start();
-    // Immediately have it stop.  We used hang in assigning root.
+    // Immediately have it stop.  We used hang in assigning meta.
     master.stopMaster();
     master.join();
   }
@@ -133,7 +133,7 @@ public class TestMasterNoCluster {
    * @throws KeeperException
    * @throws InterruptedException
    */
-  @Test
+  @Test (timeout=30000)
   public void testFailover()
   throws IOException, KeeperException, InterruptedException, ServiceException {
     final long now = System.currentTimeMillis();
@@ -148,14 +148,9 @@ public class TestMasterNoCluster {
     final MockRegionServer rs0 = new MockRegionServer(conf, sn0);
     final MockRegionServer rs1 = new MockRegionServer(conf, sn1);
     final MockRegionServer rs2 = new MockRegionServer(conf, sn2);
-    // Put some data into the servers.  Make it look like sn0 has the root
-    // w/ an entry that points to sn1 as the host of .META.  Put data into sn2
-    // so it looks like it has a few regions for a table named 't'.
-    RootRegionTracker.setRootLocation(rs0.getZooKeeper(), rs0.getServerName());
-    byte [] rootregion = Bytes.toBytes("-ROOT-,,0");
-    rs0.setGetResult(rootregion, HRegionInfo.FIRST_META_REGIONINFO.getRegionName(),
-      MetaMockingUtil.getMetaTableRowResult(HRegionInfo.FIRST_META_REGIONINFO,
-        rs1.getServerName()));
+    // Put some data into the servers.  Make it look like sn0 has the metaH
+    // Put data into sn2 so it looks like it has a few regions for a table named 't'.
+    MetaRegionTracker.setMetaLocation(rs0.getZooKeeper(), rs0.getServerName());
     final byte [] tableName = Bytes.toBytes("t");
     Result [] results = new Result [] {
       MetaMockingUtil.getMetaTableRowResult(
@@ -243,7 +238,7 @@ public class TestMasterNoCluster {
    * @throws DeserializationException 
    * @throws ServiceException
    */
-  @Test
+  @Test (timeout=30000)
   public void testCatalogDeploys()
   throws IOException, KeeperException, InterruptedException, DeserializationException, ServiceException
{
     final Configuration conf = TESTUTIL.getConfiguration();
@@ -292,7 +287,7 @@ public class TestMasterNoCluster {
         // of a connection will fail.
         HConnection connection =
           HConnectionTestingUtility.getMockedConnectionAndDecorate(TESTUTIL.getConfiguration(),
-            rs0, rs0, rs0.getServerName(), HRegionInfo.ROOT_REGIONINFO);
+            rs0, rs0, rs0.getServerName(), HRegionInfo.FIRST_META_REGIONINFO);
         return new CatalogTracker(zk, conf, connection, abortable);
       }
     };
@@ -320,38 +315,21 @@ public class TestMasterNoCluster {
       // Assert hostname is as expected.
       assertEquals(rs0.getServerName().getHostname(), rshostname);
       // Now master knows there is at least one regionserver checked in and so
-      // it'll wait a while to see if more and when none, will assign root and
-      // meta to this single server.  Will do an rpc open but we've
+      // it'll wait a while to see if more and when none, will assign meta
+      // to this single server.  Will do an rpc open but we've
       // mocked it above in our master override to return 'success'.  As part of
       // region open, master will have set an unassigned znode for the region up
       // into zk for the regionserver to transition.  Lets do that now to
       // complete fake of a successful open.
       Mocking.fakeRegionServerRegionOpenInZK(master, rs0.getZooKeeper(),
-        rs0.getServerName(), HRegionInfo.ROOT_REGIONINFO);
+        rs0.getServerName(), HRegionInfo.FIRST_META_REGIONINFO);
       LOG.info("fakeRegionServerRegionOpenInZK has started");
 
-
-      // Need to set root location as r1.  Usually the regionserver does this
-      // when its figured it just opened the root region by setting the root
+      // Need to set meta location as r0.  Usually the regionserver does this
+      // when its figured it just opened the meta region by setting the meta
       // location up into zk.  Since we're mocking regionserver, need to do this
       // ourselves.
-      RootRegionTracker.setRootLocation(rs0.getZooKeeper(), rs0.getServerName());
-      // Do same transitions for .META. (presuming master has by now assigned
-      // .META. to rs1).
-      Mocking.fakeRegionServerRegionOpenInZK(master, rs0.getZooKeeper(),
-        rs0.getServerName(), HRegionInfo.FIRST_META_REGIONINFO);
-      // Now trigger our mock regionserver to start returning a row when we
-      // go to get .META. entry in -ROOT-.  We do it by setting into
-      // our MockRegionServer some data to be returned when there is a get on
-      // -ROOT- table (up to this its been returning null making master think
-      // nothing assigned, not even .META.). The region for -ROOT- table we
-      // hardcode below.  Its always the same, at least in tests.  We need to do
-      // this because CatalogTracker runs inside in Master initialization to
-      // confirm .META. has a server.
-      byte [] rootregion = Bytes.toBytes("-ROOT-,,0");
-      rs0.setGetResult(rootregion, HRegionInfo.FIRST_META_REGIONINFO.getRegionName(),
-        MetaMockingUtil.getMetaTableRowResult(HRegionInfo.FIRST_META_REGIONINFO,
-          rs0.getServerName()));
+      MetaRegionTracker.setMetaLocation(rs0.getZooKeeper(), rs0.getServerName());
       // Master should now come up.
       while (!master.isInitialized()) {Threads.sleep(10);}
       assertTrue(master.isInitialized());

Modified: hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterRestartAfterDisablingTable.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterRestartAfterDisablingTable.java?rev=1454613&r1=1454612&r2=1454613&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterRestartAfterDisablingTable.java
(original)
+++ hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterRestartAfterDisablingTable.java
Fri Mar  8 22:46:16 2013
@@ -74,7 +74,7 @@ public class TestMasterRestartAfterDisab
     HTable ht = TEST_UTIL.createTable(table, family);
     int numRegions = TEST_UTIL.createMultiRegions(conf, ht, family,
         NUM_REGIONS_TO_CREATE);
-    numRegions += 2; // catalogs
+    numRegions += 1; // catalogs
     log("Waiting for no more RIT\n");
     blockUntilNoRIT(zkw, master);
     log("Disabling table\n");
@@ -83,7 +83,7 @@ public class TestMasterRestartAfterDisab
     NavigableSet<String> regions = getAllOnlineRegions(cluster);
     assertEquals(
         "The number of regions for the table tableRestart should be 0 and only"
-            + "the catalog tables should be present.", 2, regions.size());
+            + "the catalog tables should be present.", 1, regions.size());
 
     List<MasterThread> masterThreads = cluster.getMasterThreads();
     MasterThread activeMaster = null;
@@ -111,7 +111,7 @@ public class TestMasterRestartAfterDisab
     regions = getAllOnlineRegions(cluster);
     assertEquals(
         "The assigned regions were not onlined after master switch except for the catalog
tables.",
-        6, regions.size());
+        5, regions.size());
     assertTrue("The table should be in enabled state", cluster.getMaster()
         .getAssignmentManager().getZKTable().isEnabledTable("tableRestart"));
     ht.close();

Modified: hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterStatusServlet.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterStatusServlet.java?rev=1454613&r1=1454612&r2=1454613&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterStatusServlet.java
(original)
+++ hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterStatusServlet.java
Fri Mar  8 22:46:16 2013
@@ -107,21 +107,12 @@ public class TestMasterStatusServlet {
     new MasterStatusTmpl().render(new StringWriter(),
         master, admin);
   }
-  
-  @Test
-  public void testStatusTemplateRootAvailable() throws IOException {
-    new MasterStatusTmpl()
-      .setRootLocation(new ServerName("rootserver:123,12345"))
-      .render(new StringWriter(),
-        master, admin);
-  }
-  
+
   @Test
-  public void testStatusTemplateRootAndMetaAvailable() throws IOException {
+  public void testStatusTemplateMetaAvailable() throws IOException {
     setupMockTables();
     
     new MasterStatusTmpl()
-      .setRootLocation(new ServerName("rootserver:123,12345"))
       .setMetaLocation(new ServerName("metaserver:123,12345"))
       .render(new StringWriter(),
         master, admin);
@@ -141,7 +132,6 @@ public class TestMasterStatusServlet {
     );
 
     new MasterStatusTmpl()
-      .setRootLocation(new ServerName("rootserver:123,12345"))
       .setMetaLocation(new ServerName("metaserver:123,12345"))
       .setServers(servers)
       .setDeadServers(deadServers)

Modified: hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRollingRestart.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRollingRestart.java?rev=1454613&r1=1454612&r2=1454613&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRollingRestart.java
(original)
+++ hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRollingRestart.java
Fri Mar  8 22:46:16 2013
@@ -79,7 +79,7 @@ public class  TestRollingRestart {
     HTable ht = TEST_UTIL.createTable(table, family);
     int numRegions = TEST_UTIL.createMultiRegions(conf, ht, family,
         NUM_REGIONS_TO_CREATE);
-    numRegions += 2; // catalogs
+    numRegions += 1; // catalogs
     log("Waiting for no more RIT\n");
     blockUntilNoRIT(zkw, master);
     log("Disabling table\n");
@@ -88,10 +88,10 @@ public class  TestRollingRestart {
     blockUntilNoRIT(zkw, master);
     NavigableSet<String> regions = getAllOnlineRegions(cluster);
     log("Verifying only catalog regions are assigned\n");
-    if (regions.size() != 2) {
+    if (regions.size() != 1) {
       for (String oregion : regions) log("Region still online: " + oregion);
     }
-    assertEquals(2, regions.size());
+    assertEquals(1, regions.size());
     log("Enabling table\n");
     TEST_UTIL.getHBaseAdmin().enableTable(table);
     log("Waiting for no more RIT\n");
@@ -195,15 +195,11 @@ public class  TestRollingRestart {
         i++;
       }
     }
-    log("Stopping server hosting ROOT");
-    rootServer.getRegionServer().stop("Stopping ROOT server");
     log("Stopping server hosting META #1");
     metaServer.getRegionServer().stop("Stopping META server");
-    cluster.hbaseCluster.waitOnRegionServer(rootServer);
-    log("Root server down");
     cluster.hbaseCluster.waitOnRegionServer(metaServer);
     log("Meta server down #1");
-    expectedNumRS -= 2;
+    expectedNumRS--;
     log("Waiting for meta server #1 RS shutdown to be handled by master");
     waitForRSShutdownToStartAndFinish(activeMaster,
         metaServer.getRegionServer().getServerName());
@@ -290,7 +286,7 @@ public class  TestRollingRestart {
         log("RS: " + rst.getRegionServer().getServerName());
       }
     }
-    assertEquals(1, cluster.getRegionServerThreads().size());
+    assertEquals(2, cluster.getRegionServerThreads().size());
 
 
     // TODO: Bring random 3 of 4 RS down at the same time

Modified: hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionInfo.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionInfo.java?rev=1454613&r1=1454612&r2=1454613&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionInfo.java
(original)
+++ hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionInfo.java
Fri Mar  8 22:46:16 2013
@@ -142,7 +142,6 @@ public class TestHRegionInfo {
 
   @Test
   public void testMetaTables() {
-    assertTrue(HRegionInfo.ROOT_REGIONINFO.isMetaTable());
     assertTrue(HRegionInfo.FIRST_META_REGIONINFO.isMetaTable());
   }
 

Modified: hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRSKilledWhenMasterInitializing.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRSKilledWhenMasterInitializing.java?rev=1454613&r1=1454612&r2=1454613&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRSKilledWhenMasterInitializing.java
(original)
+++ hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRSKilledWhenMasterInitializing.java
Fri Mar  8 22:46:16 2013
@@ -167,18 +167,15 @@ public class TestRSKilledWhenMasterIniti
 
     // Second kill meta server
     int metaServerNum = cluster.getServerWithMeta();
-    int rootServerNum = cluster.getServerWith(HRegionInfo.ROOT_REGIONINFO
-        .getRegionName());
     HRegionServer metaRS = cluster.getRegionServer(metaServerNum);
-    LOG.debug("Killing metaRS and carryingRoot = "
-        + (metaServerNum == rootServerNum));
+    LOG.debug("Killing metaRS");
     metaRS.kill();
     metaRS.join();
 
     /*
      * Sleep double time of TestingMaster.sleep.duration, so we can ensure that
-     * master has already assigned ROOTandMETA or is blocking on assigning
-     * ROOTandMETA
+     * master has already assigned META or is blocking on assigning
+     * META
      */
     Thread.sleep(10000 * 2);
 
@@ -187,34 +184,7 @@ public class TestRSKilledWhenMasterIniti
     // Third check whether data is correct in meta region
     assertTrue(hbaseAdmin.isTableAvailable(TABLENAME));
 
-    /*
-     * NO.2 -ROOT- region correctness . If the .META. server killed in the NO.1
-     * is also carrying -ROOT- region, it is not needed
-     */
-    if (rootServerNum != metaServerNum) {
-      // First abort master
-      abortMaster(cluster);
-      master = startMasterAndWaitUntilLogSplit(cluster);
-
-      // Second kill meta server
-      HRegionServer rootRS = cluster.getRegionServer(rootServerNum);
-      LOG.debug("Killing rootRS");
-      rootRS.kill();
-      rootRS.join();
-
-      /*
-       * Sleep double time of TestingMaster.sleep.duration, so we can ensure
-       * that master has already assigned ROOTandMETA or is blocking on
-       * assigning ROOTandMETA
-       */
-      Thread.sleep(10000 * 2);
-      waitUntilMasterIsInitialized(master);
-
-      // Third check whether data is correct in meta region
-      assertTrue(hbaseAdmin.isTableAvailable(TABLENAME));
-    }
-
-    /* NO.3 data region correctness */
+    /* NO.2 data region correctness */
     ServerManager serverManager = cluster.getMaster().getServerManager();
     while (serverManager.areDeadServersInProgress()) {
       Thread.sleep(100);

Modified: hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStoreFileBlockCacheSummary.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStoreFileBlockCacheSummary.java?rev=1454613&r1=1454612&r2=1454613&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStoreFileBlockCacheSummary.java
(original)
+++ hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStoreFileBlockCacheSummary.java
Fri Mar  8 22:46:16 2013
@@ -109,17 +109,13 @@ public class TestStoreFileBlockCacheSumm
      bc.getBlockCacheColumnFamilySummaries(TEST_UTIL.getConfiguration());
    LOG.info("blockCacheSummary: " + bcs);
 
-   assertEquals("blockCache summary has entries", 3, bcs.size());
-   
-   BlockCacheColumnFamilySummary e = bcs.get(0);
-   assertEquals("table", "-ROOT-", e.getTable());
-   assertEquals("cf", "info", e.getColumnFamily());
+   assertEquals("blockCache summary has entries", 2, bcs.size());
 
-   e = bcs.get(1);
+   BlockCacheColumnFamilySummary e = bcs.get(0);
    assertEquals("table", TEST_TABLE, e.getTable());
    assertEquals("cf", TEST_CF, e.getColumnFamily());
 
-   e = bcs.get(2);
+   e = bcs.get(1);
    assertEquals("table", TEST_TABLE2, e.getTable());
    assertEquals("cf", TEST_CF, e.getColumnFamily());
 

Modified: hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/rest/TestStatusResource.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/rest/TestStatusResource.java?rev=1454613&r1=1454612&r2=1454613&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/rest/TestStatusResource.java
(original)
+++ hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/rest/TestStatusResource.java
Fri Mar  8 22:46:16 2013
@@ -42,7 +42,6 @@ import org.junit.experimental.categories
 
 @Category(MediumTests.class)
 public class TestStatusResource {
-  private static final byte[] ROOT_REGION_NAME = Bytes.toBytes("-ROOT-,,0");
   private static final byte[] META_REGION_NAME = Bytes.toBytes(".META.,,1");
 
   private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
@@ -59,20 +58,17 @@ public class TestStatusResource {
     assertNotNull(model.getLiveNodes());
     assertNotNull(model.getDeadNodes());
     assertFalse(model.getLiveNodes().isEmpty());
-    boolean foundRoot = false, foundMeta = false;
+    boolean foundMeta = false;
     for (StorageClusterStatusModel.Node node: model.getLiveNodes()) {
       assertNotNull(node.getName());
       assertTrue(node.getStartCode() > 0L);
       assertTrue(node.getRequests() >= 0);
       for (StorageClusterStatusModel.Node.Region region: node.getRegions()) {
-        if (Bytes.equals(region.getName(), ROOT_REGION_NAME)) {
-          foundRoot = true;
-        } else if (Bytes.equals(region.getName(), META_REGION_NAME)) {
+        if (Bytes.equals(region.getName(), META_REGION_NAME)) {
           foundMeta = true;
         }
       }
     }
-    assertTrue(foundRoot);
     assertTrue(foundMeta);
   }
 

Modified: hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java?rev=1454613&r1=1454612&r2=1454613&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java
(original)
+++ hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java
Fri Mar  8 22:46:16 2013
@@ -34,8 +34,7 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.ScheduledThreadPoolExecutor;
+import java.util.concurrent.*;
 
 import org.apache.commons.io.IOUtils;
 import org.apache.commons.logging.Log;
@@ -105,6 +104,7 @@ public class TestHBaseFsck {
   private final static byte[] FAM = Bytes.toBytes(FAM_STR);
   private final static int REGION_ONLINE_TIMEOUT = 800;
   private static RegionStates regionStates;
+  private static ExecutorService executorService;
 
   // for the instance, reset every test run
   private HTable tbl;
@@ -118,8 +118,13 @@ public class TestHBaseFsck {
   @BeforeClass
   public static void setUpBeforeClass() throws Exception {
     TEST_UTIL.getConfiguration().setBoolean(HConstants.DISTRIBUTED_LOG_SPLITTING_KEY, false);
+    TEST_UTIL.getConfiguration().setInt("hbase.regionserver.handler.count", 2);
+    TEST_UTIL.getConfiguration().setInt("hbase.regionserver.metahandler.count", 2);
     TEST_UTIL.startMiniCluster(3);
 
+    executorService = new ThreadPoolExecutor(1, Integer.MAX_VALUE, 60, TimeUnit.SECONDS,
+        new SynchronousQueue<Runnable>(), Threads.newDaemonThreadFactory("testhbck"));
+
     AssignmentManager assignmentManager =
       TEST_UTIL.getHBaseCluster().getMaster().getAssignmentManager();
     regionStates = assignmentManager.getRegionStates();
@@ -141,7 +146,7 @@ public class TestHBaseFsck {
 
     // Now let's mess it up and change the assignment in .META. to
     // point to a different region server
-    HTable meta = new HTable(conf, HTableDescriptor.META_TABLEDESC.getName());
+    HTable meta = new HTable(conf, HTableDescriptor.META_TABLEDESC.getName(), executorService);
     ResultScanner scanner = meta.getScanner(new Scan());
     HRegionInfo hri = null;
 
@@ -181,7 +186,7 @@ public class TestHBaseFsck {
     assertNoErrors(doFsck(conf, false));
 
     // comment needed - what is the purpose of this line
-    HTable t = new HTable(conf, Bytes.toBytes(table));
+    HTable t = new HTable(conf, Bytes.toBytes(table), executorService);
     ResultScanner s = t.getScanner(new Scan());
     s.close();
     t.close();
@@ -196,7 +201,7 @@ public class TestHBaseFsck {
   private HRegionInfo createRegion(Configuration conf, final HTableDescriptor
       htd, byte[] startKey, byte[] endKey)
       throws IOException {
-    HTable meta = new HTable(conf, HConstants.META_TABLE_NAME);
+    HTable meta = new HTable(conf, HConstants.META_TABLE_NAME, executorService);
     HRegionInfo hri = new HRegionInfo(htd.getName(), startKey, endKey);
     MetaEditor.addRegionToMeta(meta, hri);
     meta.close();
@@ -288,7 +293,7 @@ public class TestHBaseFsck {
         }
 
         if (metaRow) {
-          HTable meta = new HTable(conf, HConstants.META_TABLE_NAME);
+          HTable meta = new HTable(conf, HConstants.META_TABLE_NAME, executorService);
           Delete delete = new Delete(deleteRow);
           meta.delete(delete);
         }
@@ -313,7 +318,7 @@ public class TestHBaseFsck {
     HColumnDescriptor hcd = new HColumnDescriptor(Bytes.toString(FAM));
     desc.addFamily(hcd); // If a table has no CF's it doesn't get checked
     TEST_UTIL.getHBaseAdmin().createTable(desc, SPLITS);
-    tbl = new HTable(TEST_UTIL.getConfiguration(), tablename);
+    tbl = new HTable(TEST_UTIL.getConfiguration(), Bytes.toBytes(tablename), executorService);
 
     List<Put> puts = new ArrayList<Put>();
     for (byte[] row : ROWKEYS) {
@@ -350,9 +355,16 @@ public class TestHBaseFsck {
     admin.getConnection().clearRegionCache();
     byte[] tbytes = Bytes.toBytes(tablename);
     admin.disableTableAsync(tbytes);
+    long totalWait = 0;
+    long maxWait = 30*1000;
+    long sleepTime = 250;
     while (!admin.isTableDisabled(tbytes)) {
       try {
-        Thread.sleep(250);
+        Thread.sleep(sleepTime);
+        totalWait += sleepTime;
+        if (totalWait >= maxWait) {
+          fail("Waited too long for table to be disabled + " + tablename);
+        }
       } catch (InterruptedException e) {
         e.printStackTrace();
         fail("Interrupted when trying to disable table " + tablename);
@@ -722,7 +734,7 @@ public class TestHBaseFsck {
 
       assertNotNull(regionName);
       assertNotNull(serverName);
-      HTable meta = new HTable(conf, HConstants.META_TABLE_NAME);
+      HTable meta = new HTable(conf, HConstants.META_TABLE_NAME, executorService);
       Put put = new Put(regionName);
       put.add(HConstants.CATALOG_FAMILY, HConstants.SERVER_QUALIFIER,
         Bytes.toBytes(serverName.getHostAndPort()));
@@ -1211,7 +1223,7 @@ public class TestHBaseFsck {
         Bytes.toBytes("C"), true, true, false);
 
       // Create a new meta entry to fake it as a split parent.
-      meta = new HTable(conf, HTableDescriptor.META_TABLEDESC.getName());
+      meta = new HTable(conf, HTableDescriptor.META_TABLEDESC.getName(), executorService);
       HRegionInfo hri = location.getRegionInfo();
 
       HRegionInfo a = new HRegionInfo(tbl.getTableName(),
@@ -1384,7 +1396,7 @@ public class TestHBaseFsck {
    * This creates and fixes a bad table with a missing region which is the 1st region --
hole in
    * meta and data missing in the fs.
    */
-  @Test
+  @Test(timeout=120000)
   public void testMissingFirstRegion() throws Exception {
     String table = "testMissingFirstRegion";
     try {
@@ -1412,7 +1424,7 @@ public class TestHBaseFsck {
    * This creates and fixes a bad table with missing last region -- hole in meta and data
missing in
    * the fs.
    */
-  @Test
+  @Test(timeout=120000)
   public void testMissingLastRegion() throws Exception {
     String table = "testMissingLastRegion";
     try {

Modified: hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestMergeTool.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestMergeTool.java?rev=1454613&r1=1454612&r2=1454613&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestMergeTool.java
(original)
+++ hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestMergeTool.java
Fri Mar  8 22:46:16 2013
@@ -136,8 +136,8 @@ public class TestMergeTool extends HBase
 
     super.setUp();
     try {
-      // Create root and meta regions
-      createRootAndMetaRegions();
+      // Create meta region
+      createMetaRegion();
       FSTableDescriptors.createTableDescriptor(this.fs, this.testDir, this.desc);
       /*
        * Create the regions we will merge
@@ -273,7 +273,7 @@ public class TestMergeTool extends HBase
     
     try {
        // Merge Region 0 and Region 1
-      HRegion merged = mergeAndVerify("merging regions 0 and 1",
+      HRegion merged = mergeAndVerify("merging regions 0 and 1 ",
         this.sourceRegions[0].getRegionNameAsString(),
         this.sourceRegions[1].getRegionNameAsString(), log, 2);
 

Modified: hbase/branches/0.95/hbase-server/src/test/ruby/hbase/admin_test.rb
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-server/src/test/ruby/hbase/admin_test.rb?rev=1454613&r1=1454612&r2=1454613&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-server/src/test/ruby/hbase/admin_test.rb (original)
+++ hbase/branches/0.95/hbase-server/src/test/ruby/hbase/admin_test.rb Fri Mar  8 22:46:16
2013
@@ -75,7 +75,6 @@ module Hbase
 
     define_test "list should not return meta tables" do
       assert(!admin.list.member?('.META.'))
-      assert(!admin.list.member?('-ROOT-'))
     end
 
     #-------------------------------------------------------------------------------

Modified: hbase/branches/0.95/hbase-server/src/test/ruby/hbase/table_test.rb
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-server/src/test/ruby/hbase/table_test.rb?rev=1454613&r1=1454612&r2=1454613&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-server/src/test/ruby/hbase/table_test.rb (original)
+++ hbase/branches/0.95/hbase-server/src/test/ruby/hbase/table_test.rb Fri Mar  8 22:46:16
2013
@@ -58,10 +58,6 @@ module Hbase
       assert(table('.META.').is_meta_table?)
     end
 
-    define_test "is_meta_table? method should return true for the root table" do
-      assert(table('-ROOT-').is_meta_table?)
-    end
-
     define_test "is_meta_table? method should return false for a normal table" do
       assert(!@test_table.is_meta_table?)
     end



Mime
View raw message