This is an automated email from the ASF dual-hosted git repository.

mimaison pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 8d09fc9935f MINOR: Fix compiler errors in `RemoteIndex*` related to 
`OffsetPosition` (#13008)
8d09fc9935f is described below

commit 8d09fc9935fc976d730801c2c0f86556affe6e09
Author: Ismael Juma <ism...@juma.me.uk>
AuthorDate: Sat Dec 17 11:25:33 2022 -0800

    MINOR: Fix compiler errors in `RemoteIndex*` related to `OffsetPosition` 
(#13008)
    
    #11390 and #12993 were merged in relatively quick succession, which 
resulted in compiler errors that weren't present when each change was on top of 
trunk.
    
    Reviewers: Mickael Maison <mickael.mai...@gmail.com>
---
 core/src/main/scala/kafka/log/remote/RemoteIndexCache.scala          | 1 +
 core/src/test/scala/unit/kafka/log/remote/RemoteIndexCacheTest.scala | 5 +++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/core/src/main/scala/kafka/log/remote/RemoteIndexCache.scala 
b/core/src/main/scala/kafka/log/remote/RemoteIndexCache.scala
index 564565bc5af..9dfaaa5539c 100644
--- a/core/src/main/scala/kafka/log/remote/RemoteIndexCache.scala
+++ b/core/src/main/scala/kafka/log/remote/RemoteIndexCache.scala
@@ -22,6 +22,7 @@ import kafka.utils.{CoreUtils, Logging, ShutdownableThread}
 import org.apache.kafka.common.Uuid
 import org.apache.kafka.common.errors.CorruptRecordException
 import org.apache.kafka.common.utils.Utils
+import org.apache.kafka.server.log.internals.OffsetPosition
 import 
org.apache.kafka.server.log.remote.storage.RemoteStorageManager.IndexType
 import org.apache.kafka.server.log.remote.storage.{RemoteLogSegmentMetadata, 
RemoteStorageManager}
 
diff --git 
a/core/src/test/scala/unit/kafka/log/remote/RemoteIndexCacheTest.scala 
b/core/src/test/scala/unit/kafka/log/remote/RemoteIndexCacheTest.scala
index e785f09fb7d..d518ac48e40 100644
--- a/core/src/test/scala/unit/kafka/log/remote/RemoteIndexCacheTest.scala
+++ b/core/src/test/scala/unit/kafka/log/remote/RemoteIndexCacheTest.scala
@@ -16,9 +16,10 @@
  */
 package kafka.log.remote
 
-import kafka.log.{OffsetIndex, OffsetPosition, TimeIndex, UnifiedLog}
+import kafka.log.{OffsetIndex, TimeIndex, UnifiedLog}
 import kafka.utils.MockTime
 import org.apache.kafka.common.{TopicIdPartition, TopicPartition, Uuid}
+import org.apache.kafka.server.log.internals.OffsetPosition
 import 
org.apache.kafka.server.log.remote.storage.RemoteStorageManager.IndexType
 import org.apache.kafka.server.log.remote.storage.{RemoteLogSegmentId, 
RemoteLogSegmentMetadata, RemoteStorageManager}
 import org.apache.kafka.test.TestUtils
@@ -109,7 +110,7 @@ class RemoteIndexCacheTest {
     assertEquals(lastOffsetPosition, cache.lookupOffset(rlsMetadata, 
greaterOffsetThanLastOffset))
 
     // offsetIndex.lookup() returns OffsetPosition(baseOffset, 0) for offsets 
smaller than least entry in the offset index.
-    val nonExistentOffsetPosition = OffsetPosition(baseOffset, 0)
+    val nonExistentOffsetPosition = new OffsetPosition(baseOffset, 0)
     val lowerOffsetThanBaseOffset = offsetIndex.baseOffset - 1
     assertEquals(nonExistentOffsetPosition.position, 
cache.lookupOffset(rlsMetadata, lowerOffsetThanBaseOffset))
   }

Reply via email to