You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "chia7712 (via GitHub)" <gi...@apache.org> on 2025/05/02 03:16:58 UTC

Re: [PR] MINOR: Remove unnecessary Optional from offsetsToSnapshot [kafka]

chia7712 commented on code in PR #19613:
URL: https://github.com/apache/kafka/pull/19613#discussion_r2071044004


##########
storage/src/main/java/org/apache/kafka/storage/internals/log/UnifiedLog.java:
##########
@@ -2416,15 +2416,15 @@ public static void rebuildProducerState(ProducerStateManager producerStateManage
                                             Time time,
                                             boolean reloadFromCleanShutdown,
                                             String logPrefix) throws IOException {
-        List<Optional<Long>> offsetsToSnapshot = new ArrayList<>();
+        List<Long> offsetsToSnapshot = new ArrayList<>();
         if (segments.nonEmpty()) {

Review Comment:
   Could you please consider using `segments.lastSegment().ifPresent` to rewrite it?



-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org