Skip to content

Commit

Permalink
[fix][broker] Fix RetentionPolicies types mismatch. (apache#18114)
Browse files Browse the repository at this point in the history
  • Loading branch information
Technoboy- authored Oct 23, 2022
1 parent 845d992 commit c55be38
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public class ManagedLedgerConfig {
private int ledgerRolloverTimeout = 4 * 3600;
private double throttleMarkDelete = 0;
private long retentionTimeMs = 0;
private long retentionSizeInMB = 0;
private int retentionSizeInMB = 0;
private boolean autoSkipNonRecoverableData;
private boolean lazyCursorRecovery = false;
private long metadataOperationsTimeoutSeconds = 60;
Expand Down Expand Up @@ -392,7 +392,7 @@ public ManagedLedgerConfig setThrottleMarkDelete(double throttleMarkDelete) {
/**
* Set the retention time for the ManagedLedger.
* <p>
* Retention time and retention size ({@link #setRetentionSizeInMB(long)}) are together used to retain the
* Retention time and retention size ({@link #setRetentionSizeInMB(int)}) are together used to retain the
* ledger data when there are no cursors or when all the cursors have marked the data for deletion.
* Data will be deleted in this case when both retention time and retention size settings don't prevent deleting
* the data marked for deletion.
Expand Down Expand Up @@ -434,7 +434,7 @@ public long getRetentionTimeMillis() {
* @param retentionSizeInMB
* quota for message retention
*/
public ManagedLedgerConfig setRetentionSizeInMB(long retentionSizeInMB) {
public ManagedLedgerConfig setRetentionSizeInMB(int retentionSizeInMB) {
this.retentionSizeInMB = retentionSizeInMB;
return this;
}
Expand All @@ -443,7 +443,7 @@ public ManagedLedgerConfig setRetentionSizeInMB(long retentionSizeInMB) {
* @return quota for message retention
*
*/
public long getRetentionSizeInMB() {
public int getRetentionSizeInMB() {
return retentionSizeInMB;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public void TestConsumedLedgersTrim() throws Exception {
PersistentTopic persistentTopic = (PersistentTopic) pulsar.getBrokerService().getOrCreateTopic(topicName).get();

ManagedLedgerConfig managedLedgerConfig = persistentTopic.getManagedLedger().getConfig();
managedLedgerConfig.setRetentionSizeInMB(1L);
managedLedgerConfig.setRetentionSizeInMB(1);
managedLedgerConfig.setRetentionTime(1, TimeUnit.SECONDS);
managedLedgerConfig.setMaxEntriesPerLedger(2);
managedLedgerConfig.setMinimumRolloverTime(1, TimeUnit.MILLISECONDS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
*/
public class RetentionPolicies {
private int retentionTimeInMinutes;
private long retentionSizeInMB;
private int retentionSizeInMB;

public RetentionPolicies() {
this(0, 0);
Expand All @@ -44,7 +44,7 @@ public int getRetentionTimeInMinutes() {
return retentionTimeInMinutes;
}

public long getRetentionSizeInMB() {
public int getRetentionSizeInMB() {
return retentionSizeInMB;
}

Expand Down

0 comments on commit c55be38

Please sign in to comment.