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

Add command topic Deduplication(#246) #408

Merged
merged 2 commits into from
Aug 4, 2021

Conversation

limingnihao
Copy link
Contributor

Add command topic Deduplication:

  • pulsarctl topics get-deduplication [topic]
  • pulsarctl topics set-deduplication [topic] -e
  • pulsarctl topics remove-deduplication [topic]

- pulsarctl topics get-deduplication [topic]
- pulsarctl topics set-deduplication [topic] -e
- pulsarctl topics remove-deduplication [topic]
@limingnihao limingnihao requested review from zymap and a team as code owners August 2, 2021 05:28
admin := cmdutils.NewPulsarClient()
err = admin.Topics().SetDeduplicationStatus(*topic, enable)
if err == nil {
vc.Command.Printf("Set the deduplication policy successfully for [%s]\n", topic.String())
Copy link
Member

Choose a reason for hiding this comment

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

Add the enable or disable in the output?

var examples []cmdutils.Example
msg := cmdutils.Example{
Desc: "Set the deduplication policy for a topic",
Command: "pulsarctl topics set-deduplication topic ",
Copy link
Member

Choose a reason for hiding this comment

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

Add the enable and the disable examples?

)

func TestDeduplicationStatus(t *testing.T) {
topicName := "persistent://public/default/test-deduplication-status-topic"
Copy link
Member

Choose a reason for hiding this comment

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

Could you please add a random suffix on the topic name? You can use the test.RandomSuffix()

Signed-off-by: limingnihao <limingnihao@live.com>
@zymap zymap merged commit a529093 into streamnative:master Aug 4, 2021
nodece pushed a commit that referenced this pull request Nov 12, 2021
* Add command topic Deduplication(#246)

- pulsarctl topics get-deduplication [topic]
- pulsarctl topics set-deduplication [topic] -e
- pulsarctl topics remove-deduplication [topic]

* Modify prompt

Signed-off-by: limingnihao <limingnihao@live.com>
(cherry picked from commit a529093)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants