hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ha...@apache.org
Subject hadoop git commit: HADOOP-12352. Delay in checkpointing Trash can leave trash for 2 intervals before deleting. Contributed by Casey Brotherton.
Date Tue, 25 Aug 2015 05:52:32 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2 387076894 -> e99349830


HADOOP-12352. Delay in checkpointing Trash can leave trash for 2 intervals before deleting.
Contributed by Casey Brotherton.

(cherry picked from commit af78767870b8296886c03f8be24cf13a4e2bd4b0)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/e9934983
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/e9934983
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/e9934983

Branch: refs/heads/branch-2
Commit: e9934983027bc3cd7cd82e49c436c66f507b4cd2
Parents: 3870768
Author: Harsh J <harsh@cloudera.com>
Authored: Tue Aug 25 11:21:19 2015 +0530
Committer: Harsh J <harsh@cloudera.com>
Committed: Tue Aug 25 11:22:08 2015 +0530

----------------------------------------------------------------------
 hadoop-common-project/hadoop-common/CHANGES.txt          |  3 +++
 .../java/org/apache/hadoop/fs/TrashPolicyDefault.java    | 11 +++++++++--
 2 files changed, 12 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/e9934983/hadoop-common-project/hadoop-common/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt
index 6c27abe..15ec117 100644
--- a/hadoop-common-project/hadoop-common/CHANGES.txt
+++ b/hadoop-common-project/hadoop-common/CHANGES.txt
@@ -286,6 +286,9 @@ Release 2.8.0 - UNRELEASED
 
   BUG FIXES
 
+    HADOOP-12352. Delay in checkpointing Trash can leave trash for 2 intervals
+    before deleting (Casey Brotherton via harsh)
+
     HADOOP-11802: DomainSocketWatcher thread terminates sometimes after there
     is an I/O error during requestShortCircuitShm (cmccabe)
 

http://git-wip-us.apache.org/repos/asf/hadoop/blob/e9934983/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/TrashPolicyDefault.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/TrashPolicyDefault.java
b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/TrashPolicyDefault.java
index 88aeab5..1ed8a46 100644
--- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/TrashPolicyDefault.java
+++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/TrashPolicyDefault.java
@@ -161,12 +161,19 @@ public class TrashPolicyDefault extends TrashPolicy {
   @SuppressWarnings("deprecation")
   @Override
   public void createCheckpoint() throws IOException {
+    createCheckpoint(new Date());
+  }
+
+  @SuppressWarnings("deprecation")
+  public void createCheckpoint(Date date) throws IOException {
+
     if (!fs.exists(current))                     // no trash, no checkpoint
       return;
 
     Path checkpointBase;
     synchronized (CHECKPOINT) {
-      checkpointBase = new Path(trash, CHECKPOINT.format(new Date()));
+      checkpointBase = new Path(trash, CHECKPOINT.format(date));
+
     }
     Path checkpoint = checkpointBase;
 
@@ -287,7 +294,7 @@ public class TrashPolicyDefault extends TrashPolicy {
                 TrashPolicyDefault trash = new TrashPolicyDefault(
                     fs, home.getPath(), conf);
                 trash.deleteCheckpoint();
-                trash.createCheckpoint();
+                trash.createCheckpoint(new Date(now));
               } catch (IOException e) {
                 LOG.warn("Trash caught: "+e+". Skipping "+home.getPath()+".");
               } 


Mime
View raw message