use of com.yahoo.pulsar.common.policies.data.RetentionPolicies in project pulsar by yahoo.
the class Namespaces method getRetention.
@GET
@Path("/{property}/{cluster}/{namespace}/retention")
@ApiOperation(value = "Get retention config on a namespace.")
@ApiResponses(value = { @ApiResponse(code = 403, message = "Don't have admin permission"), @ApiResponse(code = 404, message = "Namespace does not exist") })
public RetentionPolicies getRetention(@PathParam("property") String property, @PathParam("cluster") String cluster, @PathParam("namespace") String namespace) {
validateAdminAccessOnProperty(property);
Policies policies = getNamespacePolicies(property, cluster, namespace);
if (policies.retention_policies == null) {
return new RetentionPolicies(config().getDefaultRetentionTimeInMinutes(), config().getDefaultRetentionSizeInMB());
} else {
return policies.retention_policies;
}
}
Aggregations