hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ramkris...@apache.org
Subject svn commit: r1407726 - in /hbase/branches/0.92/src: main/java/org/apache/hadoop/hbase/regionserver/HRegion.java test/java/org/apache/hadoop/hbase/client/TestAdmin.java
Date Sat, 10 Nov 2012 07:53:20 GMT
Author: ramkrishna
Date: Sat Nov 10 07:53:19 2012
New Revision: 1407726

URL: http://svn.apache.org/viewvc?rev=1407726&view=rev
Log:
HBASE-6665 ROOT region should not be splitted even with META row as explicit split key (Rajesh)


Modified:
    hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
    hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java

Modified: hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java?rev=1407726&r1=1407725&r2=1407726&view=diff
==============================================================================
--- hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java (original)
+++ hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java Sat
Nov 10 07:53:19 2012
@@ -4266,10 +4266,10 @@ public class HRegion implements HeapSize
    * is based on the size of the store.
    */
   public byte[] checkSplit() {
-    // Can't split META
-    if (getRegionInfo().isMetaRegion()) {
+    // Can't split ROOT/META
+    if (this.regionInfo.isMetaTable()) {
       if (shouldForceSplit()) {
-        LOG.warn("Cannot split meta regions in HBase 0.20 and above");
+        LOG.warn("Cannot split root/meta regions in HBase 0.20 and above");
       }
       return null;
     }

Modified: hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java?rev=1407726&r1=1407725&r2=1407726&view=diff
==============================================================================
--- hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java (original)
+++ hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java Sat Nov
10 07:53:19 2012
@@ -1383,6 +1383,18 @@ public class TestAdmin {
     assertTrue(("actual count: " + count), count <= 2);
   }
 
+  @Test
+  public void testRootTableSplit() throws Exception {
+    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<HRegion> regions = TEST_UTIL.getMiniHBaseCluster().getRegions(HConstants.ROOT_TABLE_NAME);
+    assertEquals("ROOT region should not be splitted.",1, regions.size());
+  }
+
   private void setUpforLogRolling() {
     // Force a region split after every 768KB
     TEST_UTIL.getConfiguration().setLong("hbase.hregion.max.filesize",



Mime
View raw message