streamnative / pulsarctl

a CLI for Apache Pulsar written in Go
Apache License 2.0
154 stars 68 forks source link

[Feature] Topic level policy support in pulsarctl #246

Open codelipenghui opened 4 years ago

codelipenghui commented 4 years ago

The topic level policy is planned to release 2.7.0 and there are some PRs already merged into the Pulsar master branch. The process of the topic level policy support in Pulsar can be found at https://github.com/apache/pulsar/issues/2688. It's better to support topic level policy in pulsarctl.

Append comand

Waiting for confirmation:

limingnihao commented 3 years ago

I will add MessageTTL [Get, Set, Remove].

limingnihao commented 3 years ago

I will add Max Producer [Get, Set, Remove], and Max Consumer [Get, Set, Remove].

limingnihao commented 3 years ago

I will add MaxUnackMessagesPerConsumer [Get, Set, Remove].

limingnihao commented 3 years ago

I will add MaxUnackMessagesPerSubscription [Get, Set, Remove]

limingnihao commented 3 years ago

I will add Persistence Policy [Get, Set, Remove]

limingnihao commented 3 years ago

I will add Delayed Delivery Policies [Get, Set, Remove]

limingnihao commented 3 years ago

I will add Backlog Quota [Get, Set, Remove]

limingnihao commented 3 years ago

I will add Message Dispatch Rate [Get, Set, Remove]

limingnihao commented 3 years ago

I will add Deduplication [Get, Set, Remove]

nodece commented 3 years ago

I will add Retention Policy [Get, Set, Remove]

nodece commented 3 years ago

I will add Backlog Quota [Get, Set, Remove]

flowchartsman commented 3 years ago

I added Publish Rate [Get, Set, Remove], even though it is not on the list :)

nodece commented 3 years ago

I will add Compaction Threshold [Get, Set, Remove].

flowchartsman commented 3 years ago

Is there some context on the deprecation of items 10 and 14? I had been working on a PR for topic-level offload policy, and I don't see any notes on deprecation in apache/pulsar#2688

nodece commented 3 years ago

@flowchartsman I updated description on this issue, you can found the deprecated commands on https://github.com/apache/pulsar/blob/master/pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdTopics.java#L215

flowchartsman commented 3 years ago

I am confused, now 10 is marked as done and 14 is deprecated?

flowchartsman commented 3 years ago

Inactive topic policy is listed as deprecated in CmdTopics.java, but I do not see a reference to offload policy. Unless someone has completed this work already, the link on 10 above is only to the manual offload command not to offload policy. I didn't see anyone claim it, so I had started the work to support namespace/topic offload policy in my spare time, and I don't see any commits that reference it. Is this work complete? Should I abandon my partial implementation?

nodece commented 3 years ago

Hi @flowchartsman, 10 and 14 should be deprecated, I added deprecated commands link. apology :)

I think we don't should to implement a deprecated command, what's your opinion?

flowchartsman commented 3 years ago

I am not sure this is correct. On further inspection, it would appear that neither offload policy nor inactive topic policy are deprecated. The deprecated commands appear to be specified by comments above newline-separated blocks of commands. Note that there are three such comments, corresponding to three such blocks of commands. Each command in the block is then repeated explicitly in initDeprecatedCommands(), and appear to be limited to:

nodece commented 3 years ago

You're right. We should to implement the all commands in https://github.com/apache/pulsar/blob/master/pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdTopics.java, and skip the deprecated commands.

If you are implementing the feature on issue, please let us known for avoid work conflicts.

nodece commented 3 years ago

Hello @codelipenghui and @zymap, I compared pulsar-admin topics and pulsarctl and sorted out the commands that need to be added to pulsarctl, if you are free, please help me to confirm, thanks.

nodece commented 3 years ago

I will implement the Inactive topic policy [Get, Set, Remove] feature.