You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/08/09 06:51:26 UTC

[GitHub] [pulsar] tisonkun commented on a diff in pull request #16996: feat:return true if entry exists in cache

tisonkun commented on code in PR #16996:
URL: https://github.com/apache/pulsar/pull/16996#discussion_r940962190


##########
pulsar-common/src/main/java/org/apache/pulsar/common/protocol/Commands.java:
##########
@@ -1850,10 +1850,9 @@ public static MessageMetadata peekMessageMetadata(ByteBuf metadataAndPayload, St
             long consumerId) {
         try {
             // save the reader index and restore after parsing
-            int readerIdx = metadataAndPayload.readerIndex();
+            metadataAndPayload.markReaderIndex();
             MessageMetadata metadata = Commands.parseMessageMetadata(metadataAndPayload);
-            metadataAndPayload.readerIndex(readerIdx);
-
+            metadataAndPayload.resetReaderIndex();

Review Comment:
   How this change be relevant?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org