echonesis commented on code in PR #11408:
URL: https://github.com/apache/ozone/pull/11408#discussion_r4393452296
##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestListKeysWithFSO.java:
##########
@@ -529,6 +530,29 @@ public void testShallowListKeys() throws Exception {
checkKeyShallowList(keyPrefix, startKey, expectedKeys, fsoOzoneBucket);
}
+ @Test
+ void testShallowListKeysAtBucketRoot() throws Exception {
+ OzoneBucket bucket = DataTestUtil.createVolumeAndBucket(client,
BucketLayout.FILE_SYSTEM_OPTIMIZED);
+ checkKeyShallowList("", null, Collections.emptyList(), bucket);
+ bucket.createDirectory("a");
+ checkKeyShallowList("", null, Collections.singletonList("a/"), bucket);
+
+ List<String> files = Arrays.asList("b0", "b1", "b2", "b3", "b4");
+ createAndAssertKeys(bucket, files);
+ List<String> expected = new ArrayList<>();
+ expected.add("a/");
+ expected.addAll(files);
+ checkKeyShallowList("", null, expected, bucket);
Review Comment:
nit: Could we also create a key under `a/`, such as `a/child`, and verify
that the root shallow listing still returns only `a/` and the root-level files?
This would help cover the new path with a non-empty directory and confirm that
nested keys are excluded.
--
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]