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: [email protected]

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


Reply via email to