-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[Issue 2688]Support set retention on topic level. #7747
[Issue 2688]Support set retention on topic level. #7747
Conversation
1fdcd11
to
e224607
Compare
/pulsarbot run-failure-checks |
2 similar comments
/pulsarbot run-failure-checks |
/pulsarbot run-failure-checks |
@MarvinCai Could you please also help review this PR? |
/pulsarbot run-failure-checks |
e224607
to
e64936a
Compare
/pulsarbot run-failure-checks |
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.
left some minor comments
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java
Show resolved
Hide resolved
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java
Show resolved
Hide resolved
pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/TopicPoliciesTest.java
Show resolved
Hide resolved
pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/Topics.java
Outdated
Show resolved
Hide resolved
pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdTopics.java
Show resolved
Hide resolved
e64936a
to
dbd7771
Compare
/pulsarbot run-failure-checks |
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.
Looks good to me, just left some minor comments.
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
Show resolved
Hide resolved
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
Show resolved
Hide resolved
fbfcdf2
to
bebd6f7
Compare
/pulsarbot run-failure-checks |
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.
Add some minor comments.
if (topicName.isGlobal()) { | ||
validateGlobalNamespaceOwnership(namespaceName); | ||
} | ||
checkTopicLevelPolicyEnable(); |
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.
checkTopicLevelPolicyEnable() is also called by getTopicPolicies(), so we can delete it here.
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.
okay, let me solve these problems
if (topicName.isGlobal()) { | ||
validateGlobalNamespaceOwnership(namespaceName); | ||
} | ||
checkTopicLevelPolicyEnable(); |
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.
Same to the above.
if (topicName.isGlobal()) { | ||
validateGlobalNamespaceOwnership(namespaceName); | ||
} | ||
checkTopicLevelPolicyEnable(); |
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.
Same to the above.
void setRetention(String topic, RetentionPolicies retention) throws PulsarAdminException; | ||
|
||
/** | ||
* Set the retention configuration for all the topics on a topic asynchronously. |
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.
Need to modify this doc.
CompletableFuture<RetentionPolicies> getRetentionAsync(String topic); | ||
|
||
/** | ||
* Remove the retention configuration for all the topics on a topic. |
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.
Need to modify this doc.
### Motivation Support set retention quota on topic level. Based on the system topic function. ### Modifications Support get-retention on topic level. Support set-retention on topic level. Support remove-retention on topic level.
### Motivation Support set retention quota on topic level. Based on the system topic function. ### Modifications Support get-retention on topic level. Support set-retention on topic level. Support remove-retention on topic level.
### Motivation Support set retention quota on topic level. Based on the system topic function. ### Modifications Support get-retention on topic level. Support set-retention on topic level. Support remove-retention on topic level.
### Motivation Support set retention quota on topic level. Based on the system topic function. ### Modifications Support get-retention on topic level. Support set-retention on topic level. Support remove-retention on topic level.
Not valid from 2.6.0 Thanks @gaoran10 > We introduce topic-level policies from 2.6.0, refer to apache/pulsar#4955, but I think we support retention policies at the topic level from 2.7.0, refer to apache/pulsar#7747. >Make the default value of the configuration topicLevelPoliciesEnabled as true from 2.11.0, refer to apache/pulsar#15619.
Motivation
Support set retention quota on topic level.
Based on the system topic function.
Modifications
Support get-retention on topic level.
Support set-retention on topic level.
Support remove-retention on topic level.
Verifying this change
This change added tests and can be verified as follows:
Does this pull request potentially affect one of the following parts:
If
yes
was chosen, please highlight the changesyes
)Documentation
yes
)docs
/JavaDocs
)