dariuszseweryn commented on code in PR #9995:
URL: https://github.com/apache/nifi/pull/9995#discussion_r2142431359
##########
nifi-extension-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/kinesis/stream/pause/StandardRecordProcessorBlocker.java:
##########
@@ -17,19 +17,57 @@
package org.apache.nifi.processors.aws.kinesis.stream.pause;
import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+import java.util.function.Supplier;
+/**
+ * Standard implementation of {@link RecordProcessorBlocker} that allows
blocking calls to {@link #await()} by:
+ * <ul>
+ * <li>explicit call to {@link #block()}</li>
+ * <li>timeout since last call to {@link #unblock()}</li>
+ * </ul>
+ * Unblocking is done by calling {@link #unblock()} or {@link
#unblockAndDisableTimeout()}. The latter is used to disable the timeout
mechanism to allow shutdown of background threads that could
+ * otherwise block indefinitely due to no calls to {@link #unblock()}.
+ */
public class StandardRecordProcessorBlocker implements RecordProcessorBlocker {
private CountDownLatch blocker = new CountDownLatch(0);
+ static final long BLOCK_AFTER_TIMEOUT_MILLIS =
TimeUnit.SECONDS.toMillis(2);
+ private final Supplier<Long> timestampProvider;
+ private long timeoutAnchor = 0L;
Review Comment:
Renamed to `timeoutBase`
--
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]