From afaec5f52d1abf889cfb091d29119fbd191d9a99 Mon Sep 17 00:00:00 2001 From: Suresh Srinivas Date: Tue, 16 Jul 2013 06:33:40 +0000 Subject: [PATCH] HDFS-4903. Print trash configuration and trash emptier state in namenode log. Contributed by Arpit Agarwal. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1503570 13f79535-47bb-0310-9956-ffa450edef68 --- .../main/java/org/apache/hadoop/fs/TrashPolicyDefault.java | 7 +++++-- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 3 +++ .../org/apache/hadoop/hdfs/server/namenode/NameNode.java | 2 +- .../server/namenode/ha/TestStateTransitionFailure.java | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) 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 c35c8dff66e..a8f49c243f4 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 @@ -89,8 +89,11 @@ public class TrashPolicyDefault extends TrashPolicy { this.emptierInterval = (long)(conf.getFloat( FS_TRASH_CHECKPOINT_INTERVAL_KEY, FS_TRASH_CHECKPOINT_INTERVAL_DEFAULT) * MSECS_PER_MINUTE); - } - + LOG.info("Namenode trash configuration: Deletion interval = " + + this.deletionInterval + " minutes, Emptier interval = " + + this.emptierInterval + " minutes."); + } + private Path makeTrashRelativePath(Path basePath, Path rmFilePath) { return Path.mergePaths(basePath, rmFilePath); } diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 75eb62f1295..b204a95657b 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -440,6 +440,9 @@ Release 2.1.0-beta - 2013-07-02 HDFS-4912. Cleanup FSNamesystem#startFileInternal. (suresh) + HDFS-4903. Print trash configuration and trash emptier state in + namenode log. (Arpit Agarwal via suresh) + OPTIMIZATIONS HDFS-4465. Optimize datanode ReplicasMap and ReplicaInfo. (atm) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNode.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNode.java index 08f73b29fa6..32a6b6ee29b 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNode.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNode.java @@ -559,7 +559,7 @@ public class NameNode { if (trashInterval == 0) { return; } else if (trashInterval < 0) { - throw new IOException("Cannot start tresh emptier with negative interval." + throw new IOException("Cannot start trash emptier with negative interval." + " Set " + FS_TRASH_INTERVAL_KEY + " to a positive value."); } diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestStateTransitionFailure.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestStateTransitionFailure.java index 46f70dd47df..d3e5cf27d0f 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestStateTransitionFailure.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestStateTransitionFailure.java @@ -57,7 +57,7 @@ public class TestStateTransitionFailure { fail("Transitioned to active but should not have been able to."); } catch (ExitException ee) { assertExceptionContains( - "Cannot start tresh emptier with negative interval", ee); + "Cannot start trash emptier with negative interval", ee); } } finally { if (cluster != null) {