Technoboy- commented on code in PR #24390:
URL: https://github.com/apache/pulsar/pull/24390#discussion_r2239744580


##########
pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdTopicPolicies.java:
##########
@@ -1993,6 +1998,67 @@ void run() throws PulsarAdminException {
         }
     }
 
+    @Command(description = "Set the replication clusters for a topic, global 
policy will be copied to the remote"
+            + " cluster if you enabled namespace level replication.")
+    private class SetReplicationClusters extends CliCommand {
+        @Parameters(description = "persistent://tenant/namespace/topic", arity 
= "1")
+        private String topicName;
+
+        @Option(names = { "--clusters",
+                "-c" }, description = "Replication Cluster Ids list (comma 
separated values)", required = true)
+        private String clusterIds;
+
+        @Option(names = { "--global", "-g" }, description = "Whether to set 
this policy globally. "
+                + "If set to true, the policy will be replicate to other 
clusters asynchronously")
+        private boolean isGlobal = false;
+
+        @Override
+        void run() throws PulsarAdminException {
+            String persistentTopic = validatePersistentTopic(topicName);
+            List<String> clusters = Lists.newArrayList(clusterIds.split(","));
+            getTopicPolicies(isGlobal).setReplicationClusters(persistentTopic, 
clusters);
+        }
+    }
+
+    @Command(description = "Get the replication clusters for a topic")
+    private class GetReplicationClusters extends CliCommand {
+        @Parameters(description = "persistent://tenant/namespace/topic", arity 
= "1")
+        private String topicName;
+
+        @Option(names = { "-ap", "--applied" }, description = "Get the applied 
policy of the topic. If set to true,"
+                + " the param \"--global\" will be ignored. ")
+        private boolean applied = false;
+
+        @Option(names = { "--global", "-g" }, description = "Whether to get 
this policy globally. "
+                + "If set to true, the policy will be replicate to other 
clusters asynchronously. "

Review Comment:
   is this description right ?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to