[improve][broker] Part 2: Pack PendingAcksMap values into long#26030
Open
void-ptr974 wants to merge 2 commits into
Open
[improve][broker] Part 2: Pack PendingAcksMap values into long#26030void-ptr974 wants to merge 2 commits into
void-ptr974 wants to merge 2 commits into
Conversation
2 tasks
Contributor
Author
|
After this PR is merged, the next PR will switch the per-ledger entry map in That follow-up will keep the packed-value shape from this PR and focus only on removing the boxed inner-map key/value overhead. The BitSet prefix index for same-ledger |
merlimat
approved these changes
Jun 14, 2026
…alue-part2 # Conflicts: # pulsar-broker/src/main/java/org/apache/pulsar/broker/service/PendingAcksMap.java # pulsar-broker/src/test/java/org/apache/pulsar/broker/service/PendingAcksMapTest.java
lhotari
requested changes
Jun 15, 2026
lhotari
left a comment
Member
There was a problem hiding this comment.
Related to #26028 (review). I have the fastutil minification working now and this change can be implemented on top of fastutil once the restoration of fastutil has been merged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Part of #26027.
PendingAcksMapstores per-entry pending ack metadata as anIntIntPaircontaining the remaining unacked count and sticky key hash. That keeps one value object per pending ack entry. The main consumer ack paths only need the remaining unacked count after lookup or removal, so returning anIntIntPairthere also creates short-lived objects that are not needed by the caller.Modifications
longinside the existingTreeMap<Long, TreeMap<Long, ...>>structure.getRemainingUnackedremoveAndGetRemainingUnackedConsumerto use the primitive accessors for ack owner lookup, full ack completion, and redelivery removal.getandremoveAndGetmethods that returnIntIntPairfor compatibility with existing callers.updateRemainingUnacked, andremoveAllUpTocallbacks.Verifying this change
./gradlew :pulsar-broker:test --tests org.apache.pulsar.broker.service.PendingAcksMapTest --max-workers=1 -PtestRetryCount=0./gradlew :pulsar-broker:checkstyleMain :pulsar-broker:checkstyleTest --max-workers=1