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

Support set property on a namespace. #10015

Merged

Conversation

codelipenghui
Copy link
Contributor

Motivation

Add support for set-property/get-property/remove-property on a namespace

Modifications

bin/pulsar-admin namespaces set-property
bin/pulsar-admin namespaces get-property
bin/pulsar-admin namespaces remove-property

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: (yes)
  • The schema: (no)
  • The default values of configurations: (no)
  • The wire protocol: (no)
  • The rest endpoints: (no)
  • The admin cli options: (no)
  • Anything that affects deployment: (no)

Documentation

  • Does this pull request introduce a new feature? (yes)

The document is generated automatically.

try {
final String path = path(POLICIES, namespaceName.toString());
updatePolicies(path, (policies) -> {
policies.properties.put(key, value);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to provide an option for overwriting the existing key?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overwriting the existing key is the default behavior. If we need to support prevent an update when the key exists, we can add it in the future.

@315157973
Copy link
Contributor

/pulsarbot run-failure-checks

Copy link
Member

@sijie sijie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@codelipenghui overall looks good. but it might be worth supporting set a map of key/value pairs together instead of individual keys.

@codelipenghui
Copy link
Contributor Author

@sijie Make sense, will add an endpoint to support multiple key-values.

@codelipenghui codelipenghui merged commit ae24e29 into apache:master Apr 27, 2021
@codelipenghui codelipenghui deleted the penghui/namespace_properties branch April 27, 2021 06:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants