-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[improve] [ml] compress individual ack info to make maintain more records #21105
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
base: master
Are you sure you want to change the base?
Conversation
The pr had no activity for 30 days, mark with Stale label. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please extract the logic to a separate class which is unit tested separately.
@VisibleForTesting | ||
List<MLDataFormats.MessageRange> buildIndividualDeletedMessageRanges() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of adding "VisibleForTesting" annotation here, please extract this logic to a separate class which is tested separately. There's a lot of complexity here and this would be very hard to maintain in the future in this form. Smaller classes and smaller methods are a general preference in maintainable code.
Motivation
Broker serialize
individualDeletedMessages
as an array(1:1..1:5000],(2:-1..3:5000],,(100:-1..100:5000]
, each ledger will have a separate record, even if multiple ledgers are contiguous.We can compress the contiguous records to one, such as
(1:1...100:5000]
. This can make one entry maintain more data.Modifications
Compress the contiguous records to one to make one entry maintain more data.
Next to do: push another PR to compress the response of
pulsar-admin topics stats.
In what cases would it be useful
(Highlight) Note: This patch will have a big impact and needs to be cherry-picked and reviewed carefully.
Documentation
doc
doc-required
doc-not-needed
doc-complete
Matching PR in forked repository
PR in forked repository: x