jianyun8023 commented on a change in pull request #7747:
URL: https://github.com/apache/pulsar/pull/7747#discussion_r466305574



##########
File path: 
pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdTopics.java
##########
@@ -880,4 +884,65 @@ void run() throws PulsarAdminException {
             admin.topics().removeBacklogQuota(persistentTopic);
         }
     }
+
+    @Parameters(commandDescription = "Get the retention policy for a topic")
+    private class GetRetention extends CliCommand {
+        @Parameter(description = "persistent://tenant/namespace/topic", 
required = true)
+        private java.util.List<String> params;
+
+        @Override
+        void run() throws PulsarAdminException {
+            String persistentTopic = validatePersistentTopic(params);
+            print(admin.topics().getRetention(persistentTopic));
+        }
+    }
+
+    @Parameters(commandDescription = "Set the retention policy for a topic")
+    private class SetRetention extends CliCommand {
+        @Parameter(description = "persistent://tenant/namespace/topic", 
required = true)
+        private java.util.List<String> params;
+
+        @Parameter(names = { "--time",
+                "-t" }, description = "Retention time in minutes (or minutes, 
hours,days,weeks eg: 100m, 3h, 2d, 5w). "

Review comment:
       I refer to the namespace cmd  `CmdNamespaces.SetRetention`. If you want 
to revise, I suggest open an issue for unified modification




----------------------------------------------------------------
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.

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


Reply via email to