hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r1208007 - in /hbase/branches/0.92: ./ src/main/java/org/apache/hadoop/hbase/ src/main/java/org/apache/hadoop/hbase/master/ src/main/java/org/apache/hadoop/hbase/master/handler/ src/main/java/org/apache/hadoop/hbase/util/ src/test/java/org/...
Date Tue, 29 Nov 2011 18:30:37 GMT
Author: stack
Date: Tue Nov 29 18:30:36 2011
New Revision: 1208007

URL: http://svn.apache.org/viewvc?rev=1208007&view=rev
Log:
HBASE-4889 HRegionInfo.isMetaTable() should be true for -ROOT- regions

Modified:
    hbase/branches/0.92/CHANGES.txt
    hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/HRegionInfo.java
    hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
    hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/master/handler/OpenedRegionHandler.java
    hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java
    hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java
    hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMasterObserver.java
    hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/master/TestDistributedLogSplitting.java
    hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/master/TestOpenedRegionHandler.java
    hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionInfo.java

Modified: hbase/branches/0.92/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/CHANGES.txt?rev=1208007&r1=1208006&r2=1208007&view=diff
==============================================================================
--- hbase/branches/0.92/CHANGES.txt (original)
+++ hbase/branches/0.92/CHANGES.txt Tue Nov 29 18:30:36 2011
@@ -448,6 +448,8 @@ Release 0.92.0 - Unreleased
    HBASE-4855  SplitLogManager hangs on cluster restart due to batch.installed doubly counted
    HBASE-4877  TestHCM failing sporadically on jenkins and always for me on an ubuntu machine
    HBASE-4878  Master crash when splitting hlog may cause data loss (Chunhui Shen)
+   HBASE-4889  HRegionInfo.isMetaTable() should be true for -ROOT- regions
+               (Daniel Gómez Ferro)
 
   TESTS
    HBASE-4492  TestRollingRestart fails intermittently

