duongkame commented on code in PR #5204:
URL: https://github.com/apache/ozone/pull/5204#discussion_r1302678027


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneListStatusHelper.java:
##########
@@ -214,11 +215,12 @@ public Collection<OzoneFileStatus> 
listStatusFSO(OmKeyArgs args,
         HeapEntry entry = heapIterator.next();
         OzoneFileStatus status = entry.getStatus(prefixKey,
             scmBlockSize, volumeName, bucketName, replication);
-        map.put(entry.key, status);

Review Comment:
   So, this is done with the assumption that the items from the cache iterator 
always come before those from the rockdb iterator?



##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneListStatusHelper.java:
##########
@@ -214,11 +215,12 @@ public Collection<OzoneFileStatus> 
listStatusFSO(OmKeyArgs args,
         HeapEntry entry = heapIterator.next();
         OzoneFileStatus status = entry.getStatus(prefixKey,
             scmBlockSize, volumeName, bucketName, replication);
-        map.put(entry.key, status);
+        map.putIfAbsent(entry.key, status);
       }
     }
 
-    return map.values();
+    return map.values().stream().filter(e -> e != null).collect(

Review Comment:
   Will the status ever be null? If it can be, will putting the null check 
before putting it in the map a better idea?



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