> On July 21, 2014, 6:16 p.m., Guozhang Wang wrote: > > core/src/main/scala/kafka/tools/DumpLogSegments.scala, line 165 > > <https://reviews.apache.org/r/23705/diff/3/?file=636778#file636778line165> > > > > Would key also be null possibly? > > Manikumar Reddy O wrote: > This line is surrounded by if(msg.hasKey) check. > msg.hasKey returns true for non-zero length keys. So we don't need any > additional null check. > > > Guozhang Wang wrote: > I see. Instead of not printing anything if key is null, could you still > print " key: null" to be aligned with other keyed messages. This will also > make text editing for analysis like grep/awk easy. > > Manikumar Reddy O wrote: > We need to use "if(msg.hasKey)" to differentiate keyed messages with > non-keyed messages. > > Key will be null/zero length for all non-keyed messages. So it is not > appropriate to print " key: null" for all non-keyed messages. > > If "msg.hasKey" true means it is a keyed-message, So it key will not be > null. > > Are you saying that there can be a message with non-zero key length but > with null reference? > > > > > >
Any keyed messages' key should be not null, what I originally was suggesting is that we can still print "key: null" for non-keyed messages. - Guozhang ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/23705/#review48265 ----------------------------------------------------------- On July 23, 2014, 2:55 p.m., Manikumar Reddy O wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/23705/ > ----------------------------------------------------------- > > (Updated July 23, 2014, 2:55 p.m.) > > > Review request for kafka. > > > Bugs: KAFKA-1192 > https://issues.apache.org/jira/browse/KAFKA-1192 > > > Repository: kafka > > > Description > ------- > > Support given for custom deserialization of messages and keys > > > Diffs > ----- > > core/src/main/scala/kafka/tools/DumpLogSegments.scala > 6daf87b25a48a51aafb7dbe8d0c0371e0ea7501f > > Diff: https://reviews.apache.org/r/23705/diff/ > > > Testing > ------- > > > Thanks, > > Manikumar Reddy O > >