peterxcli commented on code in PR #7817:
URL: https://github.com/apache/ozone/pull/7817#discussion_r1947709405
##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestOzoneClientMultipartUploadWithFSO.java:
##########
@@ -856,6 +864,70 @@ public void testListMultipartUpload() throws Exception {
assertEquals(0, expectedList.size());
}
+ @Test
+ public void testListMultipartUploadsPagination() throws Exception {
+ int numOfKeys = 25;
+ List<String> keys = new ArrayList<>();
+ Map<String, String> keyToUploadId = new HashMap<>();
+
+ // Generate keys
+ for (int i = 0; i < numOfKeys; i++) {
+ StringBuilder key = new StringBuilder();
+ int depth = 1 + i % 3; // Creates varying depth (1-3 levels)
+ for (int j = 0; j < depth; j++) {
+ key.append("dir").append(j + 1).append("/");
+ }
+ key.append("file").append(i);
+ keys.add(key.toString());
+ }
Review Comment:
This would generate a test keys array:
```json
["dir1/dir2/dir3/file11",
"dir1/dir2/dir3/file14",
"dir1/dir2/dir3/file17",
"dir1/dir2/dir3/file2",
"dir1/dir2/dir3/file20",
"dir1/dir2/dir3/file23",
"dir1/dir2/dir3/file5",
"dir1/dir2/dir3/file8",
"dir1/dir2/file1",
"dir1/dir2/file10",
"dir1/dir2/file13",
"dir1/dir2/file16",
"dir1/dir2/file19",
"dir1/dir2/file22",
"dir1/dir2/file4",
"dir1/dir2/file7",
"dir1/file0",
"dir1/file12",
"dir1/file15",
"dir1/file18",
"dir1/file21",
"dir1/file24",
"dir1/file3",
"dir1/file6",
"dir1/file9"]
```
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmMetadataManagerImpl.java:
##########
@@ -1957,18 +1971,35 @@ public Set<String> getMultipartUploadKeys(
// prefixed iterator will only iterate until keys match the prefix
try (TableIterator<String, ? extends KeyValue<String, OmMultipartKeyInfo>>
- iterator = getMultipartInfoTable().iterator(prefixKey)) {
+ iterator = getMultipartInfoTable().iterator()) {
+ iterator.seek(startKey);
Review Comment:
This must be a separate seek to provide `total_order_seek` iteration.
https://github.com/facebook/rocksdb/wiki/Iterator#prefix-iterating
--
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]