Modified: hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/HRegionInfo.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/HRegionInfo.java?rev=1208007&r1=1208006&r2=1208007&view=diff
==============================================================================
--- hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/HRegionInfo.java (original)
+++ hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/HRegionInfo.java Tue Nov 29
18:30:36 2011
@@ -600,12 +600,12 @@ implements WritableComparable<HRegionInf
    * either <code>.META.</code> or <code>-ROOT-</code>
    */
   public boolean isMetaTable() {
-    return Bytes.equals(tableName, HRegionInfo.FIRST_META_REGIONINFO.getTableName());
+    return isRootRegion() || isMetaRegion();
   }
 
   /** @return true if this region is a meta region */
   public boolean isMetaRegion() {
-     return isMetaTable();
+     return Bytes.equals(tableName, HRegionInfo.FIRST_META_REGIONINFO.getTableName());
   }
 
   /**

Modified: hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java?rev=1208007&r1=1208006&r2=1208007&view=diff
==============================================================================
--- hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
(original)
+++ hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
Tue Nov 29 18:30:36 2011
@@ -360,8 +360,7 @@ public class AssignmentManager extends Z
     // its a clean cluster startup, else its a failover.
     boolean regionsToProcess = false;
     for (Map.Entry<HRegionInfo, ServerName> e: this.regions.entrySet()) {
-      if (!e.getKey().isMetaRegion()
-          && !e.getKey().isRootRegion()
+      if (!e.getKey().isMetaTable()
           && e.getValue() != null) {
         LOG.debug("Found " + e + " out on cluster");
         regionsToProcess = true;
@@ -489,7 +488,7 @@ public class AssignmentManager extends Z
 
         // Just insert region into RIT
         // If this never updates the timeout will trigger new assignment
-        if (regionInfo.isMetaRegion() || regionInfo.isRootRegion()) {
+        if (regionInfo.isMetaTable()) {
           regionsInTransition.put(encodedRegionName, new RegionState(
               regionInfo, RegionState.State.OPENING, data.getStamp(), data
                   .getOrigin()));
@@ -1514,7 +1513,7 @@ public class AssignmentManager extends Z
   }
 
   private void debugLog(HRegionInfo region, String string) {
-    if (region.isMetaTable() || region.isRootRegion()) {
+    if (region.isMetaTable()) {
       LOG.info(string);
     } else {
       LOG.debug(string);

Modified: hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/master/handler/OpenedRegionHandler.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/master/handler/OpenedRegionHandler.java?rev=1208007&r1=1208006&r2=1208007&view=diff
==============================================================================
--- hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/master/handler/OpenedRegionHandler.java
(original)
+++ hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/master/handler/OpenedRegionHandler.java
Tue Nov 29 18:30:36 2011
@@ -141,7 +141,7 @@ public class OpenedRegionHandler extends
   }
 
   private void debugLog(HRegionInfo region, String string) {
-    if (region.isMetaTable() || region.isRootRegion()) {
+    if (region.isMetaTable()) {
       LOG.info(string);
     } else {
       LOG.debug(string);

Modified: hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java?rev=1208007&r1=1208006&r2=1208007&view=diff
==============================================================================
--- hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java (original)
+++ hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java Tue Nov
29 18:30:36 2011
@@ -1095,7 +1095,7 @@ public class HBaseFsck {
   throws IOException, KeeperException, InterruptedException {
     List <HbckInfo> metaRegions = Lists.newArrayList();
     for (HbckInfo value : regionInfo.values()) {
-      if (value.metaEntry.isMetaTable()) {
+      if (value.metaEntry.isMetaRegion()) {
         metaRegions.add(value);
       }
     }
@@ -1501,7 +1501,7 @@ public class HBaseFsck {
     private List<HRegionInfo> filterOnlyMetaRegions(List<HRegionInfo> regions)
{
       List<HRegionInfo> ret = Lists.newArrayList();
       for (HRegionInfo hri : regions) {
-        if (hri.isMetaRegion() || hri.isRootRegion()) {
+        if (hri.isMetaTable()) {
           ret.add(hri);
         }
       }

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=1208007&r1=1208006&r2=1208007&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 Tue Nov
29 18:30:36 2011
@@ -1093,7 +1093,7 @@ public class TestAdmin {
     HRegionServer rs = TEST_UTIL.getRSForFirstRegionInTable(TABLENAME);
     List<HRegionInfo> onlineRegions = rs.getOnlineRegions();
     for (HRegionInfo regionInfo : onlineRegions) {
-      if (!regionInfo.isMetaRegion() && !regionInfo.isRootRegion()) {
+      if (!regionInfo.isMetaTable()) {
         info = regionInfo;
         admin.closeRegionWithEncodedRegionName(regionInfo.getEncodedName(), rs
             .getServerName().getServerName());
@@ -1114,7 +1114,7 @@ public class TestAdmin {
     HRegionServer rs = TEST_UTIL.getRSForFirstRegionInTable(TABLENAME);
     List<HRegionInfo> onlineRegions = rs.getOnlineRegions();
     for (HRegionInfo regionInfo : onlineRegions) {
-      if (!regionInfo.isMetaRegion() && !regionInfo.isRootRegion()) {
+      if (!regionInfo.isMetaTable()) {
         if (regionInfo.getRegionNameAsString().contains("TestHBACloseRegion1")) {
           info = regionInfo;
           admin.closeRegionWithEncodedRegionName("sample", rs.getServerName()
@@ -1136,7 +1136,7 @@ public class TestAdmin {
     HRegionServer rs = TEST_UTIL.getRSForFirstRegionInTable(TABLENAME);
     List<HRegionInfo> onlineRegions = rs.getOnlineRegions();
     for (HRegionInfo regionInfo : onlineRegions) {
-      if (!regionInfo.isMetaRegion() && !regionInfo.isRootRegion()) {
+      if (!regionInfo.isMetaTable()) {
 
         if (regionInfo.getRegionNameAsString().contains("TestHBACloseRegion2")) {
           info = regionInfo;
@@ -1167,7 +1167,7 @@ public class TestAdmin {
     try {
       List<HRegionInfo> onlineRegions = rs.getOnlineRegions();
       for (HRegionInfo regionInfo : onlineRegions) {
-        if (!regionInfo.isMetaRegion() && !regionInfo.isRootRegion()) {
+        if (!regionInfo.isMetaTable()) {
           if (regionInfo.getRegionNameAsString()
               .contains("TestHBACloseRegion3")) {
             admin.closeRegionWithEncodedRegionName(regionInfo.getEncodedName(),
@@ -1191,7 +1191,7 @@ public class TestAdmin {
     try {
       List<HRegionInfo> onlineRegions = rs.getOnlineRegions();
       for (HRegionInfo regionInfo : onlineRegions) {
-        if (!regionInfo.isMetaRegion() && !regionInfo.isRootRegion()) {
+        if (!regionInfo.isMetaTable()) {
           if (regionInfo.getRegionNameAsString()
               .contains("TestHBACloseRegionWhenServerNameIsEmpty")) {
             admin.closeRegionWithEncodedRegionName(regionInfo.getEncodedName(),
@@ -1214,7 +1214,7 @@ public class TestAdmin {
 
     List<HRegionInfo> onlineRegions = rs.getOnlineRegions();
     for (HRegionInfo regionInfo : onlineRegions) {
-      if (!regionInfo.isMetaRegion() && !regionInfo.isRootRegion()) {
+      if (!regionInfo.isMetaTable()) {
         if (regionInfo.getRegionNameAsString().contains("TestHBACloseRegion4")) {
           info = regionInfo;
           admin.closeRegionWithEncodedRegionName(regionInfo

Modified: hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMasterObserver.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMasterObserver.java?rev=1208007&r1=1208006&r2=1208007&view=diff
==============================================================================
--- hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMasterObserver.java
(original)
+++ hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMasterObserver.java
Tue Nov 29 18:30:36 2011
@@ -693,7 +693,7 @@ public class TestMasterObserver {
     int moveCnt = openRegions.size()/2;
     for (int i=0; i<moveCnt; i++) {
       HRegionInfo info = openRegions.get(i);
-      if (!(info.isMetaRegion() || info.isRootRegion())) {
+      if (!info.isMetaTable()) {
         master.move(openRegions.get(i).getEncodedNameAsBytes(), destRS);
       }
     }

Modified: hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/master/TestDistributedLogSplitting.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/master/TestDistributedLogSplitting.java?rev=1208007&r1=1208006&r2=1208007&view=diff
==============================================================================
--- hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/master/TestDistributedLogSplitting.java
(original)
+++ hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/master/TestDistributedLogSplitting.java
Tue Nov 29 18:30:36 2011
@@ -222,7 +222,7 @@ public class TestDistributedLogSplitting
     Iterator<HRegionInfo> it = regions.iterator();
     while (it.hasNext()) {
       HRegionInfo region = it.next();
-      if (region.isMetaRegion() || region.isRootRegion()) {
+      if (region.isMetaTable()) {
         it.remove();
       }
     }
@@ -342,7 +342,7 @@ public class TestDistributedLogSplitting
       HRegionServer hrs = rst.getRegionServer();
       List<HRegionInfo> hris = hrs.getOnlineRegions();
       for (HRegionInfo hri : hris) {
-        if (hri.isMetaRegion() || hri.isRootRegion()) {
+        if (hri.isMetaTable()) {
           continue;
         }
         LOG.debug("adding data to rs = " + rst.getName() +

Modified: hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/master/TestOpenedRegionHandler.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/master/TestOpenedRegionHandler.java?rev=1208007&r1=1208006&r2=1208007&view=diff
==============================================================================
--- hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/master/TestOpenedRegionHandler.java
(original)
+++ hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/master/TestOpenedRegionHandler.java
Tue Nov 29 18:30:36 2011
@@ -201,8 +201,7 @@ public class TestOpenedRegionHandler {
     HRegion region = null;
     while (iterator.hasNext()) {
       region = iterator.next();
-      if (!region.getRegionInfo().isMetaRegion()
-          && !region.getRegionInfo().isRootRegion()) {
+      if (!region.getRegionInfo().isMetaTable()) {
         break;
       }
     }

Modified: hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionInfo.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionInfo.java?rev=1208007&r1=1208006&r2=1208007&view=diff
==============================================================================
--- hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionInfo.java
(original)
+++ hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionInfo.java
Tue Nov 29 18:30:36 2011
@@ -114,4 +114,10 @@ public class TestHRegionInfo {
     } catch (IllegalArgumentException iae) {
     }
   }
+
+  @Test
+  public void testMetaTables() {
+    assertTrue(HRegionInfo.ROOT_REGIONINFO.isMetaTable());
+    assertTrue(HRegionInfo.FIRST_META_REGIONINFO.isMetaTable());
+  }
 }



Mime
View raw message