adoroszlai commented on code in PR #7722:
URL: https://github.com/apache/ozone/pull/7722#discussion_r1958563179


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/ratis/OzoneManagerDoubleBuffer.java:
##########
@@ -330,6 +346,8 @@ private void flushBatch(Queue<Entry> buffer) throws 
IOException {
         .map(Entry::getTermIndex)
         .sorted()
         .collect(Collectors.toList());
+    final long index = 
buffer.stream().max(Comparator.comparing(Entry::getIndex)).orElse(new 
Entry(null, null, 0))
+        .getIndex();

Review Comment:
   ```suggestion
       final long index = 
buffer.stream().mapToLong(Entry::getIndex).max().orElse(0);
   ```
   
   (`import java.util.Comparator` needs to be removed as well)



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