liangyepianzhou commented on code in PR #22022:
URL: https://github.com/apache/pulsar/pull/22022#discussion_r1477725357


##########
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/ManagedLedgerConfig.java:
##########
@@ -411,7 +411,8 @@ public ManagedLedgerConfig setThrottleMarkDelete(double 
throttleMarkDelete) {
      *            time unit for retention time
      */
     public ManagedLedgerConfig setRetentionTime(int retentionTime, TimeUnit 
unit) {
-        this.retentionTimeMs = unit.toMillis(retentionTime);
+        // unit.toMillis(-1) = -60000
+        this.retentionTimeMs = retentionTime != -1 ? 
unit.toMillis(retentionTime) : -1;

Review Comment:
   If the result does not match the input, it will be confusing, right?



##########
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/ManagedLedgerConfig.java:
##########
@@ -411,7 +411,8 @@ public ManagedLedgerConfig setThrottleMarkDelete(double 
throttleMarkDelete) {
      *            time unit for retention time
      */
     public ManagedLedgerConfig setRetentionTime(int retentionTime, TimeUnit 
unit) {
-        this.retentionTimeMs = unit.toMillis(retentionTime);
+        // unit.toMillis(-1) = -60000
+        this.retentionTimeMs = retentionTime != -1 ? 
unit.toMillis(retentionTime) : -1;

Review Comment:
   @gaoran10 @BewareMyPower Thanks for this catch. I delete this modification 
in this PR. 
   We can discuss this in the another 
[PR](https://github.com/apache/pulsar/pull/22023).



-- 
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]

Reply via email to