You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by jx...@apache.org on 2013/01/16 17:26:12 UTC
svn commit: r1434021 - in
/hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase: HConstants.java
util/FSUtils.java
Author: jxiang
Date: Wed Jan 16 16:26:11 2013
New Revision: 1434021
URL: http://svn.apache.org/viewvc?rev=1434021&view=rev
Log:
HBASE-7575 FSUtils#getTableStoreFilePathMap should all ignore non-table folders
Modified:
hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/HConstants.java
hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/util/FSUtils.java
Modified: hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/HConstants.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/HConstants.java?rev=1434021&r1=1434020&r2=1434021&view=diff
==============================================================================
--- hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/HConstants.java (original)
+++ hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/HConstants.java Wed Jan 16 16:26:11 2013
@@ -19,12 +19,13 @@
*/
package org.apache.hadoop.hbase;
-import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collections;
import java.util.List;
import java.util.UUID;
import java.util.regex.Pattern;
+import org.apache.commons.lang.ArrayUtils;
import org.apache.hadoop.hbase.ipc.HRegionInterface;
import org.apache.hadoop.hbase.util.Bytes;
@@ -670,10 +671,17 @@ public final class HConstants {
/** Directory under /hbase where archived hfiles are stored */
public static final String HFILE_ARCHIVE_DIRECTORY = ".archive";
- public static final List<String> HBASE_NON_USER_TABLE_DIRS = new ArrayList<String>(
- Arrays.asList(new String[] { HREGION_LOGDIR_NAME, HREGION_OLDLOGDIR_NAME, CORRUPT_DIR_NAME,
- Bytes.toString(META_TABLE_NAME), Bytes.toString(ROOT_TABLE_NAME), SPLIT_LOGDIR_NAME,
- HBCK_SIDELINEDIR_NAME, HFILE_ARCHIVE_DIRECTORY }));
+ /** Directories that are not HBase table directories */
+ public static final List<String> HBASE_NON_TABLE_DIRS =
+ Collections.unmodifiableList(Arrays.asList(new String[] { HREGION_LOGDIR_NAME,
+ HREGION_OLDLOGDIR_NAME, CORRUPT_DIR_NAME, SPLIT_LOGDIR_NAME,
+ HBCK_SIDELINEDIR_NAME, HFILE_ARCHIVE_DIRECTORY }));
+
+ /** 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[] { Bytes.toString(META_TABLE_NAME), Bytes.toString(ROOT_TABLE_NAME) },
+ HBASE_NON_TABLE_DIRS.toArray())));
/** Health script related settings. */
public static final String HEALTH_SCRIPT_LOC = "hbase.node.health.script.location";
Modified: hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/util/FSUtils.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/util/FSUtils.java?rev=1434021&r1=1434020&r2=1434021&view=diff
==============================================================================
--- hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/util/FSUtils.java (original)
+++ hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/util/FSUtils.java Wed Jan 16 16:26:11 2013
@@ -1096,11 +1096,11 @@ public abstract class FSUtils {
// presumes any directory under hbase.rootdir is a table
FileStatus [] tableDirs = fs.listStatus(hbaseRootDir, df);
for (FileStatus tableDir : tableDirs) {
- // Skip the .log directory. All others should be tables. Inside a table,
- // there are compaction.dir directories to skip. Otherwise, all else
+ // Skip the .log and other non-table directories. All others should be tables.
+ // Inside a table, there are compaction.dir directories to skip. Otherwise, all else
// should be regions.
Path d = tableDir.getPath();
- if (d.getName().equals(HConstants.HREGION_LOGDIR_NAME)) {
+ if (HConstants.HBASE_NON_TABLE_DIRS.contains(d.getName())) {
continue;
}
FileStatus[] regionDirs = fs.listStatus(d, df);