mattisonchao commented on code in PR #17383:
URL: https://github.com/apache/pulsar/pull/17383#discussion_r960266889
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java:
##########
@@ -1173,11 +1177,32 @@ public void getBacklogQuotaMap(
@ApiResponse(code = 412,
message = "Specified backlog quota exceeds retention
quota."
+ " Increase retention quota and retry request")})
- public void setBacklogQuota(@PathParam("tenant") String tenant,
@PathParam("namespace") String namespace,
- @QueryParam("backlogQuotaType") BacklogQuotaType backlogQuotaType,
- @ApiParam(value = "Backlog quota for all topics of the specified
namespace") BacklogQuota backlogQuota) {
+ public void setBacklogQuota(@Suspended final AsyncResponse asyncResponse,
+ @PathParam("tenant") String tenant,
+ @PathParam("namespace") String namespace,
+ @QueryParam("backlogQuotaType")
BacklogQuotaType backlogQuotaType,
+ @ApiParam(value = "Backlog quota for all
topics of the specified namespace")
+ BacklogQuota backlogQuota) {
validateNamespaceName(tenant, 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(),
+ namespaceName, jsonQuota);
Review Comment:
fixed
--
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]