codelipenghui commented on code in PR #17398:
URL: https://github.com/apache/pulsar/pull/17398#discussion_r995276900
##########
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java:
##########
@@ -2370,11 +2370,13 @@ private void
maybeOffloadInBackground(CompletableFuture<PositionImpl> promise) {
final long offloadThresholdInSeconds =
Optional.ofNullable(policies.getManagedLedgerOffloadThresholdInSeconds()).orElse(-1L);
if (offloadThresholdInBytes >= 0 || offloadThresholdInSeconds >= 0) {
- executor.executeOrdered(name, safeRun(() ->
maybeOffload(promise)));
+ executor.executeOrdered(name,
+ safeRun(() -> maybeOffload(offloadThresholdInBytes,
offloadThresholdInSeconds, promise)));
}
}
- private void maybeOffload(CompletableFuture<PositionImpl> finalPromise) {
+ private void maybeOffload(long offloadThresholdInBytes, long
offloadThresholdInSeconds,
+ CompletableFuture<PositionImpl> finalPromise) {
Review Comment:
We should check the offloadThresholdInBytes>0 and
offloadThresholdInSeconds>0? Because it's unexpected, who are using this method
should not provide the negative number of these 2 params.
--
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]