hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmhs...@apache.org
Subject svn commit: r1515160 - in /hbase/trunk: hbase-client/src/main/java/org/apache/hadoop/hbase/ hbase-common/src/main/java/org/apache/hadoop/hbase/ hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ hbase-server/src/main/java/org/...
Date Sun, 18 Aug 2013 16:28:11 GMT
Author: jmhsieh
Date: Sun Aug 18 16:28:10 2013
New Revision: 1515160

URL: http://svn.apache.org/r1515160
Log:
HBASE-9246 Remove ROOT_TABLEDESC, ROOT_REGIONINFO, and ROOT_TABLE_NAME

Modified:
    hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/HRegionInfo.java
    hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/HTableDescriptor.java
    hbase/trunk/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java
    hbase/trunk/hbase-common/src/main/java/org/apache/hadoop/hbase/TableName.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSTableDescriptors.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseCluster.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/TestHRegionLocation.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestClientScannerRPCTimeout.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotFromClient.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterNoCluster.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRestartCluster.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRollingRestart.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/rest/model/TestStorageClusterStatusModel.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestFSTableDescriptors.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestMergeTable.java

Modified: hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/HRegionInfo.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/HRegionInfo.java?rev=1515160&r1=1515159&r2=1515160&view=diff
==============================================================================
--- hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/HRegionInfo.java (original)
+++ hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/HRegionInfo.java Sun Aug
18 16:28:10 2013
@@ -191,10 +191,6 @@ public class HRegionInfo implements Comp
   // Current TableName
   private TableName tableName = null;
 
-  /** HRegionInfo for root region */
-  public static final HRegionInfo ROOT_REGIONINFO =
-      new HRegionInfo(0L, TableName.ROOT_TABLE_NAME);
-
   /** HRegionInfo for first meta region */
   public static final HRegionInfo FIRST_META_REGIONINFO =
       new HRegionInfo(1L, TableName.META_TABLE_NAME);

Modified: hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/HTableDescriptor.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/HTableDescriptor.java?rev=1515160&r1=1515159&r2=1515160&view=diff
==============================================================================
--- hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/HTableDescriptor.java (original)
+++ hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/HTableDescriptor.java Sun
Aug 18 16:28:10 2013
@@ -1331,19 +1331,6 @@ public class HTableDescriptor implements
               new Path(name.getNamespaceAsString(), new Path(name.getQualifierAsString()))));
   }
 
