Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Commit

Permalink
Avoid repeated calls to skipBrokerEntryMetadataIfExist when parseMess…
Browse files Browse the repository at this point in the history
…ageMetadata (#767)

Related to apache/pulsar#10968
  • Loading branch information
wenbingshen committed Sep 30, 2021
1 parent c3bd3dd commit 6c3370b
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 2 deletions.
Expand Up @@ -111,7 +111,6 @@ public DecodeResult decode(final List<Entry> entries, final byte magic) {
// each entry is a batched message
ByteBuf metadataAndPayload = entry.getDataBuffer();

Commands.skipBrokerEntryMetadataIfExist(metadataAndPayload);
MessageMetadata msgMetadata = Commands.parseMessageMetadata(metadataAndPayload);

decodeResults.add(ByteBufUtils.decodePulsarEntryToKafkaRecords(
Expand Down
Expand Up @@ -48,7 +48,6 @@ public static long getLogEndOffset(ManagedLedger managedLedger) {

public static long getPublishTime(final ByteBuf byteBuf) {
final int readerIndex = byteBuf.readerIndex();
Commands.skipBrokerEntryMetadataIfExist(byteBuf);
final MessageMetadata metadata = Commands.parseMessageMetadata(byteBuf);
byteBuf.readerIndex(readerIndex);
return metadata.getPublishTime();
Expand Down

0 comments on commit 6c3370b

Please sign in to comment.