Skip to content

Commit

Permalink
add feature: enable maxSizePerLedger settings in configuration (apach…
Browse files Browse the repository at this point in the history
…e#7085)

* add feature: enable maxSizePerLedger settings in configuration

* add feature: enable maxSizePerLedger settings in configuration

Co-authored-by: wuzhanpeng <[email protected]>
  • Loading branch information
wuzhanpeng and wuzhanpeng authored May 31, 2020
1 parent 7471786 commit 0f5ffbf
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions conf/broker.conf
Original file line number Diff line number Diff line change
Expand Up @@ -710,6 +710,9 @@ managedLedgerMinLedgerRolloverTimeMinutes=10
# Maximum time before forcing a ledger rollover for a topic
managedLedgerMaxLedgerRolloverTimeMinutes=240

# Maximum ledger size before triggering a rollover for a topic (MB)
managedLedgerMaxSizePerLedgerMbytes=2048

# Delay between a ledger being successfully offloaded to long term storage
# and the ledger being deleted from bookkeeper (default is 4 hours)
managedLedgerOffloadDeletionLagMs=14400000
Expand Down
3 changes: 3 additions & 0 deletions conf/standalone.conf
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,9 @@ managedLedgerCursorMaxEntriesPerLedger=50000
# Max time before triggering a rollover on a cursor ledger
managedLedgerCursorRolloverTimeInSeconds=14400

# Maximum ledger size before triggering a rollover for a topic (MB)
managedLedgerMaxSizePerLedgerMbytes=2048

# Max number of "acknowledgment holes" that are going to be persistently stored.
# When acknowledging out of order, a consumer will leave holes that are supposed
# to be quickly filled by acking all the messages. The information of which
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1110,6 +1110,11 @@ public class ServiceConfiguration implements PulsarConfiguration {
doc = "Maximum time before forcing a ledger rollover for a topic"
)
private int managedLedgerMaxLedgerRolloverTimeMinutes = 240;
@FieldContext(
category = CATEGORY_STORAGE_ML,
doc = "Maximum ledger size before triggering a rollover for a topic (MB)"
)
private int managedLedgerMaxSizePerLedgerMbytes = 2048;
@FieldContext(
category = CATEGORY_STORAGE_OFFLOADING,
doc = "Delay between a ledger being successfully offloaded to long term storage,"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1043,7 +1043,7 @@ public CompletableFuture<ManagedLedgerConfig> getManagedLedgerConfig(TopicName t
TimeUnit.MINUTES);
managedLedgerConfig.setMaximumRolloverTime(serviceConfig.getManagedLedgerMaxLedgerRolloverTimeMinutes(),
TimeUnit.MINUTES);
managedLedgerConfig.setMaxSizePerLedgerMb(2048);
managedLedgerConfig.setMaxSizePerLedgerMb(serviceConfig.getManagedLedgerMaxSizePerLedgerMbytes());

managedLedgerConfig.setMetadataOperationsTimeoutSeconds(
serviceConfig.getManagedLedgerMetadataOperationsTimeoutSeconds());
Expand Down

0 comments on commit 0f5ffbf

Please sign in to comment.