-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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 7757] Support Persistence Policies on topic level #7817
[ISSUE 7757] Support Persistence Policies on topic level #7817
Conversation
…s-on-topic-level # Conflicts: # pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java # pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/Topics.java # pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdTopics.java
/pulsarbot run-failure-checks |
@jianyun8023 Please help review this PR. |
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.
protected void internalGetPersistence(AsyncResponse asyncResponse){ | ||
validateAdminAccessForTenant(namespaceName.getTenant()); | ||
validatePoliciesReadOnlyAccess(); | ||
if (topicName.isGlobal()) { | ||
validateGlobalNamespaceOwnership(namespaceName); | ||
} | ||
Optional<PersistencePolicies> retention = getTopicPolicies(topicName) | ||
.map(TopicPolicies::getPersistence); | ||
if (!retention.isPresent()) { | ||
asyncResponse.resume(Response.noContent().build()); | ||
}else { | ||
asyncResponse.resume(retention.get()); | ||
} | ||
} |
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.
minor: there is no need to use asyncResponse
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.
It is same to internalGetRetention(), maybe we can modify it all at once.
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.
The change looks do not handle the topic creation according to the topic policy if the topic level persistent policy exists. You can refer to createPersistentTopic
method in the BrokerService.java
Done. |
/pulsarbot run-failure-checks |
Link [https://github.com/apache/pulsar/issues/7757](https://github.com/apache/pulsar/issues/7757) and master issue [https://github.com/apache/pulsar/issues/2688](https://github.com/apache/pulsar/issues/2688) ### Motivation Support set/get/remove persistence policies on topic level. ### Verifying this change new unit test added.
Link [https://github.com/apache/pulsar/issues/7757](https://github.com/apache/pulsar/issues/7757) and master issue [https://github.com/apache/pulsar/issues/2688](https://github.com/apache/pulsar/issues/2688) ### Motivation Support set/get/remove persistence policies on topic level. ### Verifying this change new unit test added.
Link [https://github.com/apache/pulsar/issues/7757](https://github.com/apache/pulsar/issues/7757) and master issue [https://github.com/apache/pulsar/issues/2688](https://github.com/apache/pulsar/issues/2688) ### Motivation Support set/get/remove persistence policies on topic level. ### Verifying this change new unit test added.
Link [https://github.com/apache/pulsar/issues/7757](https://github.com/apache/pulsar/issues/7757) and master issue [https://github.com/apache/pulsar/issues/2688](https://github.com/apache/pulsar/issues/2688) ### Motivation Support set/get/remove persistence policies on topic level. ### Verifying this change new unit test added.
…stence polices, message TTL, and backlog quota on topic level (#7852) Motivation In PRs, #7738, #7646, #7817, persistence polices, message TTL, and backlog quota policies are supported on topic level. The PR for code modification is updated and merged. but the doc is not updated accordingly. This PR is used to support to set/get/remove persistence polices, message TTL, and backlog quota on topic level. Modifications Update the Pulsar Admin CLI doc to support to set/get/remove persistence polices, message TTL, and backlog quota on topic level. * Update backlog-quota policies on topic level * update contents * update contents
…stence polices, message TTL, and backlog quota on topic level (apache#7852) Motivation In PRs, apache#7738, apache#7646, apache#7817, persistence polices, message TTL, and backlog quota policies are supported on topic level. The PR for code modification is updated and merged. but the doc is not updated accordingly. This PR is used to support to set/get/remove persistence polices, message TTL, and backlog quota on topic level. Modifications Update the Pulsar Admin CLI doc to support to set/get/remove persistence polices, message TTL, and backlog quota on topic level. * Update backlog-quota policies on topic level * update contents * update contents
Link #7757 and master issue #2688
Motivation
Support set/get/remove persistence policies on topic level.
Verifying this change
new unit test added.