@@ -988,14 +988,21 @@ public DispatchRate getReplicatorDispatchRate(@PathParam("tenant") String tenant
988
988
@ ApiOperation (hidden = true , value = "Get backlog quota map on a namespace." )
989
989
@ ApiResponses (value = { @ ApiResponse (code = 403 , message = "Don't have admin permission" ),
990
990
@ ApiResponse (code = 404 , message = "Namespace does not exist" ) })
991
- public Map <BacklogQuotaType , BacklogQuota > getBacklogQuotaMap (@ PathParam ("property" ) String property ,
991
+ public void getBacklogQuotaMap (
992
+ @ Suspended final AsyncResponse asyncResponse ,
993
+ @ PathParam ("property" ) String property ,
992
994
@ PathParam ("cluster" ) String cluster , @ PathParam ("namespace" ) String namespace ) {
993
995
validateNamespaceName (property , cluster , namespace );
994
- validateNamespacePolicyOperation (NamespaceName .get (property , namespace ),
995
- PolicyName .BACKLOG , PolicyOperation .READ );
996
-
997
- Policies policies = getNamespacePolicies (namespaceName );
998
- return policies .backlog_quota_map ;
996
+ validateNamespacePolicyOperationAsync (NamespaceName .get (property , namespace ), PolicyName .BACKLOG ,
997
+ PolicyOperation .READ )
998
+ .thenCompose (__ -> getNamespacePoliciesAsync (namespaceName ))
999
+ .thenAccept (policies -> asyncResponse .resume (policies .backlog_quota_map ))
1000
+ .exceptionally (ex -> {
1001
+ log .error ("[{}] Failed to get backlog quota map on namespace {}:{}" , clientAppId (), namespaceName ,
1002
+ ex .getCause ().getMessage (), ex );
1003
+ resumeAsyncResponseExceptionally (asyncResponse , ex );
1004
+ return null ;
1005
+ });
999
1006
}
1000
1007
1001
1008
@ POST
0 commit comments