From 92b82ae914bf2e63f79dfd922d17ddd5853cd02a Mon Sep 17 00:00:00 2001 From: Dong Lin Date: Fri, 15 Aug 2014 11:48:05 -0700 Subject: [PATCH] KAFKA-1525; DumpLogSegments --- bin/kafka-dump-log.sh | 20 ++++++++++++++++++++ .../src/main/scala/kafka/tools/DumpLogSegments.scala | 4 ++-- 2 files changed, 22 insertions(+), 2 deletions(-) create mode 100755 bin/kafka-dump-log.sh diff --git a/bin/kafka-dump-log.sh b/bin/kafka-dump-log.sh new file mode 100755 index 0000000..40d5ae3 --- /dev/null +++ b/bin/kafka-dump-log.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +if [ "x$KAFKA_HEAP_OPTS" = "x" ]; then + export KAFKA_HEAP_OPTS="-Xmx512M" +fi +exec $(dirname $0)/kafka-run-class.sh kafka.tools.DumpLogSegments $@ diff --git a/core/src/main/scala/kafka/tools/DumpLogSegments.scala b/core/src/main/scala/kafka/tools/DumpLogSegments.scala index 8e9d47b..77a008d 100644 --- a/core/src/main/scala/kafka/tools/DumpLogSegments.scala +++ b/core/src/main/scala/kafka/tools/DumpLogSegments.scala @@ -155,8 +155,8 @@ object DumpLogSegments { lastOffset = messageAndOffset.offset print("offset: " + messageAndOffset.offset + " position: " + validBytes + " isvalid: " + msg.isValid + - " payloadsize: " + msg.payloadSize + " magic: " + msg.magic + - " compresscodec: " + msg.compressionCodec + " crc: " + msg.checksum) + " payloadsize: " + msg.payloadSize + " magic: " + msg.magic + " txId: " + msg.txId + + " txControl: " + msg.txControl + " compresscodec: " + msg.compressionCodec + " crc: " + msg.checksum) if(msg.hasKey) print(" keysize: " + msg.keySize) if(printContents) { -- 1.7.12.4