jiafu1115 commented on code in PR #20913:
URL: https://github.com/apache/kafka/pull/20913#discussion_r3259526773
##########
storage/src/main/java/org/apache/kafka/storage/internals/log/LogConfig.java:
##########
@@ -406,6 +418,15 @@ public Boolean remoteLogCopyDisable() {
return remoteLogConfig.remoteLogCopyDisable;
}
+
+ public long remoteCopyLagMs() {
+ return remoteLogConfig.remoteCopyLagMs == MAX_REMOTE_COPY_LAG_MS ?
localRetentionMs() : remoteLogConfig.remoteCopyLagMs;
+ }
+
+ public long remoteCopyLagBytes() {
+ return remoteLogConfig.remoteCopyLagBytes == MAX_REMOTE_COPY_LAG_BYTES
? localRetentionBytes() : remoteLogConfig.remoteCopyLagBytes;
Review Comment:
@kamalcph if I can move your followed code into here as this style
long effectiveCopyLagBytes = logConfig.remoteCopyLagBytes();
// derive the value from local retention size when copyLagBytes configured
to -1
if (effectiveCopyLagBytes == -1L) {
effectiveCopyLagBytes = logConfig.localRetentionBytes();
// if the local retention size is configured to infinite, then
configure copyLagBytes as infinite
if (effectiveCopyLagBytes == -1L) {
effectiveCopyLagBytes = Long.MAX_VALUE;
}
}
--
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]