|
@@ -17,22 +17,6 @@
|
|
*/
|
|
*/
|
|
package org.apache.hadoop.hdfs.server.namenode.snapshot;
|
|
package org.apache.hadoop.hdfs.server.namenode.snapshot;
|
|
|
|
|
|
-import static org.junit.Assert.assertEquals;
|
|
|
|
-import static org.junit.Assert.assertFalse;
|
|
|
|
-import static org.junit.Assert.assertSame;
|
|
|
|
-import static org.junit.Assert.assertTrue;
|
|
|
|
-import static org.junit.Assert.fail;
|
|
|
|
-import static org.mockito.Matchers.anyBoolean;
|
|
|
|
-import static org.mockito.Matchers.anyObject;
|
|
|
|
-import static org.mockito.Mockito.doReturn;
|
|
|
|
-import static org.mockito.Mockito.spy;
|
|
|
|
-
|
|
|
|
-import java.io.File;
|
|
|
|
-import java.io.IOException;
|
|
|
|
-import java.util.EnumSet;
|
|
|
|
-import java.util.List;
|
|
|
|
-import java.util.Random;
|
|
|
|
-
|
|
|
|
import org.apache.commons.logging.Log;
|
|
import org.apache.commons.logging.Log;
|
|
import org.apache.commons.logging.LogFactory;
|
|
import org.apache.commons.logging.LogFactory;
|
|
import org.apache.hadoop.conf.Configuration;
|
|
import org.apache.hadoop.conf.Configuration;
|
|
@@ -41,12 +25,7 @@ import org.apache.hadoop.fs.FileStatus;
|
|
import org.apache.hadoop.fs.Options.Rename;
|
|
import org.apache.hadoop.fs.Options.Rename;
|
|
import org.apache.hadoop.fs.Path;
|
|
import org.apache.hadoop.fs.Path;
|
|
import org.apache.hadoop.fs.permission.FsPermission;
|
|
import org.apache.hadoop.fs.permission.FsPermission;
|
|
-import org.apache.hadoop.hdfs.DFSConfigKeys;
|
|
|
|
-import org.apache.hadoop.hdfs.DFSOutputStream;
|
|
|
|
-import org.apache.hadoop.hdfs.DFSTestUtil;
|
|
|
|
-import org.apache.hadoop.hdfs.DFSUtil;
|
|
|
|
-import org.apache.hadoop.hdfs.DistributedFileSystem;
|
|
|
|
-import org.apache.hadoop.hdfs.MiniDFSCluster;
|
|
|
|
|
|
+import org.apache.hadoop.hdfs.*;
|
|
import org.apache.hadoop.hdfs.client.HdfsDataOutputStream.SyncFlag;
|
|
import org.apache.hadoop.hdfs.client.HdfsDataOutputStream.SyncFlag;
|
|
import org.apache.hadoop.hdfs.protocol.HdfsConstants;
|
|
import org.apache.hadoop.hdfs.protocol.HdfsConstants;
|
|
import org.apache.hadoop.hdfs.protocol.HdfsConstants.SafeModeAction;
|
|
import org.apache.hadoop.hdfs.protocol.HdfsConstants.SafeModeAction;
|
|
@@ -55,18 +34,10 @@ import org.apache.hadoop.hdfs.protocol.SnapshotDiffReport;
|
|
import org.apache.hadoop.hdfs.protocol.SnapshotDiffReport.DiffReportEntry;
|
|
import org.apache.hadoop.hdfs.protocol.SnapshotDiffReport.DiffReportEntry;
|
|
import org.apache.hadoop.hdfs.protocol.SnapshotDiffReport.DiffType;
|
|
import org.apache.hadoop.hdfs.protocol.SnapshotDiffReport.DiffType;
|
|
import org.apache.hadoop.hdfs.protocol.SnapshottableDirectoryStatus;
|
|
import org.apache.hadoop.hdfs.protocol.SnapshottableDirectoryStatus;
|
|
-import org.apache.hadoop.hdfs.server.namenode.FSDirectory;
|
|
|
|
-import org.apache.hadoop.hdfs.server.namenode.FSNamesystem;
|
|
|
|
-import org.apache.hadoop.hdfs.server.namenode.INode;
|
|
|
|
-import org.apache.hadoop.hdfs.server.namenode.INodeDirectory;
|
|
|
|
-import org.apache.hadoop.hdfs.server.namenode.INodeFile;
|
|
|
|
-import org.apache.hadoop.hdfs.server.namenode.INodeReference;
|
|
|
|
|
|
+import org.apache.hadoop.hdfs.server.namenode.*;
|
|
import org.apache.hadoop.hdfs.server.namenode.INodeReference.WithCount;
|
|
import org.apache.hadoop.hdfs.server.namenode.INodeReference.WithCount;
|
|
-import org.apache.hadoop.hdfs.server.namenode.INodesInPath;
|
|
|
|
-import org.apache.hadoop.hdfs.server.namenode.QuotaCounts;
|
|
|
|
import org.apache.hadoop.hdfs.server.namenode.snapshot.DirectoryWithSnapshotFeature.ChildrenDiff;
|
|
import org.apache.hadoop.hdfs.server.namenode.snapshot.DirectoryWithSnapshotFeature.ChildrenDiff;
|
|
import org.apache.hadoop.hdfs.server.namenode.snapshot.DirectoryWithSnapshotFeature.DirectoryDiff;
|
|
import org.apache.hadoop.hdfs.server.namenode.snapshot.DirectoryWithSnapshotFeature.DirectoryDiff;
|
|
-import org.apache.hadoop.hdfs.util.Diff.ListType;
|
|
|
|
import org.apache.hadoop.hdfs.util.ReadOnlyList;
|
|
import org.apache.hadoop.hdfs.util.ReadOnlyList;
|
|
import org.apache.hadoop.test.GenericTestUtils;
|
|
import org.apache.hadoop.test.GenericTestUtils;
|
|
import org.junit.After;
|
|
import org.junit.After;
|
|
@@ -76,6 +47,18 @@ import org.junit.Test;
|
|
import org.mockito.Mockito;
|
|
import org.mockito.Mockito;
|
|
import org.mockito.internal.util.reflection.Whitebox;
|
|
import org.mockito.internal.util.reflection.Whitebox;
|
|
|
|
|
|
|
|
+import java.io.File;
|
|
|
|
+import java.io.IOException;
|
|
|
|
+import java.util.EnumSet;
|
|
|
|
+import java.util.List;
|
|
|
|
+import java.util.Random;
|
|
|
|
+
|
|
|
|
+import static org.junit.Assert.*;
|
|
|
|
+import static org.mockito.Matchers.anyBoolean;
|
|
|
|
+import static org.mockito.Matchers.anyObject;
|
|
|
|
+import static org.mockito.Mockito.doReturn;
|
|
|
|
+import static org.mockito.Mockito.spy;
|
|
|
|
+
|
|
/** Testing rename with snapshots. */
|
|
/** Testing rename with snapshots. */
|
|
public class TestRenameWithSnapshots {
|
|
public class TestRenameWithSnapshots {
|
|
static {
|
|
static {
|
|
@@ -104,7 +87,11 @@ public class TestRenameWithSnapshots {
|
|
static private final String snap1 = "snap1";
|
|
static private final String snap1 = "snap1";
|
|
static private final String snap2 = "snap2";
|
|
static private final String snap2 = "snap2";
|
|
|
|
|
|
-
|
|
|
|
|
|
+ static void assertSizes(int createdSize, int deletedSize, ChildrenDiff diff) {
|
|
|
|
+ assertEquals(createdSize, diff.getCreatedUnmodifiable().size());
|
|
|
|
+ assertEquals(deletedSize, diff.getDeletedUnmodifiable().size());
|
|
|
|
+ }
|
|
|
|
+
|
|
@Before
|
|
@Before
|
|
public void setUp() throws Exception {
|
|
public void setUp() throws Exception {
|
|
conf.setLong(DFSConfigKeys.DFS_BLOCK_SIZE_KEY, BLOCKSIZE);
|
|
conf.setLong(DFSConfigKeys.DFS_BLOCK_SIZE_KEY, BLOCKSIZE);
|
|
@@ -1301,9 +1288,8 @@ public class TestRenameWithSnapshots {
|
|
// after the undo of rename, both the created and deleted list of sdir1
|
|
// after the undo of rename, both the created and deleted list of sdir1
|
|
// should be empty
|
|
// should be empty
|
|
ChildrenDiff childrenDiff = dir1Diffs.get(0).getChildrenDiff();
|
|
ChildrenDiff childrenDiff = dir1Diffs.get(0).getChildrenDiff();
|
|
- assertEquals(0, childrenDiff.getList(ListType.DELETED).size());
|
|
|
|
- assertEquals(0, childrenDiff.getList(ListType.CREATED).size());
|
|
|
|
-
|
|
|
|
|
|
+ assertSizes(0, 0, childrenDiff);
|
|
|
|
+
|
|
INode fooNode = fsdir.getINode4Write(foo.toString());
|
|
INode fooNode = fsdir.getINode4Write(foo.toString());
|
|
assertTrue(fooNode.isDirectory() && fooNode.asDirectory().isWithSnapshot());
|
|
assertTrue(fooNode.isDirectory() && fooNode.asDirectory().isWithSnapshot());
|
|
DiffList<DirectoryDiff> fooDiffs =
|
|
DiffList<DirectoryDiff> fooDiffs =
|
|
@@ -1372,13 +1358,12 @@ public class TestRenameWithSnapshots {
|
|
// after the undo of rename, the created list of sdir1 should contain
|
|
// after the undo of rename, the created list of sdir1 should contain
|
|
// 1 element
|
|
// 1 element
|
|
ChildrenDiff childrenDiff = dir1Diffs.get(0).getChildrenDiff();
|
|
ChildrenDiff childrenDiff = dir1Diffs.get(0).getChildrenDiff();
|
|
- assertEquals(0, childrenDiff.getList(ListType.DELETED).size());
|
|
|
|
- assertEquals(1, childrenDiff.getList(ListType.CREATED).size());
|
|
|
|
-
|
|
|
|
|
|
+ assertSizes(1, 0, childrenDiff);
|
|
|
|
+
|
|
INode fooNode = fsdir.getINode4Write(foo.toString());
|
|
INode fooNode = fsdir.getINode4Write(foo.toString());
|
|
assertTrue(fooNode instanceof INodeDirectory);
|
|
assertTrue(fooNode instanceof INodeDirectory);
|
|
- assertTrue(childrenDiff.getList(ListType.CREATED).get(0) == fooNode);
|
|
|
|
-
|
|
|
|
|
|
+ assertTrue(childrenDiff.getCreatedUnmodifiable().get(0) == fooNode);
|
|
|
|
+
|
|
final Path foo_s1 = SnapshotTestHelper.getSnapshotPath(sdir1, "s1", "foo");
|
|
final Path foo_s1 = SnapshotTestHelper.getSnapshotPath(sdir1, "s1", "foo");
|
|
assertFalse(hdfs.exists(foo_s1));
|
|
assertFalse(hdfs.exists(foo_s1));
|
|
|
|
|
|
@@ -1438,13 +1423,12 @@ public class TestRenameWithSnapshots {
|
|
assertEquals(1, dir2Diffs.size());
|
|
assertEquals(1, dir2Diffs.size());
|
|
assertEquals(s2.getId(), dir2Diffs.get(0).getSnapshotId());
|
|
assertEquals(s2.getId(), dir2Diffs.get(0).getSnapshotId());
|
|
ChildrenDiff childrenDiff = dir2Diffs.get(0).getChildrenDiff();
|
|
ChildrenDiff childrenDiff = dir2Diffs.get(0).getChildrenDiff();
|
|
- assertEquals(0, childrenDiff.getList(ListType.DELETED).size());
|
|
|
|
- assertEquals(1, childrenDiff.getList(ListType.CREATED).size());
|
|
|
|
|
|
+ assertSizes(1, 0, childrenDiff);
|
|
final Path foo_s2 = SnapshotTestHelper.getSnapshotPath(sdir2, "s2", "foo2");
|
|
final Path foo_s2 = SnapshotTestHelper.getSnapshotPath(sdir2, "s2", "foo2");
|
|
assertFalse(hdfs.exists(foo_s2));
|
|
assertFalse(hdfs.exists(foo_s2));
|
|
|
|
|
|
INode fooNode = fsdir.getINode4Write(foo_dir2.toString());
|
|
INode fooNode = fsdir.getINode4Write(foo_dir2.toString());
|
|
- assertTrue(childrenDiff.getList(ListType.CREATED).get(0) == fooNode);
|
|
|
|
|
|
+ assertTrue(childrenDiff.getCreatedUnmodifiable().get(0) == fooNode);
|
|
assertTrue(fooNode instanceof INodeReference.DstReference);
|
|
assertTrue(fooNode instanceof INodeReference.DstReference);
|
|
DiffList<DirectoryDiff> fooDiffs =
|
|
DiffList<DirectoryDiff> fooDiffs =
|
|
fooNode.asDirectory().getDiffs().asList();
|
|
fooNode.asDirectory().getDiffs().asList();
|
|
@@ -1468,14 +1452,12 @@ public class TestRenameWithSnapshots {
|
|
assertEquals(s3.getId(), dir2Diffs.get(1).getSnapshotId());
|
|
assertEquals(s3.getId(), dir2Diffs.get(1).getSnapshotId());
|
|
|
|
|
|
childrenDiff = dir2Diffs.get(0).getChildrenDiff();
|
|
childrenDiff = dir2Diffs.get(0).getChildrenDiff();
|
|
- assertEquals(0, childrenDiff.getList(ListType.DELETED).size());
|
|
|
|
- assertEquals(1, childrenDiff.getList(ListType.CREATED).size());
|
|
|
|
- assertTrue(childrenDiff.getList(ListType.CREATED).get(0) == fooNode);
|
|
|
|
|
|
+ assertSizes(1, 0, childrenDiff);
|
|
|
|
+ assertTrue(childrenDiff.getCreatedUnmodifiable().get(0) == fooNode);
|
|
|
|
|
|
childrenDiff = dir2Diffs.get(1).getChildrenDiff();
|
|
childrenDiff = dir2Diffs.get(1).getChildrenDiff();
|
|
- assertEquals(0, childrenDiff.getList(ListType.DELETED).size());
|
|
|
|
- assertEquals(0, childrenDiff.getList(ListType.CREATED).size());
|
|
|
|
-
|
|
|
|
|
|
+ assertSizes(0, 0, childrenDiff);
|
|
|
|
+
|
|
final Path foo_s3 = SnapshotTestHelper.getSnapshotPath(sdir2, "s3", "foo2");
|
|
final Path foo_s3 = SnapshotTestHelper.getSnapshotPath(sdir2, "s3", "foo2");
|
|
assertFalse(hdfs.exists(foo_s2));
|
|
assertFalse(hdfs.exists(foo_s2));
|
|
assertTrue(hdfs.exists(foo_s3));
|
|
assertTrue(hdfs.exists(foo_s3));
|
|
@@ -1600,9 +1582,8 @@ public class TestRenameWithSnapshots {
|
|
.getDiffs().asList();
|
|
.getDiffs().asList();
|
|
assertEquals(1, diffList.size());
|
|
assertEquals(1, diffList.size());
|
|
DirectoryDiff diff = diffList.get(0);
|
|
DirectoryDiff diff = diffList.get(0);
|
|
- assertTrue(diff.getChildrenDiff().getList(ListType.CREATED).isEmpty());
|
|
|
|
- assertTrue(diff.getChildrenDiff().getList(ListType.DELETED).isEmpty());
|
|
|
|
-
|
|
|
|
|
|
+ assertSizes(0, 0, diff.getChildrenDiff());
|
|
|
|
+
|
|
// check dir2
|
|
// check dir2
|
|
INodeDirectory dir2Node = fsdir2.getINode4Write(dir2.toString()).asDirectory();
|
|
INodeDirectory dir2Node = fsdir2.getINode4Write(dir2.toString()).asDirectory();
|
|
assertTrue(dir2Node.isSnapshottable());
|
|
assertTrue(dir2Node.isSnapshottable());
|
|
@@ -1618,8 +1599,7 @@ public class TestRenameWithSnapshots {
|
|
diffList = dir2Node.getDiffs().asList();
|
|
diffList = dir2Node.getDiffs().asList();
|
|
assertEquals(1, diffList.size());
|
|
assertEquals(1, diffList.size());
|
|
diff = diffList.get(0);
|
|
diff = diffList.get(0);
|
|
- assertTrue(diff.getChildrenDiff().getList(ListType.CREATED).isEmpty());
|
|
|
|
- assertTrue(diff.getChildrenDiff().getList(ListType.DELETED).isEmpty());
|
|
|
|
|
|
+ assertSizes(0, 0, diff.getChildrenDiff());
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -1674,9 +1654,8 @@ public class TestRenameWithSnapshots {
|
|
.getDiffs().asList();
|
|
.getDiffs().asList();
|
|
assertEquals(1, diffList.size());
|
|
assertEquals(1, diffList.size());
|
|
DirectoryDiff diff = diffList.get(0);
|
|
DirectoryDiff diff = diffList.get(0);
|
|
- assertTrue(diff.getChildrenDiff().getList(ListType.CREATED).isEmpty());
|
|
|
|
- assertTrue(diff.getChildrenDiff().getList(ListType.DELETED).isEmpty());
|
|
|
|
-
|
|
|
|
|
|
+ assertSizes(0, 0, diff.getChildrenDiff());
|
|
|
|
+
|
|
// check dir2
|
|
// check dir2
|
|
INodeDirectory dir2Node = fsdir2.getINode4Write(dir2.toString()).asDirectory();
|
|
INodeDirectory dir2Node = fsdir2.getINode4Write(dir2.toString()).asDirectory();
|
|
assertTrue(dir2Node.isSnapshottable());
|
|
assertTrue(dir2Node.isSnapshottable());
|
|
@@ -1696,8 +1675,7 @@ public class TestRenameWithSnapshots {
|
|
diffList = ( dir2Node).getDiffs().asList();
|
|
diffList = ( dir2Node).getDiffs().asList();
|
|
assertEquals(1, diffList.size());
|
|
assertEquals(1, diffList.size());
|
|
diff = diffList.get(0);
|
|
diff = diffList.get(0);
|
|
- assertTrue(diff.getChildrenDiff().getList(ListType.CREATED).isEmpty());
|
|
|
|
- assertTrue(diff.getChildrenDiff().getList(ListType.DELETED).isEmpty());
|
|
|
|
|
|
+ assertSizes(0, 0, diff.getChildrenDiff());
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -1737,9 +1715,8 @@ public class TestRenameWithSnapshots {
|
|
Snapshot s1 = rootNode.getSnapshot(DFSUtil.string2Bytes(snap1));
|
|
Snapshot s1 = rootNode.getSnapshot(DFSUtil.string2Bytes(snap1));
|
|
assertEquals(s1.getId(), diff.getSnapshotId());
|
|
assertEquals(s1.getId(), diff.getSnapshotId());
|
|
// after undo, the diff should be empty
|
|
// after undo, the diff should be empty
|
|
- assertTrue(diff.getChildrenDiff().getList(ListType.DELETED).isEmpty());
|
|
|
|
- assertTrue(diff.getChildrenDiff().getList(ListType.CREATED).isEmpty());
|
|
|
|
-
|
|
|
|
|
|
+ assertSizes(0, 0, diff.getChildrenDiff());
|
|
|
|
+
|
|
// bar was converted to filewithsnapshot while renaming
|
|
// bar was converted to filewithsnapshot while renaming
|
|
INodeFile barNode = fsdir.getINode4Write(bar.toString()).asFile();
|
|
INodeFile barNode = fsdir.getINode4Write(bar.toString()).asFile();
|
|
assertSame(barNode, children.get(0));
|
|
assertSame(barNode, children.get(0));
|
|
@@ -1989,9 +1966,8 @@ public class TestRenameWithSnapshots {
|
|
Snapshot s1 = dir1Node.getSnapshot(DFSUtil.string2Bytes("s1"));
|
|
Snapshot s1 = dir1Node.getSnapshot(DFSUtil.string2Bytes("s1"));
|
|
assertEquals(s1.getId(), diffList.get(0).getSnapshotId());
|
|
assertEquals(s1.getId(), diffList.get(0).getSnapshotId());
|
|
ChildrenDiff diff = diffList.get(0).getChildrenDiff();
|
|
ChildrenDiff diff = diffList.get(0).getChildrenDiff();
|
|
- assertEquals(0, diff.getList(ListType.CREATED).size());
|
|
|
|
- assertEquals(0, diff.getList(ListType.DELETED).size());
|
|
|
|
-
|
|
|
|
|
|
+ assertSizes(0, 0, diff);
|
|
|
|
+
|
|
restartClusterAndCheckImage(true);
|
|
restartClusterAndCheckImage(true);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -2062,9 +2038,8 @@ public class TestRenameWithSnapshots {
|
|
assertEquals(s1.getId(), diffList.get(0).getSnapshotId());
|
|
assertEquals(s1.getId(), diffList.get(0).getSnapshotId());
|
|
ChildrenDiff diff = diffList.get(0).getChildrenDiff();
|
|
ChildrenDiff diff = diffList.get(0).getChildrenDiff();
|
|
// bar2 and bar3 in the created list
|
|
// bar2 and bar3 in the created list
|
|
- assertEquals(2, diff.getList(ListType.CREATED).size());
|
|
|
|
- assertEquals(0, diff.getList(ListType.DELETED).size());
|
|
|
|
-
|
|
|
|
|
|
+ assertSizes(2, 0, diff);
|
|
|
|
+
|
|
final INode fooRef2 = fsdir.getINode4Write(foo.toString());
|
|
final INode fooRef2 = fsdir.getINode4Write(foo.toString());
|
|
assertTrue(fooRef2 instanceof INodeReference.DstReference);
|
|
assertTrue(fooRef2 instanceof INodeReference.DstReference);
|
|
INodeReference.WithCount wc2 =
|
|
INodeReference.WithCount wc2 =
|
|
@@ -2235,13 +2210,9 @@ public class TestRenameWithSnapshots {
|
|
.asDirectory();
|
|
.asDirectory();
|
|
DiffList<DirectoryDiff> dir1DiffList = dir1Node.getDiffs().asList();
|
|
DiffList<DirectoryDiff> dir1DiffList = dir1Node.getDiffs().asList();
|
|
assertEquals(1, dir1DiffList.size());
|
|
assertEquals(1, dir1DiffList.size());
|
|
- List<INode> dList = dir1DiffList.get(0).getChildrenDiff()
|
|
|
|
- .getList(ListType.DELETED);
|
|
|
|
- assertTrue(dList.isEmpty());
|
|
|
|
- List<INode> cList = dir1DiffList.get(0).getChildrenDiff()
|
|
|
|
- .getList(ListType.CREATED);
|
|
|
|
- assertEquals(1, cList.size());
|
|
|
|
- INode cNode = cList.get(0);
|
|
|
|
|
|
+ final ChildrenDiff childrenDiff = dir1DiffList.get(0).getChildrenDiff();
|
|
|
|
+ assertSizes(1, 0, childrenDiff);
|
|
|
|
+ INode cNode = childrenDiff.getCreatedUnmodifiable().get(0);
|
|
INode fooNode = fsdir.getINode4Write(newfoo.toString());
|
|
INode fooNode = fsdir.getINode4Write(newfoo.toString());
|
|
assertSame(cNode, fooNode);
|
|
assertSame(cNode, fooNode);
|
|
|
|
|
|
@@ -2259,7 +2230,7 @@ public class TestRenameWithSnapshots {
|
|
Snapshot s0 = testNode.getSnapshot(DFSUtil.string2Bytes("s0"));
|
|
Snapshot s0 = testNode.getSnapshot(DFSUtil.string2Bytes("s0"));
|
|
assertEquals(s0.getId(), diff.getSnapshotId());
|
|
assertEquals(s0.getId(), diff.getSnapshotId());
|
|
// and file should be stored in the deleted list of this snapshot diff
|
|
// and file should be stored in the deleted list of this snapshot diff
|
|
- assertEquals("file", diff.getChildrenDiff().getList(ListType.DELETED)
|
|
|
|
|
|
+ assertEquals("file", diff.getChildrenDiff().getDeletedUnmodifiable()
|
|
.get(0).getLocalName());
|
|
.get(0).getLocalName());
|
|
|
|
|
|
// check dir2: a WithName instance for foo should be in the deleted list
|
|
// check dir2: a WithName instance for foo should be in the deleted list
|
|
@@ -2269,7 +2240,8 @@ public class TestRenameWithSnapshots {
|
|
DiffList<DirectoryDiff> dir2DiffList = dir2Node.getDiffs().asList();
|
|
DiffList<DirectoryDiff> dir2DiffList = dir2Node.getDiffs().asList();
|
|
// dir2Node should contain 1 snapshot diffs for s2
|
|
// dir2Node should contain 1 snapshot diffs for s2
|
|
assertEquals(1, dir2DiffList.size());
|
|
assertEquals(1, dir2DiffList.size());
|
|
- dList = dir2DiffList.get(0).getChildrenDiff().getList(ListType.DELETED);
|
|
|
|
|
|
+ final List<INode> dList = dir2DiffList.get(0).getChildrenDiff()
|
|
|
|
+ .getDeletedUnmodifiable();
|
|
assertEquals(1, dList.size());
|
|
assertEquals(1, dList.size());
|
|
final Path foo_s2 = SnapshotTestHelper.getSnapshotPath(dir2, "s2",
|
|
final Path foo_s2 = SnapshotTestHelper.getSnapshotPath(dir2, "s2",
|
|
foo.getName());
|
|
foo.getName());
|
|
@@ -2323,8 +2295,7 @@ public class TestRenameWithSnapshots {
|
|
DiffList<DirectoryDiff> diffList = barNode.getDiffs().asList();
|
|
DiffList<DirectoryDiff> diffList = barNode.getDiffs().asList();
|
|
assertEquals(1, diffList.size());
|
|
assertEquals(1, diffList.size());
|
|
DirectoryDiff diff = diffList.get(0);
|
|
DirectoryDiff diff = diffList.get(0);
|
|
- assertEquals(0, diff.getChildrenDiff().getList(ListType.DELETED).size());
|
|
|
|
- assertEquals(0, diff.getChildrenDiff().getList(ListType.CREATED).size());
|
|
|
|
|
|
+ assertSizes(0, 0, diff.getChildrenDiff());
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|