-  /** Table descriptor for <core>-ROOT-</code> catalog table */
-  public static final HTableDescriptor ROOT_TABLEDESC = new HTableDescriptor(
-      TableName.ROOT_TABLE_NAME,
-      new HColumnDescriptor[] {
-          new HColumnDescriptor(HConstants.CATALOG_FAMILY)
-              // Ten is arbitrary number.  Keep versions to help debugging.
-              .setMaxVersions(10)
-              .setInMemory(true)
-              .setBlocksize(8 * 1024)
-              .setTimeToLive(HConstants.FOREVER)
-              .setScope(HConstants.REPLICATION_SCOPE_LOCAL)
-      });
-
   /** Table descriptor for <code>.META.</code> catalog table */
   public static final HTableDescriptor META_TABLEDESC = new HTableDescriptor(
       TableName.META_TABLE_NAME,

Modified: hbase/trunk/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java?rev=1515160&r1=1515159&r2=1515160&view=diff
==============================================================================
--- hbase/trunk/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java (original)
+++ hbase/trunk/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java Sun Aug
18 16:28:10 2013
@@ -842,7 +842,7 @@ public final class HConstants {
   /** Directories that are not HBase user table directories */
   public static final List<String> HBASE_NON_USER_TABLE_DIRS =
     Collections.unmodifiableList(Arrays.asList((String[])ArrayUtils.addAll(
-      new String[] { TableName.META_TABLE_NAME.getNameAsString(), TableName.ROOT_TABLE_NAME.getNameAsString()
},
+      new String[] { TableName.META_TABLE_NAME.getNameAsString() },
       HBASE_NON_TABLE_DIRS.toArray())));
 
   /** Health script related settings. */

Modified: hbase/trunk/hbase-common/src/main/java/org/apache/hadoop/hbase/TableName.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-common/src/main/java/org/apache/hadoop/hbase/TableName.java?rev=1515160&r1=1515159&r2=1515160&view=diff
==============================================================================
--- hbase/trunk/hbase-common/src/main/java/org/apache/hadoop/hbase/TableName.java (original)
+++ hbase/trunk/hbase-common/src/main/java/org/apache/hadoop/hbase/TableName.java Sun Aug
18 16:28:10 2013
@@ -63,10 +63,6 @@ public final class TableName implements 
       "(?:(?:(?:"+VALID_NAMESPACE_REGEX+"\\"+NAMESPACE_DELIM+")?)" +
          "(?:"+VALID_TABLE_QUALIFIER_REGEX+"))";
 
-  /** The root table's name.*/
-  public static final TableName ROOT_TABLE_NAME =
-      valueOf(NamespaceDescriptor.SYSTEM_NAMESPACE_NAME_STR, "root");
-
   /** The META table's name. */
   public static final TableName META_TABLE_NAME =
       valueOf(NamespaceDescriptor.SYSTEM_NAMESPACE_NAME_STR, "meta");

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java?rev=1515160&r1=1515159&r2=1515160&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java
(original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java
Sun Aug 18 16:28:10 2013
@@ -399,8 +399,7 @@ public class ReplicationSource extends T
         removeNonReplicableEdits(entry);
         // Don't replicate catalog entries, if the WALEdit wasn't
         // containing anything to replicate and if we're currently not set to replicate
-        if (!(logKey.getTablename().equals(TableName.ROOT_TABLE_NAME) ||
-            logKey.getTablename().equals(TableName.META_TABLE_NAME)) &&
+        if (!logKey.getTablename().equals(TableName.META_TABLE_NAME) &&
             edit.size() != 0) {
           // Only set the clusterId if is a local key.
           // This ensures that the originator sets the cluster id

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSTableDescriptors.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSTableDescriptors.java?rev=1515160&r1=1515159&r2=1515160&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSTableDescriptors.java
(original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSTableDescriptors.java
Sun Aug 18 16:28:10 2013
@@ -144,15 +144,11 @@ public class FSTableDescriptors implemen
   public HTableDescriptor get(final TableName tablename)
   throws IOException {
     invocations++;
-    if (HTableDescriptor.ROOT_TABLEDESC.getTableName().equals(tablename)) {
-      cachehits++;
-      return HTableDescriptor.ROOT_TABLEDESC;
-    }
     if (HTableDescriptor.META_TABLEDESC.getTableName().equals(tablename)) {
       cachehits++;
       return HTableDescriptor.META_TABLEDESC;
     }
-    // .META. and -ROOT- is already handled. If some one tries to get the descriptor for
+    // .META. is already handled. If some one tries to get the descriptor for
     // .logs, .oldlogs or .corrupt throw an exception.
     if (HConstants.HBASE_NON_USER_TABLE_DIRS.contains(tablename.getNameAsString())) {
        throw new IOException("No descriptor found for non table = " + tablename);
@@ -494,8 +490,7 @@ public class FSTableDescriptors implemen
   private TableDescriptorAndModtime getTableDescriptorAndModtime(TableName tableName)
   throws IOException {
     // ignore both -ROOT- and .META. tables
-    if (tableName.equals(TableName.ROOT_TABLE_NAME)
-        || tableName.equals(TableName.META_TABLE_NAME)) {
+    if (tableName.equals(TableName.META_TABLE_NAME)) {
       return null;
     }
     return getTableDescriptorAndModtime(getTableDir(tableName));

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseCluster.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseCluster.java?rev=1515160&r1=1515159&r2=1515160&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseCluster.java (original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseCluster.java Sun Aug
18 16:28:10 2013
@@ -246,13 +246,6 @@ public abstract class HBaseCluster imple
   }
 
   /**
-   * Get the ServerName of region server serving ROOT region
-   */
-  public ServerName getServerHoldingRoot() throws IOException {
-    return getServerHoldingRegion(HRegionInfo.ROOT_REGIONINFO.getRegionName());
-  }
-
-  /**
    * Get the ServerName of region server serving the first META region
    */
   public ServerName getServerHoldingMeta() throws IOException {

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/TestHRegionLocation.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/TestHRegionLocation.java?rev=1515160&r1=1515159&r2=1515160&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/TestHRegionLocation.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/TestHRegionLocation.java
Sun Aug 18 16:28:10 2013
@@ -40,13 +40,13 @@ public class TestHRegionLocation {
     HRegionLocation hrl2 = new HRegionLocation(HRegionInfo.FIRST_META_REGIONINFO, hsa1);
     assertEquals(hrl1.hashCode(), hrl2.hashCode());
     assertTrue(hrl1.equals(hrl2));
-    HRegionLocation hrl3 = new HRegionLocation(HRegionInfo.ROOT_REGIONINFO, hsa1);
+    HRegionLocation hrl3 = new HRegionLocation(HRegionInfo.FIRST_META_REGIONINFO, hsa1);
     assertNotSame(hrl1, hrl3);
     // They are equal because they have same location even though they are
     // carrying different regions or timestamp.
     assertTrue(hrl1.equals(hrl3));
     ServerName hsa2 = new ServerName("localhost", 12345, -1L);
-    HRegionLocation hrl4 = new HRegionLocation(HRegionInfo.ROOT_REGIONINFO, hsa2);
+    HRegionLocation hrl4 = new HRegionLocation(HRegionInfo.FIRST_META_REGIONINFO, hsa2);
     // These have same HRI but different locations so should be different.
     assertFalse(hrl3.equals(hrl4));
     HRegionLocation hrl5 = new HRegionLocation(hrl4.getRegionInfo(),
@@ -65,10 +65,10 @@ public class TestHRegionLocation {
   public void testCompareTo() {
     ServerName hsa1 = new ServerName("localhost", 1234, -1L);
     HRegionLocation hsl1 =
-      new HRegionLocation(HRegionInfo.ROOT_REGIONINFO, hsa1);
+      new HRegionLocation(HRegionInfo.FIRST_META_REGIONINFO, hsa1);
     ServerName hsa2 = new ServerName("localhost", 1235, -1L);
     HRegionLocation hsl2 =
-      new HRegionLocation(HRegionInfo.ROOT_REGIONINFO, hsa2);
+      new HRegionLocation(HRegionInfo.FIRST_META_REGIONINFO, hsa2);
     assertTrue(hsl1.compareTo(hsl1) == 0);
     assertTrue(hsl2.compareTo(hsl2) == 0);
     int compare1 = hsl1.compareTo(hsl2);

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestClientScannerRPCTimeout.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestClientScannerRPCTimeout.java?rev=1515160&r1=1515159&r2=1515160&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestClientScannerRPCTimeout.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestClientScannerRPCTimeout.java
Sun Aug 18 16:28:10 2013
@@ -160,8 +160,7 @@ public class TestClientScannerRPCTimeout
       } else {
         ScanResponse scanRes = super.scan(controller, request);
         String regionName = Bytes.toString(request.getRegion().getValue().toByteArray());
-        if (!regionName.contains(TableName.ROOT_TABLE_NAME.getNameAsString()) &&
-            !regionName.contains(TableName.META_TABLE_NAME.getNameAsString())) {
+        if (!regionName.contains(TableName.META_TABLE_NAME.getNameAsString())) {
           tableScannerId = scanRes.getScannerId();
         }
         return scanRes;

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotFromClient.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotFromClient.java?rev=1515160&r1=1515159&r2=1515160&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotFromClient.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotFromClient.java
Sun Aug 18 16:28:10 2013
@@ -127,13 +127,6 @@ public class TestSnapshotFromClient {
     } catch (IllegalArgumentException e) {
       // expected
     }
-
-    try {
-      admin.snapshot(snapshotName, TableName.ROOT_TABLE_NAME);
-      fail("taking a snapshot of -ROOT- should not be allowed");
-    } catch (IllegalArgumentException e) {
-      // expected
-    }
   }
 
   /**

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterNoCluster.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterNoCluster.java?rev=1515160&r1=1515159&r2=1515160&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterNoCluster.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterNoCluster.java
Sun Aug 18 16:28:10 2013
@@ -206,7 +206,7 @@ public class TestMasterNoCluster {
         // associate so the below mocking 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);
       }
 
@@ -395,7 +395,7 @@ public class TestMasterNoCluster {
         // associate so the below mocking 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);
       }
 

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRestartCluster.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRestartCluster.java?rev=1515160&r1=1515159&r2=1515160&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRestartCluster.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRestartCluster.java
Sun Aug 18 16:28:10 2013
@@ -68,8 +68,6 @@ public class TestRestartCluster {
 
     ServerName sn = new ServerName(HMaster.MASTER, -1, System.currentTimeMillis());
 
-    ZKAssign.createNodeOffline(zooKeeper, HRegionInfo.ROOT_REGIONINFO, sn);
-
     ZKAssign.createNodeOffline(zooKeeper, HRegionInfo.FIRST_META_REGIONINFO, sn);
 
     LOG.debug("Created UNASSIGNED zNode for ROOT and META regions in state " +

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRollingRestart.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRollingRestart.java?rev=1515160&r1=1515159&r2=1515160&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRollingRestart.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRollingRestart.java
Sun Aug 18 16:28:10 2013
@@ -184,17 +184,8 @@ public class  TestRollingRestart {
     Thread.sleep(1000);
     assertRegionsAssigned(cluster, regions);
 
-    // Bring the RS hosting ROOT down and the RS hosting META down at once
-    RegionServerThread rootServer = getServerHostingRoot(cluster);
+    // Bring the RS hosting META down
     RegionServerThread metaServer = getServerHostingMeta(cluster);
-    if (rootServer == metaServer) {
-      log("ROOT and META on the same server so killing another random server");
-      int i=0;
-      while (rootServer == metaServer) {
-        metaServer = cluster.getRegionServerThreads().get(i);
-        i++;
-      }
-    }
     log("Stopping server hosting META #1");
     metaServer.getRegionServer().stop("Stopping META server");
     cluster.hbaseCluster.waitOnRegionServer(metaServer);
@@ -328,11 +319,6 @@ public class  TestRollingRestart {
     return getServerHosting(cluster, HRegionInfo.FIRST_META_REGIONINFO);
   }
 
-  private RegionServerThread getServerHostingRoot(MiniHBaseCluster cluster)
-      throws IOException {
-    return getServerHosting(cluster, HRegionInfo.ROOT_REGIONINFO);
-  }
-
   private RegionServerThread getServerHosting(MiniHBaseCluster cluster,
       HRegionInfo region) throws IOException {
     for (RegionServerThread rst : cluster.getRegionServerThreads()) {

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java?rev=1515160&r1=1515159&r2=1515160&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java
Sun Aug 18 16:28:10 2013
@@ -1695,83 +1695,6 @@ public class TestHRegion extends HBaseTe
     }
   }
 
-  //Test that checked if there was anything special when reading from the ROOT
-  //table. To be able to use this test you need to comment the part in
-  //HTableDescriptor that checks for '-' and '.'. You also need to remove the
-  //s in the beginning of the name.
-  public void stestGet_Root() throws IOException {
-    //Setting up region
-    String method = this.getName();
-    this.region = initHRegion(TableName.ROOT_TABLE_NAME,
-      method, conf, HConstants.CATALOG_FAMILY);
-    try {
-      //Add to memstore
-      Put put = new Put(HConstants.EMPTY_START_ROW);
-      put.add(HConstants.CATALOG_FAMILY, HConstants.REGIONINFO_QUALIFIER, null);
-      region.put(put);
-
-      Get get = new Get(HConstants.EMPTY_START_ROW);
-      get.addColumn(HConstants.CATALOG_FAMILY, HConstants.REGIONINFO_QUALIFIER);
-
-      //Expected result
-      KeyValue kv1 = new KeyValue(HConstants.EMPTY_START_ROW,
-          HConstants.CATALOG_FAMILY, HConstants.REGIONINFO_QUALIFIER);
-      KeyValue [] expected = {kv1};
-
-      //Test from memstore
-      Result res = region.get(get);
-
-      assertEquals(expected.length, res.size());
-      for(int i=0; i<res.size(); i++){
-        assertEquals(0,
-            Bytes.compareTo(expected[i].getRow(), res.raw()[i].getRow()));
-        assertEquals(0,
-            Bytes.compareTo(expected[i].getFamily(), res.raw()[i].getFamily()));
-        assertEquals(0,
-            Bytes.compareTo(
-                expected[i].getQualifier(), res.raw()[i].getQualifier()));
-      }
-
-      //flush
-      region.flushcache();
-
-      //test2
-      res = region.get(get);
-
-      assertEquals(expected.length, res.size());
-      for(int i=0; i<res.size(); i++){
-        assertEquals(0,
-            Bytes.compareTo(expected[i].getRow(), res.raw()[i].getRow()));
-        assertEquals(0,
-            Bytes.compareTo(expected[i].getFamily(), res.raw()[i].getFamily()));
-        assertEquals(0,
-            Bytes.compareTo(
-                expected[i].getQualifier(), res.raw()[i].getQualifier()));
-      }
-
-      //Scan
-      Scan scan = new Scan();
-      scan.addFamily(HConstants.CATALOG_FAMILY);
-      InternalScanner s = region.getScanner(scan);
-      List<KeyValue> result = new ArrayList<KeyValue>();
-      s.next(result);
-
-      assertEquals(expected.length, result.size());
-      for(int i=0; i<res.size(); i++){
-        assertEquals(0,
-            Bytes.compareTo(expected[i].getRow(), result.get(i).getRow()));
-        assertEquals(0,
-            Bytes.compareTo(expected[i].getFamily(), result.get(i).getFamily()));
-        assertEquals(0,
-            Bytes.compareTo(
-                expected[i].getQualifier(), result.get(i).getQualifier()));
-      }
-    } finally {
-      HRegion.closeHRegion(this.region);
-      this.region = null;
-    }
-  }
-
   //////////////////////////////////////////////////////////////////////////////
   // Merge test
   //////////////////////////////////////////////////////////////////////////////

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/rest/model/TestStorageClusterStatusModel.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/rest/model/TestStorageClusterStatusModel.java?rev=1515160&r1=1515159&r2=1515160&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/rest/model/TestStorageClusterStatusModel.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/rest/model/TestStorageClusterStatusModel.java
Sun Aug 18 16:28:10 2013
@@ -78,7 +78,7 @@ public class TestStorageClusterStatusMod
     model.setRequests(0);
     model.setAverageLoad(1.0);
     model.addLiveNode("test1", 1245219839331L, 128, 1024)
-      .addRegion(Bytes.toBytes(TableName.ROOT_TABLE_NAME+",,0"), 1, 1, 0, 0, 0, 1, 2, 1,
1, 1, 1, 1);
+      .addRegion(Bytes.toBytes("hbase:root,,0"), 1, 1, 0, 0, 0, 1, 2, 1, 1, 1, 1, 1);
     model.addLiveNode("test2", 1245239331198L, 512, 1024)
       .addRegion(Bytes.toBytes(TableName.META_TABLE_NAME+",,1246000043724"),1, 1, 0, 0, 0,
           1, 2, 1, 1, 1, 1, 1);
@@ -122,7 +122,7 @@ public class TestStorageClusterStatusMod
       node.getRegions().iterator();
     StorageClusterStatusModel.Node.Region region = regions.next();
     assertTrue(Bytes.toString(region.getName()).equals(
-        TableName.ROOT_TABLE_NAME+",,0"));
+        "hbase:root,,0"));
     assertEquals(region.getStores(), 1);
     assertEquals(region.getStorefiles(), 1);
     assertEquals(region.getStorefileSizeMB(), 0);

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestFSTableDescriptors.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestFSTableDescriptors.java?rev=1515160&r1=1515159&r2=1515160&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestFSTableDescriptors.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestFSTableDescriptors.java
Sun Aug 18 16:28:10 2013
@@ -207,10 +207,6 @@ public class TestFSTableDescriptors {
     assertEquals(count * 4, htds.invocations);
     assertTrue("expected=" + (count * 2) + ", actual=" + htds.cachehits,
       htds.cachehits >= (count * 2));
-    assertTrue(htds.get(TableName.ROOT_TABLE_NAME) != null);
-    assertEquals(htds.invocations, count * 4 + 1);
-    assertTrue("expected=" + ((count * 2) + 1) + ", actual=" + htds.cachehits,
-      htds.cachehits >= ((count * 2) + 1));
   }
 
   @Test

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestMergeTable.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestMergeTable.java?rev=1515160&r1=1515159&r2=1515160&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestMergeTable.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestMergeTable.java
Sun Aug 18 16:28:10 2013
@@ -104,7 +104,7 @@ public class TestMergeTable {
 
     // Now create the root and meta regions and insert the data regions
     // created above into .META.
-    setupROOTAndMeta(rootdir, regions);
+    setupMeta(rootdir, regions);
     try {
       LOG.info("Starting mini zk cluster");
       UTIL.startMiniZKCluster();
@@ -154,20 +154,15 @@ public class TestMergeTable {
     return region;
   }
 
-  protected void setupROOTAndMeta(Path rootdir, final HRegion [] regions)
+  protected void setupMeta(Path rootdir, final HRegion [] regions)
   throws IOException {
-    HRegion root =
-      HRegion.createHRegion(HRegionInfo.ROOT_REGIONINFO, rootdir,
-          UTIL.getConfiguration(), HTableDescriptor.ROOT_TABLEDESC);
     HRegion meta =
       HRegion.createHRegion(HRegionInfo.FIRST_META_REGIONINFO, rootdir,
       UTIL.getConfiguration(), HTableDescriptor.META_TABLEDESC);
-    HRegion.addRegionToMETA(root, meta);
     for (HRegion r: regions) {
       HRegion.addRegionToMETA(meta, r);
     }
     HRegion.closeHRegion(meta);
-    HRegion.closeHRegion(root);
   }
 
 }



Mime
View raw message