yes you right ! but in the book .log file and .index were both provided in the 
command line.


but for me I get this output ...

/home/adryen/Java/kafka_2.11-1.0.0/bin/kafka-run-class.sh 
kafka.tools.DumpLogSegments --files 
./00000000000000000000.index,00000000000000000000.log --index-sanity-check
Dumping ./00000000000000000000.index
Exception in thread "main" java.lang.IllegalArgumentException: requirement 
failed: Corrupt index found, index file 
(/home/adryen/Java/kafka_2.11-1.0.0/logs/kafka-1/customer-topic-0/./00000000000000000000.index)
 has non-zero size but the last offset is 0 which is no larger than the base 
offset 0.


It's strange because in my topic a consumer sent messages ...


/home/adryen/Java/kafka_2.11-1.0.0/bin/kafka-run-class.sh 
kafka.tools.DumpLogSegments --files ./00000000000000000000.log
Dumping ./00000000000000000000.log
Starting offset: 0
baseOffset: 0 lastOffset: 0 baseSequence: -1 lastSequence: -1 producerId: -1 
producerEpoch: -1 partitionLeaderEpoch: 0 isTransactional: false position: 0 
CreateTime: 1518299032960 isvalid: true size: 91 magic: 2 compresscodec: NONE 
crc: 3301617258
baseOffset: 1 lastOffset: 1 baseSequence: -1 lastSequence: -1 producerId: -1 
producerEpoch: -1 partitionLeaderEpoch: 0 isTransactional: false position: 91 
CreateTime: 1518299033122 isvalid: true size: 92 magic: 2 compresscodec: NONE 
crc: 2213454754



________________________________
De : Ted Yu <yuzhih...@gmail.com>
Envoyé : samedi 10 février 2018 23:17:42
À : users@kafka.apache.org
Objet : Re: DumpLogSegment

I think this was due to the type of file you fed to the tool.
To use --index-sanity-check , you need to supply file with the following
suffix:

  val IndexFileSuffix = ".index"


On Sat, Feb 10, 2018 at 2:09 PM, adrien ruffie <adriennolar...@hotmail.fr>
wrote:

> No really ... just the same output like this:
>
>
> kafka_2.11-1.0.0$ ./bin/kafka-run-class.sh kafka.tools.DumpLogSegments
> --files logs/kafka-1/customer-topic-0/00000000000000000000.log
> --index-sanity-check
> Dumping logs/kafka-1/customer-topic-0/00000000000000000000.log
> Starting offset: 0
> baseOffset: 0 lastOffset: 0 baseSequence: -1 lastSequence: -1 producerId:
> -1 producerEpoch: -1 partitionLeaderEpoch: 0 isTransactional: false
> position: 0 CreateTime: 1518299032960 isvalid: true size: 91 magic: 2
> compresscodec: NONE crc: 3301617258
>
>
> moreover you can see my release 2.11-1.0.0
>
>
> thank for you response Ted !
>
> ________________________________
> De : Ted Yu <yuzhih...@gmail.com>
> Envoyé : samedi 10 février 2018 23:00:02
> À : users@kafka.apache.org
> Objet : Re: DumpLogSegment
>
> For --index-sanity-check, according to dumpIndex():
>
>     if (indexSanityOnly) {
>
>       index.sanityCheck
>
>       println(s"$file passed sanity check.")
>
>
> Do you see the print above ?
>
>
> Which release of Kafka are you using ?
>
>
> Cheers
>
>
> On Sat, Feb 10, 2018 at 1:54 PM, adrien ruffie <adriennolar...@hotmail.fr>
> wrote:
>
> > Hi all,
> >
> > In Kafka the definitive guide in page 200-201, two parameters of
> > kafka.tools.DumpLogSegments appear not really work ...
> >
> > the --index-sanity-check argument
> >
> > the --print-data-log
> >
> > exemple:
> >
> > ./bin/kafka-run-class.sh kafka.tools.DumpLogSegments --files
> > logs/kafka-0/customer-topic-0/00000000000000000000.log
> > --index-sanity-check
> >
> > ./bin/kafka-run-class.sh kafka.tools.DumpLogSegments --files
> > logs/kafka-0/customer-topic-0/00000000000000000000.log --print-data-log
> >
> >
> >
> > If I use it, I get the same output as:
> >
> > ./bin/kafka-run-class.sh kafka.tools.DumpLogSegments --files
> > logs/kafka-0/customer-topic-0/00000000000000000000.log
> >
> > These previous arguments, aren't take account ?
> >
> >
> > best regards,
> >
> >
> > Adrien
> >
> >
>

Reply via email to