Skip to content
This repository has been archived by the owner on Apr 1, 2024. It is now read-only.

Commit

Permalink
[improve][admin] Expose the offload threshold in seconds to the amdin (
Browse files Browse the repository at this point in the history
  • Loading branch information
zymap authored Feb 23, 2024
1 parent 5a614e9 commit 48c7e32
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1941,7 +1941,8 @@ private class GetOffloadThreshold extends CliCommand {
@Override
void run() throws PulsarAdminException {
String namespace = validateNamespace(params);
print(getAdmin().namespaces().getOffloadThreshold(namespace));
print("offloadThresholdInBytes: " + getAdmin().namespaces().getOffloadThreshold(namespace));
print("offloadThresholdInSeconds: " + getAdmin().namespaces().getOffloadThresholdInSeconds(namespace));
}
}

Expand All @@ -1960,10 +1961,17 @@ private class SetOffloadThreshold extends CliCommand {
converter = ByteUnitToLongConverter.class)
private Long threshold = -1L;

@Parameter(names = {"--time", "-t"},
description = "Maximum number of seconds stored on the pulsar cluster for a topic"
+ " before the broker will start offloading to longterm storage (eg: 10m, 5h, 3d, 2w).",
converter = TimeUnitToSecondsConverter.class)
private Long thresholdInSeconds = -1L;

@Override
void run() throws PulsarAdminException {
String namespace = validateNamespace(params);
getAdmin().namespaces().setOffloadThreshold(namespace, threshold);
getAdmin().namespaces().setOffloadThresholdInSeconds(namespace, thresholdInSeconds);
}
}

Expand Down

0 comments on commit 48c7e32

Please sign in to comment.