From 686e13db2fdb1cb7b8d0cc55a677b25df420156d Mon Sep 17 00:00:00 2001 From: Tsz-wo Sze Date: Mon, 14 Jan 2013 08:40:13 +0000 Subject: [PATCH] HDFS-4395. In INodeDirectorySnapshottable's constructor, the passed-in dir could be an INodeDirectoryWithSnapshot. Contributed by Jing Zhao git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/HDFS-2802@1432838 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-hdfs-project/hadoop-hdfs/CHANGES.HDFS-2802.txt | 3 +++ .../server/namenode/snapshot/INodeDirectorySnapshottable.java | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.HDFS-2802.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.HDFS-2802.txt index 9e9ef3f65c..13aba58e7f 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.HDFS-2802.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.HDFS-2802.txt @@ -104,3 +104,6 @@ Branch-2802 Snapshot (Unreleased) HDFS-4098. Add FileWithLink, INodeFileUnderConstructionWithLink and INodeFileUnderConstructionSnapshot in order to support append to snapshotted files. (szetszwo) + + HDFS-4395. In INodeDirectorySnapshottable's constructor, the passed-in dir + could be an INodeDirectoryWithSnapshot. (Jing Zhao via szetszwo) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/snapshot/INodeDirectorySnapshottable.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/snapshot/INodeDirectorySnapshottable.java index cb9f4b725d..ac90ac4c8e 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/snapshot/INodeDirectorySnapshottable.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/snapshot/INodeDirectorySnapshottable.java @@ -76,7 +76,8 @@ List getSnapshotsByNames() { private int snapshotQuota = SNAPSHOT_LIMIT; public INodeDirectorySnapshottable(INodeDirectory dir) { - super(dir, true, null); + super(dir, true, dir instanceof INodeDirectoryWithSnapshot ? + ((INodeDirectoryWithSnapshot) dir).getSnapshotDiffs() : null); } /** @return the number of existing snapshots. */