lucperkins commented on a change in pull request #1865: CLI for offload
URL: https://github.com/apache/incubator-pulsar/pull/1865#discussion_r191881982
##########
File path:
pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdTopics.java
##########
@@ -614,6 +618,93 @@ void run() throws PulsarAdminException {
}
}
+ static MessageId
findFirstLedgerWithinThreshold(List<PersistentTopicInternalStats.LedgerInfo>
ledgers,
+ long sizeThreshold) {
+ long suffixSize = 0L;
+
+ ledgers = Lists.reverse(ledgers);
+ for (PersistentTopicInternalStats.LedgerInfo l : ledgers) {
+ suffixSize += l.size;
+ if (suffixSize >= sizeThreshold) {
+ return new MessageIdImpl(l.ledgerId, 0L, -1);
+ }
+ }
+ return null;
+ }
+
+ @Parameters(commandDescription = "Trigger offload data from a topic to
long term storage")
+ private class Offload extends CliCommand {
+ @Parameter(names = { "-s", "--size-threshold" },
+ description = "Max amount of data to keep in bookkeeper for
topic", required = true)
Review comment:
"Max amount of data to keep in BookKeeper for the specified topic"
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services