You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/11/27 12:30:01 UTC

[GitHub] [pulsar] Jason918 commented on a change in pull request #13002: [pulsar-admin] Check the size options in cmd for topic and namespace

Jason918 commented on a change in pull request #13002:
URL: https://github.com/apache/pulsar/pull/13002#discussion_r757776625



##########
File path: pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdNamespaces.java
##########
@@ -1808,12 +1814,19 @@ void run() throws PulsarAdminException {
                    description = "Maximum number of bytes in a topic backlog before compaction is triggered "
                                  + "(eg: 10M, 16G, 3T). 0 disables automatic compaction",
                    required = true)
-        private String threshold = "0";
+        private String thresholdStr = "0";
 
         @Override
         void run() throws PulsarAdminException {
             String namespace = validateNamespace(params);
-            getAdmin().namespaces().setCompactionThreshold(namespace, validateSizeString(threshold));
+            long threshold;
+            try {
+                threshold = validateSizeString(thresholdStr);
+            } catch (IllegalArgumentException e) {

Review comment:
       I think it's better to put the exception convert into `validateSizeString`




-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org