hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r1067332 - in /hbase/branches/0.90: CHANGES.txt src/main/java/org/apache/hadoop/hbase/master/LogCleaner.java src/test/java/org/apache/hadoop/hbase/master/TestLogsCleaner.java
Date Fri, 04 Feb 2011 23:04:11 GMT
Author: stack
Date: Fri Feb  4 23:04:11 2011
New Revision: 1067332

URL: http://svn.apache.org/viewvc?rev=1067332&view=rev
Log:
HBASE-3501 Remove the deletion limit in LogCleaner

Modified:
    hbase/branches/0.90/CHANGES.txt
    hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/master/LogCleaner.java
    hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/master/TestLogsCleaner.java

Modified: hbase/branches/0.90/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/CHANGES.txt?rev=1067332&r1=1067331&r2=1067332&view=diff
==============================================================================
--- hbase/branches/0.90/CHANGES.txt (original)
+++ hbase/branches/0.90/CHANGES.txt Fri Feb  4 23:04:11 2011
@@ -19,6 +19,7 @@ Release 0.90.1 - Unreleased
    HBASE-3495  Shell is failing on subsequent split calls
    HBASE-3502  Can't open region because can't open .regioninfo because
                AlreadyBeingCreatedException
+   HBASE-3501  Remove the deletion limit in LogCleaner
 
 
   IMPROVEMENTS

Modified: hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/master/LogCleaner.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/master/LogCleaner.java?rev=1067332&r1=1067331&r2=1067332&view=diff
==============================================================================
--- hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/master/LogCleaner.java (original)
+++ hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/master/LogCleaner.java Fri Feb
 4 23:04:11 2011
@@ -37,16 +37,12 @@ import org.apache.hadoop.hbase.regionser
 import static org.apache.hadoop.hbase.HConstants.HBASE_MASTER_LOGCLEANER_PLUGINS;
 
 /**
- * This Chore, everytime it runs, will clear the wal logs in the old logs folder
- * that are deletable for each log cleaner in the chain, in order to limit the
- * number of deletes it sends, will only delete maximum 20 in a single run.
+ * This Chore, everytime it runs, will clear the HLogs in the old logs folder
+ * that are deletable for each log cleaner in the chain.
  */
 public class LogCleaner extends Chore {
   static final Log LOG = LogFactory.getLog(LogCleaner.class.getName());
 
-  // Max number we can delete on every chore, this is to make sure we don't
-  // issue thousands of delete commands around the same time
-  private final int maxDeletedLogs;
   private final FileSystem fs;
   private final Path oldLogDir;
   private List<LogCleanerDelegate> logCleanersChain;
@@ -64,9 +60,6 @@ public class LogCleaner extends Chore {
                         Configuration conf, FileSystem fs,
                         Path oldLogDir) {
     super("LogsCleaner", p, s);
-
-    this.maxDeletedLogs =
-        conf.getInt("hbase.master.logcleaner.maxdeletedlogs", 20);
     this.fs = fs;
     this.oldLogDir = oldLogDir;
     this.conf = conf;
@@ -127,7 +120,6 @@ public class LogCleaner extends Chore {
     try {
       FileStatus [] files = this.fs.listStatus(this.oldLogDir);
       if (files == null) return;
-      int nbDeletedLog = 0;
       FILE: for (FileStatus file : files) {
         Path filePath = file.getPath();
         if (HLog.validateHLogFilename(filePath.getName())) {
@@ -144,15 +136,10 @@ public class LogCleaner extends Chore {
           }
           // delete this log file if it passes all the log cleaners
           this.fs.delete(filePath, true);
-          nbDeletedLog++;
         } else {
           LOG.warn("Found a wrongly formated file: "
               + file.getPath().getName());
           this.fs.delete(filePath, true);
-          nbDeletedLog++;
-        }
-        if (nbDeletedLog >= maxDeletedLogs) {
-          break;
         }
       }
     } catch (IOException e) {

Modified: hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/master/TestLogsCleaner.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/master/TestLogsCleaner.java?rev=1067332&r1=1067331&r2=1067332&view=diff
==============================================================================
--- hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/master/TestLogsCleaner.java
(original)
+++ hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/master/TestLogsCleaner.java
Fri Feb  4 23:04:11 2011
@@ -112,13 +112,6 @@ public class TestLogsCleaner {
 
     assertEquals(34, fs.listStatus(oldLogDir).length);
 
-    // This will take care of 20 old log files (default max we can delete)
-    cleaner.chore();
-
-    assertEquals(14, fs.listStatus(oldLogDir).length);
-
-    // We will delete all remaining log files which are not scheduled for
-    // replication and those that are invalid
     cleaner.chore();
 
     // We end up with the current log file, a newer one and the 3 old log



Mime
View raw message