ijuma commented on code in PR #13085:
URL: https://github.com/apache/kafka/pull/13085#discussion_r1063687740


##########
core/src/main/scala/kafka/log/UnifiedLog.scala:
##########
@@ -1249,12 +1249,10 @@ class UnifiedLog(@volatile var logStartOffset: Long,
            isolation: FetchIsolation,
            minOneMessage: Boolean): FetchDataInfo = {
     checkLogStartOffset(startOffset)
-    val maxOffsetMetadata = isolation match {
-      case FetchLogEnd => localLog.logEndOffsetMetadata
-      case FetchHighWatermark => fetchHighWatermarkMetadata
-      case FetchTxnCommitted => fetchLastStableOffsetMetadata
-    }
-    localLog.read(startOffset, maxLength, minOneMessage, maxOffsetMetadata, 
isolation == FetchTxnCommitted)
+    var maxOffsetMetadata = localLog.logEndOffsetMetadata
+    if (isolation == FetchIsolation.FETCH_HIGH_WATERMARK) maxOffsetMetadata = 
fetchHighWatermarkMetadata
+    else if (isolation == FetchIsolation.FETCH_TXN_COMMITTED) 
maxOffsetMetadata = fetchLastStableOffsetMetadata

Review Comment:
   I think you can keep the `match` here as it was.



-- 
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-unsubscr...@kafka.apache.org

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

Reply via email to