Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support peek broker entry metadta #9067

Merged
merged 1 commit into from
Dec 28, 2020
Merged

Conversation

aloyszhang
Copy link
Contributor

@aloyszhang aloyszhang commented Dec 27, 2020

Motivation

This pull requeset adds Commands.peekBrokerEntryMetadataIfExist method to support peek broker entry metadata.

This will be used in protocol handler KOP.
Currently, when handles FetchRequest, KOP will

  1. firset read Entry out of ledger
  2. get offset from Enty for caculating next offset to read from and building MemoryRecordsBuilder
  3. traverse every Entry and add each message into MemoryRecordsBuilder
    we need the Entry twice, first for peeking the offset and second for buiding MemoryRecordsBuilder.

So, it's better that pulsar Commands can support only peek the broker entry metadata without changing the original entry content.

@aloyszhang aloyszhang changed the title Peek support peek broker entry metadta Dec 27, 2020
@sijie
Copy link
Member

sijie commented Dec 27, 2020

/pulsarbot run-failure-checks

@aloyszhang
Copy link
Contributor Author

/pulsarbot run-failure-checks

@codelipenghui codelipenghui merged commit 50dcce8 into apache:master Dec 28, 2020
aloyszhang added a commit to aloyszhang/pulsar that referenced this pull request Dec 28, 2020
This pull requeset adds `Commands.peekBrokerEntryMetadataIfExist` method to support peek broker entry metadata.

This will be used in protocol handler KOP.
Currently, when handles `FetchRequest`, KOP will
1. firset read `Entry` out of ledger
2. get offset from `Enty` for caculating next offset to read from and building `MemoryRecordsBuilder`
3. traverse every `Entry` and add each message into `MemoryRecordsBuilder`
we need the `Entry` twice, first for peeking the offset and second for buiding `MemoryRecordsBuilder`.

So, it's better that pulsar `Commands` can support only peek the broker entry metadata without changing the original entry content.
@aloyszhang aloyszhang deleted the peek branch January 22, 2021 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants