hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajeshb...@apache.org
Subject svn commit: r1574585 - in /hbase/branches/0.98/hbase-server/src: main/java/org/apache/hadoop/hbase/util/HBaseFsck.java test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java
Date Wed, 05 Mar 2014 17:36:40 GMT
Author: rajeshbabu
Date: Wed Mar  5 17:36:39 2014
New Revision: 1574585

URL: http://svn.apache.org/r1574585
Log:
HBASE-10677 boundaries check in hbck throwing IllegalArgumentException(Rajesh)

Modified:
    hbase/branches/0.98/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java
    hbase/branches/0.98/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java

Modified: hbase/branches/0.98/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.98/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java?rev=1574585&r1=1574584&r2=1574585&view=diff
==============================================================================
--- hbase/branches/0.98/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java
(original)
+++ hbase/branches/0.98/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java
Wed Mar  5 17:36:39 2014
@@ -530,13 +530,13 @@ public class HBaseFsck extends Configure
       List<HRegionInfo> regions = MetaScanner.listAllRegions(getConf(), false);
       final RegionBoundariesInformation currentRegionBoundariesInformation =
           new RegionBoundariesInformation();
+      Path hbaseRoot = FSUtils.getRootDir(getConf());
       for (HRegionInfo regionInfo : regions) {
+        Path tableDir = FSUtils.getTableDir(hbaseRoot, regionInfo.getTable());
         currentRegionBoundariesInformation.regionName = regionInfo.getRegionName();
         // For each region, get the start and stop key from the META and compare them to
the
         // same information from the Stores.
-        Path path = new Path(getConf().get(HConstants.HBASE_DIR) + "/"
-            + Bytes.toString(regionInfo.getTable().getName()) + "/"
-            + regionInfo.getEncodedName() + "/");
+        Path path = new Path(tableDir, regionInfo.getEncodedName());
         FileSystem fs = path.getFileSystem(getConf());
         FileStatus[] files = fs.listStatus(path);
         // For all the column families in this region...

Modified: hbase/branches/0.98/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.98/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java?rev=1574585&r1=1574584&r2=1574585&view=diff
==============================================================================
--- hbase/branches/0.98/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java
(original)
+++ hbase/branches/0.98/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java
Wed Mar  5 17:36:39 2014
@@ -2249,6 +2249,19 @@ public class TestHBaseFsck {
     }
   }
 
+  @Test
+  public void testRegionBoundariesCheck() throws Exception {
+    HBaseFsck hbck = doFsck(conf, false);
+    assertNoErrors(hbck); // no errors
+    try {
+      hbck.checkRegionBoundaries();
+    } catch (IllegalArgumentException e) {
+      if (e.getMessage().endsWith("not a valid DFS filename.")) {
+        fail("Table directory path is not valid." + e.getMessage());
+      }
+    }
+  }
+
   @org.junit.Rule
   public TestName name = new TestName();
 }



Mime
View raw message