315157973 commented on a change in pull request #13445: URL: https://github.com/apache/pulsar/pull/13445#discussion_r774519247
########## File path: pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdTopicPolicies.java ########## @@ -118,6 +124,104 @@ void run() throws PulsarAdminException { } } + @Parameters(commandDescription = "Get the backlog quota policies for a topic") + private class GetBacklogQuotaMap extends CliCommand { + @Parameter(description = "persistent://tenant/namespace/topic", required = true) + private java.util.List<String> params; + + @Parameter(names = {"-ap", "--applied"}, description = "Get the applied policy of the topic") + private boolean applied = false; + + @Parameter(names = { "--global", "-g" }, description = "Whether to get this policy globally. " + + "If set to true, broker returned global topic policies", arity = 0) + private boolean isGlobal = false; + + @Override + void run() throws PulsarAdminException { + String persistentTopic = validatePersistentTopic(params); + print(getTopicPolicies(isGlobal).getBacklogQuotaMap(persistentTopic, applied)); + } + } + + @Parameters(commandDescription = "Set a backlog quota policy for a topic") + private class SetBacklogQuota extends CliCommand { + @Parameter(description = "persistent://tenant/namespace/topic", required = true) + private java.util.List<String> params; + + @Parameter(names = { "-l", "--limit" }, description = "Size limit (eg: 10M, 16G)") + private String limitStr = "-1"; + + @Parameter(names = { "-lt", "--limitTime" }, description = "Time limit in second, non-positive number for disabling time limit.") + private int limitTime = -1; + + @Parameter(names = { "-p", "--policy" }, description = "Retention policy to enforce when the limit is reached. " + + "Valid options are: [producer_request_hold, producer_exception, consumer_backlog_eviction]", required = true) + private String policyStr; Review comment: Same as above -- 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-unsubscr...@pulsar.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org