forked from apache/pulsar
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[broker] Optimize TopicPolicies#messageTTLInSeconds with HierarchyTop…
…icPolicies (apache#13241) ### Motivation This is one of the serial topic policy optimization with `HierarchyTopicPolicies`. Update topic policy with HierarchyTopicPolicies comes with these benefits: - All topic policy related settings will goes into AbstractTopic#topicPolicies, easier to understand, check, review, and modify. - Unify policy update to AbstractTopic. And easier to find which policy is not applied to non-persistent topic yet. And we can easily add support for it. - Unify policy value with 3 level settings (topic/namespace/broker), and priority with topic > namespace > broker. And it's easier to find which level settings is missing. - All values are updated at creation or by trigger. We can save some resource to update it or recalculate each time we use it. - etc. ### Modifications Add new field `messageTTLInSeconds` in org.apache.pulsar.broker.service.AbstractTopic#topicPolicies. ### Verifying this change - [ ] Make sure that the change passes the CI checks. This change is already covered by existing tests, such as - class org.apache.pulsar.broker.admin.TopicMessageTTLTest - org.apache.pulsar.client.api.KeySharedSubscriptionTest#testContinueDispatchMessagesWhenMessageTTL - org.apache.pulsar.broker.stats.PrometheusMetricsTest#testPerTopicExpiredStat - org.apache.pulsar.client.impl.TopicsConsumerImplTest#testDefaultBacklogTTL Some checklist for updating topic policy with `HierarchyTopicPolicies`.
- Loading branch information
Showing
5 changed files
with
27 additions
and
52 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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