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
Use historical data from old API in new API #329
Conversation
if (zkClient.exists(bundleZPath, null) != null) { | ||
bundleData = readJson(zkClient.getData(bundleZPath, null, null), BundleData.class); | ||
} else if (zkClient.exists(quotaZPath, null) != null) { |
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.
Both the zkClient.exists()
calls are blocking here (it needs to send a req to zk server and wait for it). You can leverage the ZK cache classes that are already in place to cache the existence check for that znode and use watches to update the status.
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.
For the leader broker, these calls will only be made once per bundle, and then they are added to the local bundle data map -- will it still help to use a cache in this case?
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.
Ok, that sounds good
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.
👍
…che#329) Signed-off-by: Paulo Pereira <paulo.pereira@karhoo.com> ### Motivation I have a service that when it restarts, it needs to know what was the last message successfully sent to pulsar. A reader seems the logical place, since we can specify `StartMessageID` as `LatestMessageID()` and `StartMessageIDInclusive` ### Modifications When the reader is created, verify if it startMessageIDInclusive true and startMessageID == lastestMessageID() and then get the last message id and seek to that message id.
fix apache#329 fix highwatermark and logendoffset error
Motivation
Currently, users which switch to
ModularLoadManagerImpl
will carry over no history contained in the resource quotas, causing the default message rate and throughput values to be used for every bundle. This PR makes it so thatModularLoadManagerImpl
will use this data to initialize bundle data for bundles not yet handled by the new API.Modifications
When assigning new bundles, the historical data will now be initialized according to the following priorities:
/loadbalance/bundle-data
/loadbalance/resource-quota/namespace
Result
We may now utilize pre-existing historical data for
ModularLoadManagerImpl
.