[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. |
jianyun8023
left a comment
There was a problem hiding this comment.
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.
minor: there is no need to use asyncResponse
There was a problem hiding this comment.
It is same to internalGetRetention(), maybe we can modify it all at once.
codelipenghui
left a comment
There was a problem hiding this comment.
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.