You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/01/29 05:24:19 UTC

[GitHub] [pulsar] 315157973 opened a new pull request #9362: Support get topic applied policy for Retention

315157973 opened a new pull request #9362:
URL: https://github.com/apache/pulsar/pull/9362


   Master Issue: #9216
   ### Modifications
   1. Add applied API
   2. Add remove API
   
   ### Verifying this change
   1. Test whether the priority is correct when policies of different levels exist at the same time
   2. Test applied API works


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] 315157973 commented on a change in pull request #9362: Support get topic applied policy for Retention

Posted by GitBox <gi...@apache.org>.
315157973 commented on a change in pull request #9362:
URL: https://github.com/apache/pulsar/pull/9362#discussion_r567248478



##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java
##########
@@ -2025,7 +2025,7 @@ private boolean shouldTopicBeRetained() {
         long retentionTime = TimeUnit.MINUTES.toNanos(retentionPolicies.getRetentionTimeInMinutes());
         // Negative retention time means the topic should be retained indefinitely,
         // because its own data has to be retained
-        return retentionTime < 0 || (System.nanoTime() - lastActive) < retentionTime;
+        return retentionTime <= 0 || (System.nanoTime() - lastActive) < retentionTime;

Review comment:
       OK, the status will like this:
   ```
   null: not retained
   = 0: not retained
   <0: retained indefinitely
   > 0: retained as required
   ```




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] Renkai commented on pull request #9362: Support get topic applied policy for Retention

Posted by GitBox <gi...@apache.org>.
Renkai commented on pull request #9362:
URL: https://github.com/apache/pulsar/pull/9362#issuecomment-770156996


   /pulsarbot run-failure-checks


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] 315157973 commented on a change in pull request #9362: Support get topic applied policy for Retention

Posted by GitBox <gi...@apache.org>.
315157973 commented on a change in pull request #9362:
URL: https://github.com/apache/pulsar/pull/9362#discussion_r567248478



##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java
##########
@@ -2025,7 +2025,7 @@ private boolean shouldTopicBeRetained() {
         long retentionTime = TimeUnit.MINUTES.toNanos(retentionPolicies.getRetentionTimeInMinutes());
         // Negative retention time means the topic should be retained indefinitely,
         // because its own data has to be retained
-        return retentionTime < 0 || (System.nanoTime() - lastActive) < retentionTime;
+        return retentionTime <= 0 || (System.nanoTime() - lastActive) < retentionTime;

Review comment:
       OK, the status will like this:
   null: not retained
   = 0: not retained
   <0: retained indefinitely
   > 0: retained as required
   




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] 315157973 commented on a change in pull request #9362: Support get topic applied policy for Retention

Posted by GitBox <gi...@apache.org>.
315157973 commented on a change in pull request #9362:
URL: https://github.com/apache/pulsar/pull/9362#discussion_r567248478



##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java
##########
@@ -2025,7 +2025,7 @@ private boolean shouldTopicBeRetained() {
         long retentionTime = TimeUnit.MINUTES.toNanos(retentionPolicies.getRetentionTimeInMinutes());
         // Negative retention time means the topic should be retained indefinitely,
         // because its own data has to be retained
-        return retentionTime < 0 || (System.nanoTime() - lastActive) < retentionTime;
+        return retentionTime <= 0 || (System.nanoTime() - lastActive) < retentionTime;

Review comment:
       OK, the status will like this:
   ```
   null: not set
   = 0: not retained
   < 0: retained indefinitely
   > 0: retained as required
   ```




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] codelipenghui commented on a change in pull request #9362: Support get topic applied policy for Retention

Posted by GitBox <gi...@apache.org>.
codelipenghui commented on a change in pull request #9362:
URL: https://github.com/apache/pulsar/pull/9362#discussion_r567244091



##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java
##########
@@ -2025,7 +2025,7 @@ private boolean shouldTopicBeRetained() {
         long retentionTime = TimeUnit.MINUTES.toNanos(retentionPolicies.getRetentionTimeInMinutes());
         // Negative retention time means the topic should be retained indefinitely,
         // because its own data has to be retained
-        return retentionTime < 0 || (System.nanoTime() - lastActive) < retentionTime;
+        return retentionTime <= 0 || (System.nanoTime() - lastActive) < retentionTime;

Review comment:
       If the `retentionTime` is `0`, we should not retain the data for the topic




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] codelipenghui merged pull request #9362: Support get topic applied policy for Retention

Posted by GitBox <gi...@apache.org>.
codelipenghui merged pull request #9362:
URL: https://github.com/apache/pulsar/pull/9362


   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org