HADOOP-14594. ITestS3AFileOperationCost::testFakeDirectoryDeletion to uncomment metric assertions. Contributed by Mingliang Liu
This commit is contained in:
parent
94e39c6c4e
commit
bc4dfe9c9c
@ -199,21 +199,20 @@ public void testFakeDirectoryDeletion() throws Throwable {
|
|||||||
new MetricDiff(fs, Statistic.DIRECTORIES_CREATED);
|
new MetricDiff(fs, Statistic.DIRECTORIES_CREATED);
|
||||||
|
|
||||||
Path srcDir = new Path(srcBaseDir, "1/2/3/4/5/6");
|
Path srcDir = new Path(srcBaseDir, "1/2/3/4/5/6");
|
||||||
Path srcFilePath = new Path(srcDir, "source.txt");
|
|
||||||
int srcDirDepth = directoriesInPath(srcDir);
|
int srcDirDepth = directoriesInPath(srcDir);
|
||||||
// one dir created, one removed
|
// one dir created, one removed
|
||||||
mkdirs(srcDir);
|
mkdirs(srcDir);
|
||||||
String state = "after mkdir(srcDir)";
|
String state = "after mkdir(srcDir)";
|
||||||
directoriesCreated.assertDiffEquals(state, 1);
|
directoriesCreated.assertDiffEquals(state, 1);
|
||||||
/* TODO: uncomment once HADOOP-13222 is in
|
|
||||||
deleteRequests.assertDiffEquals(state, 1);
|
deleteRequests.assertDiffEquals(state, 1);
|
||||||
directoriesDeleted.assertDiffEquals(state, 0);
|
directoriesDeleted.assertDiffEquals(state, 0);
|
||||||
fakeDirectoriesDeleted.assertDiffEquals(state, srcDirDepth);
|
// HADOOP-14255 deletes unnecessary fake directory objects in mkdirs()
|
||||||
*/
|
fakeDirectoriesDeleted.assertDiffEquals(state, srcDirDepth - 1);
|
||||||
reset(deleteRequests, directoriesCreated, directoriesDeleted,
|
reset(deleteRequests, directoriesCreated, directoriesDeleted,
|
||||||
fakeDirectoriesDeleted);
|
fakeDirectoriesDeleted);
|
||||||
|
|
||||||
// creating a file should trigger demise of the src dir
|
// creating a file should trigger demise of the src dir
|
||||||
|
final Path srcFilePath = new Path(srcDir, "source.txt");
|
||||||
touch(fs, srcFilePath);
|
touch(fs, srcFilePath);
|
||||||
state = "after touch(fs, srcFilePath)";
|
state = "after touch(fs, srcFilePath)";
|
||||||
deleteRequests.assertDiffEquals(state, 1);
|
deleteRequests.assertDiffEquals(state, 1);
|
||||||
@ -232,12 +231,9 @@ public void testFakeDirectoryDeletion() throws Throwable {
|
|||||||
|
|
||||||
int destDirDepth = directoriesInPath(destDir);
|
int destDirDepth = directoriesInPath(destDir);
|
||||||
directoriesCreated.assertDiffEquals(state, 1);
|
directoriesCreated.assertDiffEquals(state, 1);
|
||||||
/* TODO: uncomment once HADOOP-13222 "s3a.mkdirs() to delete empty fake parent directories"
|
deleteRequests.assertDiffEquals(state, 1);
|
||||||
is in
|
directoriesDeleted.assertDiffEquals(state, 0);
|
||||||
deleteRequests.assertDiffEquals(state,1);
|
fakeDirectoriesDeleted.assertDiffEquals(state, destDirDepth - 1);
|
||||||
directoriesDeleted.assertDiffEquals(state,0);
|
|
||||||
fakeDirectoriesDeleted.assertDiffEquals(state,destDirDepth);
|
|
||||||
*/
|
|
||||||
reset(deleteRequests, directoriesCreated, directoriesDeleted,
|
reset(deleteRequests, directoriesCreated, directoriesDeleted,
|
||||||
fakeDirectoriesDeleted);
|
fakeDirectoriesDeleted);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user