chia7712 commented on code in PR #16085:
URL: https://github.com/apache/kafka/pull/16085#discussion_r1619030581
##########
core/src/test/scala/unit/kafka/log/LogSegmentTest.scala:
##########
@@ -632,6 +633,15 @@ class LogSegmentTest {
Utils.delete(tempDir)
}
+ @Test
+ def testGetFirstBatchTimestampForSegments(): Unit = {
Review Comment:
It seems this test case does not cover `getFirstBatchTimestampForSegments`.
Maybe it needs another name. Also, could you add UT for
`getFirstBatchTimestampForSegments`?
##########
core/src/main/scala/kafka/log/UnifiedLog.scala:
##########
@@ -1918,7 +1918,9 @@ class UnifiedLog(@volatile var logStartOffset: Long,
* to ensure no other logcleaner threads and retention thread can work on
the same segment.
*/
private[log] def getFirstBatchTimestampForSegments(segments:
util.Collection[LogSegment]): util.Collection[java.lang.Long] = {
- LogSegments.getFirstBatchTimestampForSegments(segments)
+ segments.asScala
Review Comment:
Do we need those scala/java conversion? for example:
```scala
segments.stream().map[java.lang.Long](s =>
s.getFirstBatchTimestamp).collect(Collectors.toList())
```
--
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]