nodece commented on code in PR #17383:
URL: https://github.com/apache/pulsar/pull/17383#discussion_r960223523
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v1/Namespaces.java:
##########
@@ -1161,12 +1168,31 @@ public void getBacklogQuotaMap(
@ApiResponse(code = 412, message = "Specified backlog quota
exceeds retention quota."
+ " Increase retention quota and retry request")})
public void setBacklogQuota(
+ @Suspended final AsyncResponse asyncResponse,
@PathParam("property") String property, @PathParam("cluster")
String cluster,
@PathParam("namespace") String namespace,
@QueryParam("backlogQuotaType") BacklogQuotaType backlogQuotaType,
BacklogQuota backlogQuota) {
validateNamespaceName(property, cluster, namespace);
- internalSetBacklogQuota(backlogQuotaType, backlogQuota);
+ validateNamespacePolicyOperationAsync(namespaceName,
PolicyName.BACKLOG, PolicyOperation.WRITE)
+ .thenCompose(__ -> validatePoliciesReadOnlyAccessAsync())
+ .thenCompose(__ ->
internalSetBacklogQuotaAsync(backlogQuotaType, backlogQuota))
+ .thenAccept(__ -> {
+ asyncResponse.resume(Response.noContent().build());
+ String jsonQuota;
+ try {
+ jsonQuota =
ObjectMapperFactory.getThreadLocal().writeValueAsString(backlogQuota);
+ } catch (JsonProcessingException e) {
+ jsonQuota = e.getMessage();
+ }
+ log.info("[{}] Successfully updated backlog quota map:
namespace={}, map={}", clientAppId(),
Review Comment:
Using `backlogQuota` should be working fine here.
--
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]