Skip to content
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

Merged
merged 7 commits into from
Aug 11, 2020

Conversation

jianyun8023
Copy link
Contributor

@jianyun8023 jianyun8023 commented Aug 4, 2020

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:

  • test set topic retention
  • test remove topic retention
  • test get topic retention
  • test disabled topic retention
  • test topic retention parameters are valid

Does this pull request potentially affect one of the following parts:

If yes was chosen, please highlight the changes

  • Dependencies (does it add or upgrade a dependency): (no)
  • The public API: (no)
  • The schema: (don't know)
  • The default values of configurations: (yes / no)
  • The wire protocol: (yes / no)
  • The rest endpoints: (yes / no)
  • The admin cli options: (yes)
  • Anything that affects deployment: (no)

Documentation

  • Does this pull request introduce a new feature? (yes)
  • If yes, how is the feature documented? (docs / JavaDocs)

@codelipenghui codelipenghui added this to the 2.7.0 milestone Aug 5, 2020
@codelipenghui codelipenghui added the type/feature The PR added a new feature or issue requested a new feature label Aug 5, 2020
@jianyun8023
Copy link
Contributor Author

/pulsarbot run-failure-checks

2 similar comments
@jianyun8023
Copy link
Contributor Author

/pulsarbot run-failure-checks

@jianyun8023
Copy link
Contributor Author

/pulsarbot run-failure-checks

@codelipenghui
Copy link
Contributor

@MarvinCai Could you please also help review this PR?

@codelipenghui codelipenghui mentioned this pull request Aug 5, 2020
14 tasks
@jianyun8023
Copy link
Contributor Author

/pulsarbot run-failure-checks

@jianyun8023
Copy link
Contributor Author

/pulsarbot run-failure-checks

Copy link
Contributor

@MarvinCai MarvinCai left a 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

@jianyun8023
Copy link
Contributor Author

/pulsarbot run-failure-checks

Copy link
Contributor

@codelipenghui codelipenghui left a 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.

@jianyun8023
Copy link
Contributor Author

/pulsarbot run-failure-checks

@codelipenghui codelipenghui merged commit 824cb08 into apache:master Aug 11, 2020
Copy link
Contributor

@zhanghaou zhanghaou left a 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();
Copy link
Contributor

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.

Copy link
Contributor Author

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();
Copy link
Contributor

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();
Copy link
Contributor

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.
Copy link
Contributor

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.
Copy link
Contributor

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.

huangdx0726 pushed a commit to huangdx0726/pulsar that referenced this pull request Aug 24, 2020
### 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.
lbenc135 pushed a commit to lbenc135/pulsar that referenced this pull request Sep 5, 2020
### 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.
lbenc135 pushed a commit to lbenc135/pulsar that referenced this pull request Sep 5, 2020
### 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.
lbenc135 pushed a commit to lbenc135/pulsar that referenced this pull request Sep 5, 2020
### 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.
@jianyun8023 jianyun8023 deleted the retention-on-topic-level branch April 15, 2022 01:08
AlvaroStream added a commit to AlvaroStream/pulsar-site that referenced this pull request Jun 28, 2023
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/feature The PR added a new feature or issue requested a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants