nodece commented on code in PR #18218:
URL: https://github.com/apache/pulsar/pull/18218#discussion_r1010197640
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java:
##########
@@ -2088,6 +2088,57 @@ public void setOffloadThreshold(@PathParam("tenant")
String tenant,
internalSetOffloadThreshold(newThreshold);
}
+ @GET
+ @Path("/{tenant}/{namespace}/offloadThresholdInSeconds")
+ @ApiOperation(value = "Maximum number of bytes stored on the pulsar
cluster for a topic,"
+ + " before the broker will start offloading to longterm storage",
+ notes = "A negative value disables automatic offloading")
+ @ApiResponses(value = { @ApiResponse(code = 403, message = "Don't have
admin permission"),
+ @ApiResponse(code = 404, message = "Namespace doesn't exist") })
+ public void getOffloadThresholdInSeconds(
+ @Suspended final AsyncResponse asyncResponse,
+ @PathParam("tenant") String tenant,
+ @PathParam("namespace") String namespace) {
+ validateNamespaceName(tenant, namespace);
+ validateNamespacePolicyOperationAsync(namespaceName,
PolicyName.OFFLOAD, PolicyOperation.READ)
+ .thenCompose(__ -> getNamespacePoliciesAsync(namespaceName))
+ .thenAccept(policies -> {
+ if (policies.offload_policies == null) {
Review Comment:
```suggestion
if (policies.offload_policies != null) {
```
--
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]