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

[improve][client] PIP-229: Add a common interface to get fields of the MessageIdData #19

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Commits on Mar 15, 2023

  1. [improve][client] PIP-229: Add a common interface to get fields of Me…

    …ssageIdData
    
    Master issue: apache#18950
    
    ### Motivation
    
    We need a common interface to get fields of the MessageIdData. After
    that, we won't need to assert a MessageId implementation is an instance
    of a specific class. And we can pass our customized MessageId
    implementation to APIs like `acknowledge` and `seek`.
    
    ### Modifications
    
    - Add `MessageIdAdv` to get fields of `MessageIdData`, make all
      MessageId implementations inherit it (except `MultiMessageIdImpl`).
    - Add `MessageIdAdvUtils` for the most common used methods.
    - Replace `BatchMessageAcker` with the `BitSet` for ACK.
    - Remove `TopicMessageIdImpl#getInnerMessageId` since a
      `TopicMessageIdImpl` can be treated as its underlying `MessageId`
      implementation now.
    - Remove `instanceof BatchMessageIdImpl` checks in `pulsar-client`
      module by casting to `MessageIdAdv`.
    
    After this refactoring, the 3rd party library will no longer need to
    cast a `MessageId` to a specific implementation. It only needs to cast
    `MessageId` to `MessageIdAdv`. Users can also implement their own util
    class so the methods of `MessageIdAdvUtils` are all not public.
    
    ### Verifications
    
    Add `CustomMessageIdTest` to verify a simple MessageIdAdv implementation
    that only has the (ledger id, entry id, batch idx, batch size) fields
    also works for seek and acknowledgment.
    BewareMyPower committed Mar 15, 2023
    Configuration menu
    Copy the full SHA
    64185ac View commit details
    Browse the repository at this point in the history

Commits on Mar 23, 2023

  1. Configuration menu
    Copy the full SHA
    e98174b View commit details
    Browse the repository at this point in the history