HDFS-4579. Annotate snapshot tests. Contributed by Arpit Agarwal.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/HDFS-2802@1454748 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
82230367ba
commit
d32fb8a62b
@ -188,3 +188,5 @@ Branch-2802 Snapshot (Unreleased)
|
|||||||
|
|
||||||
HDFS-4557. Fix FSDirectory#delete when INode#cleanSubtree returns 0.
|
HDFS-4557. Fix FSDirectory#delete when INode#cleanSubtree returns 0.
|
||||||
(Jing Zhao via szetszwo)
|
(Jing Zhao via szetszwo)
|
||||||
|
|
||||||
|
HDFS-4579. Annotate snapshot tests. (Arpit Agarwal via suresh)
|
||||||
|
@ -168,7 +168,7 @@ private void loadFSImageFromTempFile(File imageFile) throws IOException {
|
|||||||
* 6. Dump the FSDirectory again and compare the two dumped string.
|
* 6. Dump the FSDirectory again and compare the two dumped string.
|
||||||
* </pre>
|
* </pre>
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test (timeout=60000)
|
||||||
public void testSaveLoadImage() throws Exception {
|
public void testSaveLoadImage() throws Exception {
|
||||||
int s = 0;
|
int s = 0;
|
||||||
// make changes to the namesystem
|
// make changes to the namesystem
|
||||||
@ -255,7 +255,7 @@ void checkImage(int s) throws IOException {
|
|||||||
/**
|
/**
|
||||||
* Test the fsimage saving/loading while file appending.
|
* Test the fsimage saving/loading while file appending.
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test (timeout=60000)
|
||||||
public void testSaveLoadImageWithAppending() throws Exception {
|
public void testSaveLoadImageWithAppending() throws Exception {
|
||||||
Path sub1 = new Path(dir, "sub1");
|
Path sub1 = new Path(dir, "sub1");
|
||||||
Path sub1file1 = new Path(sub1, "sub1file1");
|
Path sub1file1 = new Path(sub1, "sub1file1");
|
||||||
|
@ -80,7 +80,7 @@ static public void tearDown() throws Exception {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Test allow-snapshot operation. */
|
/** Test allow-snapshot operation. */
|
||||||
@Test
|
@Test (timeout=15000)
|
||||||
public void testAllowSnapshot() throws Exception {
|
public void testAllowSnapshot() throws Exception {
|
||||||
final String path = sub1.toString();
|
final String path = sub1.toString();
|
||||||
final INode before = fsdir.getINode(path);
|
final INode before = fsdir.getINode(path);
|
||||||
@ -134,7 +134,7 @@ static void assertINodeFile(INode inode, Path path) {
|
|||||||
* Test {@link INodeDirectory#getExistingPathINodes(byte[][], int, boolean)}
|
* Test {@link INodeDirectory#getExistingPathINodes(byte[][], int, boolean)}
|
||||||
* for normal (non-snapshot) file.
|
* for normal (non-snapshot) file.
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test (timeout=15000)
|
||||||
public void testNonSnapshotPathINodes() throws Exception {
|
public void testNonSnapshotPathINodes() throws Exception {
|
||||||
// Get the inodes by resolving the path of a normal file
|
// Get the inodes by resolving the path of a normal file
|
||||||
String[] names = INode.getPathNames(file1.toString());
|
String[] names = INode.getPathNames(file1.toString());
|
||||||
@ -179,7 +179,7 @@ public void testNonSnapshotPathINodes() throws Exception {
|
|||||||
* Test {@link INodeDirectory#getExistingPathINodes(byte[][], int, boolean)}
|
* Test {@link INodeDirectory#getExistingPathINodes(byte[][], int, boolean)}
|
||||||
* for snapshot file.
|
* for snapshot file.
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test (timeout=15000)
|
||||||
public void testSnapshotPathINodes() throws Exception {
|
public void testSnapshotPathINodes() throws Exception {
|
||||||
// Create a snapshot for the dir, and check the inodes for the path
|
// Create a snapshot for the dir, and check the inodes for the path
|
||||||
// pointing to a snapshot file
|
// pointing to a snapshot file
|
||||||
@ -247,7 +247,7 @@ public void testSnapshotPathINodes() throws Exception {
|
|||||||
* Test {@link INodeDirectory#getExistingPathINodes(byte[][], int, boolean)}
|
* Test {@link INodeDirectory#getExistingPathINodes(byte[][], int, boolean)}
|
||||||
* for snapshot file after deleting the original file.
|
* for snapshot file after deleting the original file.
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test (timeout=15000)
|
||||||
public void testSnapshotPathINodesAfterDeletion() throws Exception {
|
public void testSnapshotPathINodesAfterDeletion() throws Exception {
|
||||||
// Create a snapshot for the dir, and check the inodes for the path
|
// Create a snapshot for the dir, and check the inodes for the path
|
||||||
// pointing to a snapshot file
|
// pointing to a snapshot file
|
||||||
@ -308,7 +308,7 @@ public void testSnapshotPathINodesAfterDeletion() throws Exception {
|
|||||||
* Test {@link INodeDirectory#getExistingPathINodes(byte[][], int, boolean)}
|
* Test {@link INodeDirectory#getExistingPathINodes(byte[][], int, boolean)}
|
||||||
* for snapshot file while adding a new file after snapshot.
|
* for snapshot file while adding a new file after snapshot.
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test (timeout=15000)
|
||||||
public void testSnapshotPathINodesWithAddedFile() throws Exception {
|
public void testSnapshotPathINodesWithAddedFile() throws Exception {
|
||||||
// Create a snapshot for the dir, and check the inodes for the path
|
// Create a snapshot for the dir, and check the inodes for the path
|
||||||
// pointing to a snapshot file
|
// pointing to a snapshot file
|
||||||
@ -367,7 +367,7 @@ public void testSnapshotPathINodesWithAddedFile() throws Exception {
|
|||||||
* Test {@link INodeDirectory#getExistingPathINodes(byte[][], int, boolean)}
|
* Test {@link INodeDirectory#getExistingPathINodes(byte[][], int, boolean)}
|
||||||
* for snapshot file while modifying file after snapshot.
|
* for snapshot file while modifying file after snapshot.
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test (timeout=15000)
|
||||||
public void testSnapshotPathINodesAfterModification() throws Exception {
|
public void testSnapshotPathINodesAfterModification() throws Exception {
|
||||||
//file1 was deleted, create it again.
|
//file1 was deleted, create it again.
|
||||||
DFSTestUtil.createFile(hdfs, file1, 1024, REPLICATION, seed);
|
DFSTestUtil.createFile(hdfs, file1, 1024, REPLICATION, seed);
|
||||||
|
@ -79,22 +79,22 @@ public static void tearDown() throws Exception {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expected = SnapshotAccessControlException.class)
|
@Test(timeout=60000, expected = SnapshotAccessControlException.class)
|
||||||
public void testSetReplication() throws Exception {
|
public void testSetReplication() throws Exception {
|
||||||
fs.setReplication(objInSnapshot, (short) 1);
|
fs.setReplication(objInSnapshot, (short) 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expected = SnapshotAccessControlException.class)
|
@Test(timeout=60000, expected = SnapshotAccessControlException.class)
|
||||||
public void testSetPermission() throws Exception {
|
public void testSetPermission() throws Exception {
|
||||||
fs.setPermission(objInSnapshot, new FsPermission("777"));
|
fs.setPermission(objInSnapshot, new FsPermission("777"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expected = SnapshotAccessControlException.class)
|
@Test(timeout=60000, expected = SnapshotAccessControlException.class)
|
||||||
public void testSetOwner() throws Exception {
|
public void testSetOwner() throws Exception {
|
||||||
fs.setOwner(objInSnapshot, "username", "groupname");
|
fs.setOwner(objInSnapshot, "username", "groupname");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=60000)
|
||||||
public void testRename() throws Exception {
|
public void testRename() throws Exception {
|
||||||
try {
|
try {
|
||||||
fs.rename(objInSnapshot, new Path("/invalid/path"));
|
fs.rename(objInSnapshot, new Path("/invalid/path"));
|
||||||
@ -112,39 +112,39 @@ public void testRename() throws Exception {
|
|||||||
} catch (SnapshotAccessControlException e) { /* Ignored */ }
|
} catch (SnapshotAccessControlException e) { /* Ignored */ }
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expected = SnapshotAccessControlException.class)
|
@Test(timeout=60000, expected = SnapshotAccessControlException.class)
|
||||||
public void testDelete() throws Exception {
|
public void testDelete() throws Exception {
|
||||||
fs.delete(objInSnapshot, true);
|
fs.delete(objInSnapshot, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expected = SnapshotAccessControlException.class)
|
@Test(timeout=60000, expected = SnapshotAccessControlException.class)
|
||||||
public void testQuota() throws Exception {
|
public void testQuota() throws Exception {
|
||||||
fs.setQuota(objInSnapshot, 100, 100);
|
fs.setQuota(objInSnapshot, 100, 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expected = SnapshotAccessControlException.class)
|
@Test(timeout=60000, expected = SnapshotAccessControlException.class)
|
||||||
public void testSetTime() throws Exception {
|
public void testSetTime() throws Exception {
|
||||||
fs.setTimes(objInSnapshot, 100, 100);
|
fs.setTimes(objInSnapshot, 100, 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expected = SnapshotAccessControlException.class)
|
@Test(timeout=60000, expected = SnapshotAccessControlException.class)
|
||||||
public void testCreate() throws Exception {
|
public void testCreate() throws Exception {
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
DFSClient dfsclient = new DFSClient(conf);
|
DFSClient dfsclient = new DFSClient(conf);
|
||||||
dfsclient.create(objInSnapshot.toString(), true);
|
dfsclient.create(objInSnapshot.toString(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expected = SnapshotAccessControlException.class)
|
@Test(timeout=60000, expected = SnapshotAccessControlException.class)
|
||||||
public void testAppend() throws Exception {
|
public void testAppend() throws Exception {
|
||||||
fs.append(objInSnapshot, 65535, null);
|
fs.append(objInSnapshot, 65535, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expected = SnapshotAccessControlException.class)
|
@Test(timeout=60000, expected = SnapshotAccessControlException.class)
|
||||||
public void testMkdir() throws Exception {
|
public void testMkdir() throws Exception {
|
||||||
fs.mkdirs(objInSnapshot, new FsPermission("777"));
|
fs.mkdirs(objInSnapshot, new FsPermission("777"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expected = SnapshotAccessControlException.class)
|
@Test(timeout=60000, expected = SnapshotAccessControlException.class)
|
||||||
public void testCreateSymlink() throws Exception {
|
public void testCreateSymlink() throws Exception {
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
DFSClient dfsclient = new DFSClient(conf);
|
DFSClient dfsclient = new DFSClient(conf);
|
||||||
|
@ -88,7 +88,7 @@ public void tearDown() throws Exception {
|
|||||||
/**
|
/**
|
||||||
* Test snapshot after file appending
|
* Test snapshot after file appending
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test (timeout=60000)
|
||||||
public void testSnapshotAfterAppending() throws Exception {
|
public void testSnapshotAfterAppending() throws Exception {
|
||||||
Path file = new Path(dir, "file");
|
Path file = new Path(dir, "file");
|
||||||
// 1. create snapshot --> create file --> append
|
// 1. create snapshot --> create file --> append
|
||||||
@ -132,7 +132,7 @@ private HdfsDataOutputStream appendFileWithoutClosing(Path file, int length)
|
|||||||
* Test snapshot during file appending, before the corresponding
|
* Test snapshot during file appending, before the corresponding
|
||||||
* {@link FSDataOutputStream} instance closes.
|
* {@link FSDataOutputStream} instance closes.
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test (timeout=60000)
|
||||||
public void testSnapshotWhileAppending() throws Exception {
|
public void testSnapshotWhileAppending() throws Exception {
|
||||||
Path file = new Path(dir, "file");
|
Path file = new Path(dir, "file");
|
||||||
DFSTestUtil.createFile(hdfs, file, BLOCKSIZE, REPLICATION, seed);
|
DFSTestUtil.createFile(hdfs, file, BLOCKSIZE, REPLICATION, seed);
|
||||||
|
@ -81,7 +81,7 @@ public static void tearDown() throws Exception {
|
|||||||
* snapshots and the files created after the snapshots should not appear in
|
* snapshots and the files created after the snapshots should not appear in
|
||||||
* any of the snapshots.
|
* any of the snapshots.
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test (timeout=300000)
|
||||||
public void testNestedSnapshots() throws Exception {
|
public void testNestedSnapshots() throws Exception {
|
||||||
final Path foo = new Path("/testNestedSnapshots/foo");
|
final Path foo = new Path("/testNestedSnapshots/foo");
|
||||||
final Path bar = new Path(foo, "bar");
|
final Path bar = new Path(foo, "bar");
|
||||||
@ -130,7 +130,7 @@ private static void assertFile(Path s1, Path s2, Path file,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=300000)
|
||||||
public void testSnapshotLimit() throws Exception {
|
public void testSnapshotLimit() throws Exception {
|
||||||
final int step = 1000;
|
final int step = 1000;
|
||||||
final String dirStr = "/testSnapshotLimit/dir";
|
final String dirStr = "/testSnapshotLimit/dir";
|
||||||
@ -168,7 +168,7 @@ public void testSnapshotLimit() throws Exception {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=300000)
|
||||||
public void testSnapshotWithQuota() throws Exception {
|
public void testSnapshotWithQuota() throws Exception {
|
||||||
final String dirStr = "/testSnapshotWithQuota/dir";
|
final String dirStr = "/testSnapshotWithQuota/dir";
|
||||||
final Path dir = new Path(dirStr);
|
final Path dir = new Path(dirStr);
|
||||||
@ -230,7 +230,7 @@ public void testSnapshotWithQuota() throws Exception {
|
|||||||
/**
|
/**
|
||||||
* Test {@link Snapshot#ID_COMPARATOR}.
|
* Test {@link Snapshot#ID_COMPARATOR}.
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test (timeout=300000)
|
||||||
public void testIdCmp() {
|
public void testIdCmp() {
|
||||||
final PermissionStatus perm = PermissionStatus.createImmutable(
|
final PermissionStatus perm = PermissionStatus.createImmutable(
|
||||||
"user", "group", FsPermission.createImmutable((short)0));
|
"user", "group", FsPermission.createImmutable((short)0));
|
||||||
|
@ -214,7 +214,7 @@ private void checkFSImage() throws Exception {
|
|||||||
* -> Check previous snapshots -----------------+
|
* -> Check previous snapshots -----------------+
|
||||||
* </pre>
|
* </pre>
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test (timeout=300000)
|
||||||
public void testSnapshot() throws Throwable {
|
public void testSnapshot() throws Throwable {
|
||||||
try {
|
try {
|
||||||
runTestSnapshot();
|
runTestSnapshot();
|
||||||
@ -266,7 +266,7 @@ private void runTestSnapshot() throws Exception {
|
|||||||
* A simple test that updates a sub-directory of a snapshottable directory
|
* A simple test that updates a sub-directory of a snapshottable directory
|
||||||
* with snapshots
|
* with snapshots
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test (timeout=300000)
|
||||||
public void testUpdateDirectory() throws Exception {
|
public void testUpdateDirectory() throws Exception {
|
||||||
Path dir = new Path("/dir");
|
Path dir = new Path("/dir");
|
||||||
Path sub = new Path(dir, "sub");
|
Path sub = new Path(dir, "sub");
|
||||||
@ -292,7 +292,7 @@ public void testUpdateDirectory() throws Exception {
|
|||||||
* TODO: Listing/Deleting snapshots for a directory that is not snapshottable
|
* TODO: Listing/Deleting snapshots for a directory that is not snapshottable
|
||||||
* should also fail.
|
* should also fail.
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test (timeout=300000)
|
||||||
public void testSnapshottableDirectory() throws Exception {
|
public void testSnapshottableDirectory() throws Exception {
|
||||||
Path dir = new Path("/TestSnapshot/sub");
|
Path dir = new Path("/TestSnapshot/sub");
|
||||||
Path file0 = new Path(dir, "file0");
|
Path file0 = new Path(dir, "file0");
|
||||||
|
@ -120,7 +120,7 @@ void assertBlockCollection(final INodeFile file, final BlockInfo b) {
|
|||||||
* Test deleting a file with snapshots. Need to check the blocksMap to make
|
* Test deleting a file with snapshots. Need to check the blocksMap to make
|
||||||
* sure the corresponding record is updated correctly.
|
* sure the corresponding record is updated correctly.
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test (timeout=60000)
|
||||||
public void testDeletionWithSnapshots() throws Exception {
|
public void testDeletionWithSnapshots() throws Exception {
|
||||||
Path file0 = new Path(sub1, "file0");
|
Path file0 = new Path(sub1, "file0");
|
||||||
Path file1 = new Path(sub1, "file1");
|
Path file1 = new Path(sub1, "file1");
|
||||||
|
@ -93,7 +93,7 @@ public void tearDown() throws Exception {
|
|||||||
/**
|
/**
|
||||||
* Deleting snapshottable directory with snapshots must fail.
|
* Deleting snapshottable directory with snapshots must fail.
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test (timeout=300000)
|
||||||
public void testDeleteDirectoryWithSnapshot() throws Exception {
|
public void testDeleteDirectoryWithSnapshot() throws Exception {
|
||||||
Path file0 = new Path(sub, "file0");
|
Path file0 = new Path(sub, "file0");
|
||||||
Path file1 = new Path(sub, "file1");
|
Path file1 = new Path(sub, "file1");
|
||||||
@ -116,7 +116,7 @@ public void testDeleteDirectoryWithSnapshot() throws Exception {
|
|||||||
/**
|
/**
|
||||||
* Deleting directory with snapshottable descendant with snapshots must fail.
|
* Deleting directory with snapshottable descendant with snapshots must fail.
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test (timeout=300000)
|
||||||
public void testDeleteDirectoryWithSnapshot2() throws Exception {
|
public void testDeleteDirectoryWithSnapshot2() throws Exception {
|
||||||
Path file0 = new Path(sub, "file0");
|
Path file0 = new Path(sub, "file0");
|
||||||
Path file1 = new Path(sub, "file1");
|
Path file1 = new Path(sub, "file1");
|
||||||
@ -153,7 +153,7 @@ public void testDeleteDirectoryWithSnapshot2() throws Exception {
|
|||||||
* 4. Delete current INodeDirectoryWithSnapshot.
|
* 4. Delete current INodeDirectoryWithSnapshot.
|
||||||
* </pre>
|
* </pre>
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test (timeout=300000)
|
||||||
public void testDeleteCurrentFileDirectory() throws Exception {
|
public void testDeleteCurrentFileDirectory() throws Exception {
|
||||||
// create a folder which will be deleted before taking snapshots
|
// create a folder which will be deleted before taking snapshots
|
||||||
Path deleteDir = new Path(subsub, "deleteDir");
|
Path deleteDir = new Path(subsub, "deleteDir");
|
||||||
@ -276,7 +276,7 @@ public void testDeleteCurrentFileDirectory() throws Exception {
|
|||||||
* snapshots are taken on the same directory, and we do not need to combine
|
* snapshots are taken on the same directory, and we do not need to combine
|
||||||
* snapshot diffs.
|
* snapshot diffs.
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test (timeout=300000)
|
||||||
public void testDeleteEarliestSnapshot1() throws Exception {
|
public void testDeleteEarliestSnapshot1() throws Exception {
|
||||||
// create files under sub
|
// create files under sub
|
||||||
Path file0 = new Path(sub, "file0");
|
Path file0 = new Path(sub, "file0");
|
||||||
@ -343,7 +343,7 @@ public void testDeleteEarliestSnapshot1() throws Exception {
|
|||||||
* Also, the recursive cleanTree process should cover both INodeFile and
|
* Also, the recursive cleanTree process should cover both INodeFile and
|
||||||
* INodeDirectory.
|
* INodeDirectory.
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test (timeout=300000)
|
||||||
public void testDeleteEarliestSnapshot2() throws Exception {
|
public void testDeleteEarliestSnapshot2() throws Exception {
|
||||||
Path noChangeDir = new Path(sub, "noChangeDir");
|
Path noChangeDir = new Path(sub, "noChangeDir");
|
||||||
Path noChangeFile = new Path(noChangeDir, "noChangeFile");
|
Path noChangeFile = new Path(noChangeDir, "noChangeFile");
|
||||||
@ -421,7 +421,7 @@ public void testDeleteEarliestSnapshot2() throws Exception {
|
|||||||
* Test deleting snapshots in a more complicated scenario: need to combine
|
* Test deleting snapshots in a more complicated scenario: need to combine
|
||||||
* snapshot diffs, but no need to handle diffs distributed in a dir tree
|
* snapshot diffs, but no need to handle diffs distributed in a dir tree
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test (timeout=300000)
|
||||||
public void testCombineSnapshotDiff1() throws Exception {
|
public void testCombineSnapshotDiff1() throws Exception {
|
||||||
testCombineSnapshotDiffImpl(sub, "");
|
testCombineSnapshotDiffImpl(sub, "");
|
||||||
}
|
}
|
||||||
@ -430,7 +430,7 @@ public void testCombineSnapshotDiff1() throws Exception {
|
|||||||
* Test deleting snapshots in more complicated scenarios (snapshot diffs are
|
* Test deleting snapshots in more complicated scenarios (snapshot diffs are
|
||||||
* distributed in the directory sub-tree)
|
* distributed in the directory sub-tree)
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test (timeout=300000)
|
||||||
public void testCombineSnapshotDiff2() throws Exception {
|
public void testCombineSnapshotDiff2() throws Exception {
|
||||||
testCombineSnapshotDiffImpl(sub, "subsub1/subsubsub1/");
|
testCombineSnapshotDiffImpl(sub, "subsub1/subsubsub1/");
|
||||||
}
|
}
|
||||||
@ -536,7 +536,7 @@ private void testCombineSnapshotDiffImpl(Path snapshotRoot, String modDirStr)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Test deleting snapshots with modification on the metadata of directory */
|
/** Test deleting snapshots with modification on the metadata of directory */
|
||||||
@Test
|
@Test (timeout=300000)
|
||||||
public void testDeleteSnapshotWithDirModification() throws Exception {
|
public void testDeleteSnapshotWithDirModification() throws Exception {
|
||||||
Path file = new Path(sub, "file");
|
Path file = new Path(sub, "file");
|
||||||
DFSTestUtil.createFile(hdfs, file, BLOCKSIZE, REPLICATION, seed);
|
DFSTestUtil.createFile(hdfs, file, BLOCKSIZE, REPLICATION, seed);
|
||||||
@ -574,7 +574,7 @@ public void testDeleteSnapshotWithDirModification() throws Exception {
|
|||||||
* A test covering the case where the snapshot diff to be deleted is renamed
|
* A test covering the case where the snapshot diff to be deleted is renamed
|
||||||
* to its previous snapshot.
|
* to its previous snapshot.
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test (timeout=300000)
|
||||||
public void testRenameSnapshotDiff() throws Exception {
|
public void testRenameSnapshotDiff() throws Exception {
|
||||||
final Path subFile0 = new Path(sub, "file0");
|
final Path subFile0 = new Path(sub, "file0");
|
||||||
final Path subsubFile0 = new Path(subsub, "file0");
|
final Path subsubFile0 = new Path(subsub, "file0");
|
||||||
|
@ -169,7 +169,7 @@ private void verifyDiffReport(Path dir, String from, String to,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Test the computation and representation of diff between snapshots */
|
/** Test the computation and representation of diff between snapshots */
|
||||||
@Test
|
@Test (timeout=60000)
|
||||||
public void testDiffReport() throws Exception {
|
public void testDiffReport() throws Exception {
|
||||||
Path subsub1 = new Path(sub1, "subsub1");
|
Path subsub1 = new Path(sub1, "subsub1");
|
||||||
Path subsubsub1 = new Path(subsub1, "subsubsub1");
|
Path subsubsub1 = new Path(subsub1, "subsubsub1");
|
||||||
@ -261,7 +261,7 @@ public void testDiffReport() throws Exception {
|
|||||||
* sure the diff report computation correctly retrieve the diff from the
|
* sure the diff report computation correctly retrieve the diff from the
|
||||||
* deleted sub-directory.
|
* deleted sub-directory.
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test (timeout=60000)
|
||||||
public void testDiffReport2() throws Exception {
|
public void testDiffReport2() throws Exception {
|
||||||
Path subsub1 = new Path(sub1, "subsub1");
|
Path subsub1 = new Path(sub1, "subsub1");
|
||||||
Path subsubsub1 = new Path(subsub1, "subsubsub1");
|
Path subsubsub1 = new Path(subsub1, "subsubsub1");
|
||||||
|
@ -67,7 +67,7 @@ public void tearDown() throws Exception {
|
|||||||
/**
|
/**
|
||||||
* Test listing snapshots under a snapshottable directory
|
* Test listing snapshots under a snapshottable directory
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test (timeout=15000)
|
||||||
public void testListSnapshots() throws Exception {
|
public void testListSnapshots() throws Exception {
|
||||||
final Path snapshotsPath = new Path(dir, ".snapshot");
|
final Path snapshotsPath = new Path(dir, ".snapshot");
|
||||||
FileStatus[] stats = null;
|
FileStatus[] stats = null;
|
||||||
|
@ -102,7 +102,7 @@ private void checkSnapshotList(INodeDirectorySnapshottable srcRoot,
|
|||||||
* Rename snapshot(s), and check the correctness of the snapshot list within
|
* Rename snapshot(s), and check the correctness of the snapshot list within
|
||||||
* {@link INodeDirectorySnapshottable}
|
* {@link INodeDirectorySnapshottable}
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test (timeout=60000)
|
||||||
public void testSnapshotList() throws Exception {
|
public void testSnapshotList() throws Exception {
|
||||||
DFSTestUtil.createFile(hdfs, file1, BLOCKSIZE, REPLICATION, seed);
|
DFSTestUtil.createFile(hdfs, file1, BLOCKSIZE, REPLICATION, seed);
|
||||||
// Create three snapshots for sub1
|
// Create three snapshots for sub1
|
||||||
@ -132,7 +132,7 @@ public void testSnapshotList() throws Exception {
|
|||||||
/**
|
/**
|
||||||
* Test FileStatus of snapshot file before/after rename
|
* Test FileStatus of snapshot file before/after rename
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test (timeout=60000)
|
||||||
public void testSnapshotRename() throws Exception {
|
public void testSnapshotRename() throws Exception {
|
||||||
DFSTestUtil.createFile(hdfs, file1, BLOCKSIZE, REPLICATION, seed);
|
DFSTestUtil.createFile(hdfs, file1, BLOCKSIZE, REPLICATION, seed);
|
||||||
// Create snapshot for sub1
|
// Create snapshot for sub1
|
||||||
@ -161,7 +161,7 @@ public void testSnapshotRename() throws Exception {
|
|||||||
/**
|
/**
|
||||||
* Test rename a non-existing snapshot
|
* Test rename a non-existing snapshot
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test (timeout=60000)
|
||||||
public void testRenameNonExistingSnapshot() throws Exception {
|
public void testRenameNonExistingSnapshot() throws Exception {
|
||||||
DFSTestUtil.createFile(hdfs, file1, BLOCKSIZE, REPLICATION, seed);
|
DFSTestUtil.createFile(hdfs, file1, BLOCKSIZE, REPLICATION, seed);
|
||||||
// Create snapshot for sub1
|
// Create snapshot for sub1
|
||||||
@ -177,7 +177,7 @@ public void testRenameNonExistingSnapshot() throws Exception {
|
|||||||
/**
|
/**
|
||||||
* Test rename a snapshot to another existing snapshot
|
* Test rename a snapshot to another existing snapshot
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test (timeout=60000)
|
||||||
public void testRenameToExistingSnapshot() throws Exception {
|
public void testRenameToExistingSnapshot() throws Exception {
|
||||||
DFSTestUtil.createFile(hdfs, file1, BLOCKSIZE, REPLICATION, seed);
|
DFSTestUtil.createFile(hdfs, file1, BLOCKSIZE, REPLICATION, seed);
|
||||||
// Create snapshots for sub1
|
// Create snapshots for sub1
|
||||||
|
@ -104,7 +104,7 @@ private void checkFileReplication(Path file, short replication,
|
|||||||
/**
|
/**
|
||||||
* Test replication number calculation for a normal file without snapshots.
|
* Test replication number calculation for a normal file without snapshots.
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test (timeout=60000)
|
||||||
public void testReplicationWithoutSnapshot() throws Exception {
|
public void testReplicationWithoutSnapshot() throws Exception {
|
||||||
// Create file1, set its replication to REPLICATION
|
// Create file1, set its replication to REPLICATION
|
||||||
DFSTestUtil.createFile(hdfs, file1, BLOCKSIZE, REPLICATION, seed);
|
DFSTestUtil.createFile(hdfs, file1, BLOCKSIZE, REPLICATION, seed);
|
||||||
@ -157,7 +157,7 @@ private void checkSnapshotFileReplication(Path currentFile,
|
|||||||
/**
|
/**
|
||||||
* Test replication number calculation for a file with snapshots.
|
* Test replication number calculation for a file with snapshots.
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test (timeout=60000)
|
||||||
public void testReplicationWithSnapshot() throws Exception {
|
public void testReplicationWithSnapshot() throws Exception {
|
||||||
short fileRep = 1;
|
short fileRep = 1;
|
||||||
// Create file1, set its replication to 1
|
// Create file1, set its replication to 1
|
||||||
@ -198,7 +198,7 @@ public void testReplicationWithSnapshot() throws Exception {
|
|||||||
* Test replication for a file with snapshots, also including the scenario
|
* Test replication for a file with snapshots, also including the scenario
|
||||||
* where the original file is deleted
|
* where the original file is deleted
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test (timeout=60000)
|
||||||
public void testReplicationAfterDeletion() throws Exception {
|
public void testReplicationAfterDeletion() throws Exception {
|
||||||
// Create file1, set its replication to 3
|
// Create file1, set its replication to 3
|
||||||
DFSTestUtil.createFile(hdfs, file1, BLOCKSIZE, REPLICATION, seed);
|
DFSTestUtil.createFile(hdfs, file1, BLOCKSIZE, REPLICATION, seed);
|
||||||
|
@ -73,7 +73,7 @@ public void tearDown() throws Exception {
|
|||||||
/**
|
/**
|
||||||
* Test listing all the snapshottable directories
|
* Test listing all the snapshottable directories
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test (timeout=60000)
|
||||||
public void testListSnapshottableDir() throws Exception {
|
public void testListSnapshottableDir() throws Exception {
|
||||||
// Initially there is no snapshottable directories in the system
|
// Initially there is no snapshottable directories in the system
|
||||||
SnapshottableDirectoryStatus[] dirs = hdfs.getSnapshottableDirListing();
|
SnapshottableDirectoryStatus[] dirs = hdfs.getSnapshottableDirListing();
|
||||||
@ -156,7 +156,7 @@ public void testListSnapshottableDir() throws Exception {
|
|||||||
* Test the listing with different user names to make sure only directories
|
* Test the listing with different user names to make sure only directories
|
||||||
* that are owned by the user are listed.
|
* that are owned by the user are listed.
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test (timeout=60000)
|
||||||
public void testListWithDifferentUser() throws Exception {
|
public void testListWithDifferentUser() throws Exception {
|
||||||
// first make dir1 and dir2 snapshottable
|
// first make dir1 and dir2 snapshottable
|
||||||
hdfs.allowSnapshot(dir1.toString());
|
hdfs.allowSnapshot(dir1.toString());
|
||||||
|
Loading…
Reference in New Issue
Block a user