Is your feature request related to a problem? Please describe.
CLI bin/pulsar-admin supports set-clusters and get-clusters command so that we can set / get replication clusters for a namespace. But it lacks corresponding remove-clusters command to restore to the unset state, I think it is necessary to add this command to ensure the closed-loop operation of the replication cluster.
Describe the solution you'd like
In Client Side
Add a inner class RemoveReplicationClusters in CmdNamespaces.java as below:
Is your feature request related to a problem? Please describe. CLI
bin/pulsar-admin
supportsset-clusters
andget-clusters
command so that we canset
/get
replication clusters for a namespace. But it lacks correspondingremove-clusters
command to restore to the unset state, I think it is necessary to add this command to ensure the closed-loop operation of the replication cluster.Describe the solution you'd like
In Client Side
Add a inner class
RemoveReplicationClusters
in CmdNamespaces.java as below:Then add two methods
removeNamespaceReplicationClusters
andremoveNamespaceReplicationClustersAsync
in Namespaces.java as below:and implement them by calling an asynchronous delete request in NamespacesImpl.java as below:
In Server Side
Add method
removeNamespaceReplicationClusters
in v1/Namespaces.java and v2/Namespaces.java as below:and they can reuse the
internalSetNamespaceReplicationClusters
method directly in NamespacesBase.java, just pass aempty List
. The important thing isreplicationClusterSet
in methodinternalSetNamespaceReplicationClusters
should be consistent with the initial value When creating replication clusters, its value isempty Set
in v1/namespace as below: https://github.com/apache/pulsar/blob/9994614173205abd075fcc670396cebd71227047/pulsar-client-admin-api/src/main/java/org/apache/pulsar/common/policies/data/Policies.java#L38 and its value islocal cluster
in v2/namespace as below: https://github.com/apache/pulsar/blob/9994614173205abd075fcc670396cebd71227047/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java#L2025-L2029 So we modify the value ofreplicationClusterSet
in methodinternalSetNamespaceReplicationClusters
but this will not affect this method as below: