peterxcli commented on code in PR #7817:
URL: https://github.com/apache/ozone/pull/7817#discussion_r1957137391


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmMetadataManagerImpl.java:
##########
@@ -1929,46 +1929,58 @@ public <KEY, VALUE> long 
countEstimatedRowsInTable(Table<KEY, VALUE> table)
   }
 
   @Override
-  public Set<String> getMultipartUploadKeys(
-      String volumeName, String bucketName, String prefix) throws IOException {
+  public MultipartUploadKeys getMultipartUploadKeys(
+      String volumeName, String bucketName, String prefix, String keyMarker,
+      String uploadIdMarker, int maxUploads) throws IOException {
 
-    Set<String> response = new TreeSet<>();
-    Set<String> aborted = new TreeSet<>();
-
-    Iterator<Map.Entry<CacheKey<String>, CacheValue<OmMultipartKeyInfo>>>
-        cacheIterator = getMultipartInfoTable().cacheIterator();
+    MultipartUploadKeys.Builder resultBuilder = 
MultipartUploadKeys.newBuilder();
+    Set<String> responseKeys = new TreeSet<>();
+    String lastKey = null;
 
     String prefixKey =
         OmMultipartUpload.getDbKey(volumeName, bucketName, prefix);
 
-    // First iterate all the entries in cache.
-    while (cacheIterator.hasNext()) {
-      Map.Entry<CacheKey<String>, CacheValue<OmMultipartKeyInfo>> cacheEntry =
-          cacheIterator.next();
-      if (cacheEntry.getKey().getCacheKey().startsWith(prefixKey)) {
-        // Check if it is marked for delete, due to abort mpu
-        if (cacheEntry.getValue().getCacheValue() != null) {
-          response.add(cacheEntry.getKey().getCacheKey());
-        } else {
-          aborted.add(cacheEntry.getKey().getCacheKey());
-        }

Review Comment:
   Just found there is existing implementation that can be refereed.
   
https://github.com/apache/ozone/blob/989db778d33ea36f7fb7725cea0fcf23fe798b87/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmMetadataManagerImpl.java#L1311-L1403



-- 
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]

Reply via email to