You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by st...@apache.org on 2012/10/28 22:49:20 UTC
svn commit: r1403098 -
/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/backup/example/LongTermArchivingHFileCleaner.java
Author: stack
Date: Sun Oct 28 21:49:19 2012
New Revision: 1403098
URL: http://svn.apache.org/viewvc?rev=1403098&view=rev
Log:
HBASE-6707 TEST org.apache.hadoop.hbase.backup.example.TestZooKeeperTableArchiveClient.testMultipleTables flaps; ADDENDUM v4
Modified:
hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/backup/example/LongTermArchivingHFileCleaner.java
Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/backup/example/LongTermArchivingHFileCleaner.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/backup/example/LongTermArchivingHFileCleaner.java?rev=1403098&r1=1403097&r2=1403098&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/backup/example/LongTermArchivingHFileCleaner.java (original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/backup/example/LongTermArchivingHFileCleaner.java Sun Oct 28 21:49:19 2012
@@ -50,16 +50,14 @@ public class LongTermArchivingHFileClean
@Override
public boolean isFileDeletable(Path file) {
try {
+ // if its a directory, then it can be deleted
+ if (!fs.isFile(file)) return true;
+ // check to see if
FileStatus[] deleteStatus = FSUtils.listStatus(this.fs, file, null);
// if the file doesn't exist, then it can be deleted (but should never
// happen since deleted files shouldn't get passed in)
if (deleteStatus == null) return true;
- // if its a directory with stuff in it, don't delete
- if (deleteStatus.length > 1) return false;
-
- // if its an empty directory, we can definitely delete
- if (deleteStatus[0].isDir()) return true;
// otherwise, we need to check the file's table and see its being archived
Path family = file.getParent();
@@ -67,7 +65,9 @@ public class LongTermArchivingHFileClean
Path table = region.getParent();
String tableName = table.getName();
- return !archiveTracker.keepHFiles(tableName);
+ boolean ret = !archiveTracker.keepHFiles(tableName);
+ LOG.debug("Archiver says to [" + (ret ? "delete" : "keep") + "] files for table:" + tableName);
+ return ret;
} catch (IOException e) {
LOG.error("Failed to lookup status of:" + file + ", keeping it just incase.", e);
return false;