adoroszlai commented on code in PR #5334:
URL: https://github.com/apache/ozone/pull/5334#discussion_r1332621752
##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFileSystem.java:
##########
@@ -951,65 +951,10 @@ public void testListStatusIteratorOnRoot() throws
Exception {
}
}
- /**
- * Tests listStatusIterator operation on root directory with different
- * numbers of numDir.
- */
@Test
public void testListStatusIteratorOnPageSize() throws Exception {
- int[] pageSize = {
- 1, LISTING_PAGE_SIZE, LISTING_PAGE_SIZE + 1,
- LISTING_PAGE_SIZE - 1, LISTING_PAGE_SIZE + LISTING_PAGE_SIZE / 2,
- LISTING_PAGE_SIZE + LISTING_PAGE_SIZE
- };
- for (int numDir : pageSize) {
- int range = numDir / LISTING_PAGE_SIZE;
- switch (range) {
- case 0:
- listStatusIterator(numDir);
- break;
- case 1:
- listStatusIterator(numDir);
- break;
- case 2:
- listStatusIterator(numDir);
- break;
- default:
- listStatusIterator(numDir);
- }
- }
- }
-
- private void listStatusIterator(int numDirs) throws IOException {
- Path root = new Path("/" + volumeName + "/" + bucketName);
- Set<String> paths = new TreeSet<>();
- try {
- for (int i = 0; i < numDirs; i++) {
- Path p = new Path(root, String.valueOf(i));
- fs.mkdirs(p);
- paths.add(p.getName());
- }
-
- RemoteIterator<FileStatus> iterator = o3fs.listStatusIterator(root);
- int iCount = 0;
- if (iterator != null) {
- while (iterator.hasNext()) {
- FileStatus fileStatus = iterator.next();
- iCount++;
- Assert.assertTrue(paths.contains(fileStatus.getPath().getName()));
- }
- }
- Assert.assertEquals(
- "Total directories listed do not match the existing directories",
- numDirs, iCount);
-
- } finally {
- // Cleanup
- for (int i = 0; i < numDirs; i++) {
- Path p = new Path(root, String.valueOf(i));
- fs.delete(p, true);
- }
- }
+ OzoneFileSystemTests.listStatusIteratorOnPageSize(cluster.getConf(),
+ "/" + volumeName + "/" + bucketName);
Review Comment:
I think it matches previous behavior:
https://github.com/apache/ozone/blob/2dd528c9e2c51e831a76f987d1eef332e3135bad/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFileSystem.java#L983-L984
The only change is adding an extra level (`listStatusIterator` dir) to be
able to recursively delete it at the end.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]