jeqo commented on code in PR #13561:
URL: https://github.com/apache/kafka/pull/13561#discussion_r1299988151


##########
core/src/main/java/kafka/log/remote/RemoteLogManager.java:
##########
@@ -1096,6 +1493,43 @@ public void close() {
         }
     }
 
+    // Visible for testing
+    public static class RetentionSizeData {
+        private final long retentionSize;
+        private final long remainingBreachedSize;
+
+        public RetentionSizeData(long retentionSize, long 
remainingBreachedSize) {
+            if (retentionSize < 0)
+                throw new IllegalArgumentException("retentionSize should be 
non negative, but it is " + retentionSize);
+
+            if (remainingBreachedSize <= 0) {
+                throw new IllegalArgumentException("remainingBreachedSize 
should be more than zero, but it is " + remainingBreachedSize);
+            }
+
+            this.retentionSize = retentionSize;
+            this.remainingBreachedSize = remainingBreachedSize;
+        }
+    }
+
+    // Visible for testing
+    public static class RetentionTimeData {
+
+        private final long retentionMs;
+        private final long cleanupUntilMs;
+
+        public RetentionTimeData(long retentionMs, long cleanupUntilMs) {
+            if (retentionMs < 0)
+                throw new IllegalArgumentException("retentionMs should be non 
negative, but it is " + retentionMs);
+
+            if (retentionMs < cleanupUntilMs) {

Review Comment:
   Similar to the previous comment on RentetionSizeData: `cleanupUntilMs` 
represents a point in time (`now - retentionMs`), while `retentionMs` 
represents a duration (e.g. 1 week in millis). Is this comparison 
correct/needed? If I'm reading this right, this will always be true.



-- 
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: jira-unsubscr...@kafka.apache.org

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

Reply via email to