Skip to content

Commit d481163

Browse files
DL1231d00791190
and
d00791190
authored
MINOR: Print startup time for RemoteIndexCache (#13970)
Reviewers: Satish Duggana <[email protected]>, Divij Vaidya <[email protected]> Co-authored-by: d00791190 <[email protected]>
1 parent 7bdcb22 commit d481163

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

core/src/main/scala/kafka/log/remote/RemoteIndexCache.scala

+3-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import kafka.utils.CoreUtils.{inReadLock, inWriteLock}
2323
import kafka.utils.{CoreUtils, Logging, threadsafe}
2424
import org.apache.kafka.common.Uuid
2525
import org.apache.kafka.common.errors.CorruptRecordException
26-
import org.apache.kafka.common.utils.Utils
26+
import org.apache.kafka.common.utils.{Utils, Time}
2727
import org.apache.kafka.server.log.remote.storage.RemoteStorageManager.IndexType
2828
import org.apache.kafka.server.log.remote.storage.{RemoteLogSegmentMetadata, RemoteStorageManager}
2929
import org.apache.kafka.storage.internals.log.{LogFileUtils, OffsetIndex, OffsetPosition, TimeIndex, TransactionIndex}
@@ -238,6 +238,7 @@ class RemoteIndexCache(maxSize: Int = 1024, remoteStorageManager: RemoteStorageM
238238
.build[Uuid, Entry]()
239239

240240
private def init(): Unit = {
241+
val start = Time.SYSTEM.hiResClockMs()
241242
try {
242243
Files.createDirectory(cacheDir.toPath)
243244
info(s"Created new file $cacheDir for RemoteIndexCache")
@@ -292,6 +293,7 @@ class RemoteIndexCache(maxSize: Int = 1024, remoteStorageManager: RemoteStorageM
292293
}
293294
}
294295
})
296+
info(s"RemoteIndexCache starts up in ${Time.SYSTEM.hiResClockMs() - start} ms.")
295297
}
296298

297299
init()

0 commit comments

Comments
 (0)