Skip to content

[pulsar-admin] Check validity of --compatibility for namespace - #12483

Merged
eolivelli merged 1 commit into
apache:masterfrom
yuruguo:check-legality-of-schema-compatibility-strategy-for-namespace
Oct 28, 2021
Merged

[pulsar-admin] Check validity of --compatibility for namespace#12483
eolivelli merged 1 commit into
apache:masterfrom
yuruguo:check-legality-of-schema-compatibility-strategy-for-namespace

Conversation

@yuruguo

@yuruguo yuruguo commented Oct 25, 2021

Copy link
Copy Markdown
Contributor

Motivation

We should check the validity of the --compatibility and give a more friendly prompt message when set schema compatibility strategy for namespace through ./bin/pulsar-admin namespaces set-schema-compatibility-strategy.
Currently, the lack of verification for --compatibility will directly display the exception, as below:

./bin/pulsar-admin namespaces set-schema-compatibility-strategy -c ALWAYS_COMPATIBE tenant1/ns1
java.lang.IllegalArgumentException: No enum constant org.apache.pulsar.common.policies.data.SchemaCompatibilityStrategy.ALWAYS_COMPATIBE
	at java.lang.Enum.valueOf(Enum.java:238)
	at org.apache.pulsar.common.policies.data.SchemaCompatibilityStrategy.valueOf(SchemaCompatibilityStrategy.java:24)
	at org.apache.pulsar.admin.cli.CmdNamespaces$SetSchemaCompatibilityStrategy.run(CmdNamespaces.java:1833)
	at org.apache.pulsar.admin.cli.CmdBase.run(CmdBase.java:86)
	at org.apache.pulsar.admin.cli.PulsarAdminTool.run(PulsarAdminTool.java:282)
	at org.apache.pulsar.admin.cli.PulsarAdminTool.main(PulsarAdminTool.java:329)

Modifications

  • Throw ParameterException when IllegalArgumentException occurs when executing SchemaCompatibilityStrategy.valueOf()

Documentation

Automatically generate doc through code

  • doc

@eolivelli eolivelli added the doc Your PR contains doc changes, no matter whether the changes are in markdown or code files. label Oct 25, 2021

@eolivelli eolivelli left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Lgtm

@yuruguo you don't need to tag so many people.
Github is open to everyone and who has time to do some reviews will be happy to review your code.

If you want you can ping me on slack using DM

@eolivelli
eolivelli merged commit 030358e into apache:master Oct 28, 2021
@yuruguo

yuruguo commented Oct 28, 2021

Copy link
Copy Markdown
Contributor Author

Lgtm

@yuruguo you don't need to tag so many people. Github is open to everyone and who has time to do some reviews will be happy to review your code.

If you want you can ping me on slack using DM

I'm sorry to interrupt you, because many PRs I submitted have been in unreviewed state or the number of approved people (at least two) is not enough for a long time, so I ping many person. I will pay attention to this later.
In addition, thank you very much for telling me the way of communication, I will try to use it later :).

zeo1995 pushed a commit to zeo1995/pulsar that referenced this pull request Oct 28, 2021
* up/master:
  [pulsar-admin] Check validity of --compatibility for namespace (apache#12483)
  [website][upgrade]feat: version list page (apache#12511)
eolivelli pushed a commit to eolivelli/pulsar that referenced this pull request Nov 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc Your PR contains doc changes, no matter whether the changes are in markdown or code files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants