MINOR: Dump log tool should support bootstrap checkpoint
This patch adds support to `kafka-dump-log.sh` to print the `bootstrap.checkpoint` file from
Reviewers:  dengziming Luke Chen
@@ -30,6 +30,7 @@ import org.apache.kafka.common.metadata.{MetadataJsonConverters, MetadataRecordT
import org.apache.kafka.common.protocol.ByteBufferAccessor
import org.apache.kafka.common.record._
import org.apache.kafka.common.utils.Utils
+import org.apache.kafka.controller.BootstrapMetadata
import org.apache.kafka.metadata.MetadataRecordSerde
import org.apache.kafka.snapshot.Snapshots
@@ -253,9 +254,13 @@ object DumpLogSegments {
val startOffset = file.getName.split("\\.")(0).toLong
println(s"Log starting offset: $startOffset")
} else if (file.getName.endsWith(Snapshots.SUFFIX)) {
+ if (file.getName == BootstrapMetadata.BOOTSTRAP_FILE) {
+ println("KRaft bootstrap snapshot")
+ } else {
val path = Snapshots.parse(file.toPath).get()
println(s"Snapshot end offset: ${path.snapshotId.offset}, epoch: ${path.snapshotId.epoch}")
}
+ }
val fileRecords = FileRecords.open(file, false).slice(0, maxBytes)
try {
var validBytes = 0L
