Class BlockingObserverPollStrategy
- java.lang.Object
-
- com.linkedin.venice.unit.kafka.consumer.poll.AbstractPollStrategy
-
- com.linkedin.venice.unit.kafka.consumer.poll.BlockingObserverPollStrategy
-
- All Implemented Interfaces:
PollStrategy
public class BlockingObserverPollStrategy extends AbstractPollStrategy
ThisPollStrategy
delegates polling to another implementation, and also executes an arbitrary function during each poll. This function is only allowed to observe, not to tamper with the data being polled. The function is executed synchronously, thus making it easy to reason about the state of the consumption stream at the time of the function's execution.
-
-
Field Summary
-
Fields inherited from class com.linkedin.venice.unit.kafka.consumer.poll.AbstractPollStrategy
keepPollingWhenEmpty
-
-
Constructor Summary
Constructors Constructor Description BlockingObserverPollStrategy(AbstractPollStrategy basePollStrategy, java.util.function.Consumer<PubSubTopicPartitionOffset> observer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected PubSubTopicPartitionOffset
getNextPoll(java.util.Map<PubSubTopicPartition,java.lang.Long> offsets)
-
Methods inherited from class com.linkedin.venice.unit.kafka.consumer.poll.AbstractPollStrategy
incrementOffset, poll
-
-
-
-
Constructor Detail
-
BlockingObserverPollStrategy
public BlockingObserverPollStrategy(AbstractPollStrategy basePollStrategy, java.util.function.Consumer<PubSubTopicPartitionOffset> observer)
-
-
Method Detail
-
getNextPoll
protected PubSubTopicPartitionOffset getNextPoll(java.util.Map<PubSubTopicPartition,java.lang.Long> offsets)
- Specified by:
getNextPoll
in classAbstractPollStrategy
-
-