You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by GitBox <gi...@apache.org> on 2019/08/08 00:06:30 UTC

[GitHub] [hbase] infraio commented on a change in pull request #461: HBASE-22807 HBCK Report showed wrong orphans regions on FileSystem

infraio commented on a change in pull request #461: HBASE-22807 HBCK Report showed wrong orphans regions on FileSystem
URL: https://github.com/apache/hbase/pull/461#discussion_r311810719
 
 

 ##########
 File path: hbase-server/src/main/java/org/apache/hadoop/hbase/master/HbckChore.java
 ##########
 @@ -191,27 +194,24 @@ private void loadRegionsFromFS() throws IOException {
     Path rootDir = master.getMasterFileSystem().getRootDir();
     FileSystem fs = master.getMasterFileSystem().getFileSystem();
 
-    // list all tables from HDFS
-    List<FileStatus> tableDirs = Lists.newArrayList();
-    List<Path> paths = FSUtils.getTableDirs(fs, rootDir);
-    for (Path path : paths) {
-      tableDirs.add(fs.getFileStatus(path));
-    }
-
-    for (FileStatus tableDir : tableDirs) {
-      FileStatus[] regionDirs = fs.listStatus(tableDir.getPath());
-      for (FileStatus regionDir : regionDirs) {
-        String encodedRegionName = regionDir.getPath().getName();
+    int numRegions = 0;
+    List<Path> tableDirs = FSUtils.getTableDirs(fs, rootDir);
+    for (Path tableDir : tableDirs) {
+      List<Path> regionDirs = FSUtils.getRegionDirs(fs, tableDir);
+      for (Path regionDir : regionDirs) {
+        String encodedRegionName = regionDir.getName();
         HbckRegionInfo hri = regionInfoMap.get(encodedRegionName);
         if (hri == null) {
           orphanRegionsOnFS.add(encodedRegionName);
           continue;
         }
-        HbckRegionInfo.HdfsEntry hdfsEntry =
 
 Review comment:
   Let me try it.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services