Class AbstractPollStrategy
java.lang.Object
com.linkedin.venice.unit.kafka.consumer.poll.AbstractPollStrategy
- All Implemented Interfaces:
PollStrategy
- Direct Known Subclasses:
ArbitraryOrderingPollStrategy
,BlockingObserverPollStrategy
,CompositePollStrategy
,DuplicatingPollStrategy
,FilteringPollStrategy
,RandomPollStrategy
A base class which encapsulates the common plumbing needed by all
PollStrategy
implementations.-
Field Summary
-
Constructor Summary
ConstructorDescriptionAbstractPollStrategy
(boolean keepPollingWhenEmpty) AbstractPollStrategy
(boolean keepPollingWhenEmpty, int maxMessagePerPoll) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract PubSubTopicPartitionOffset
getNextPoll
(Map<PubSubTopicPartition, Long> offsets) protected void
incrementOffset
(Map<PubSubTopicPartition, Long> offsets, PubSubTopicPartition topicPartition, long offset) poll
(InMemoryKafkaBroker broker, Map<PubSubTopicPartition, Long> offsets, long timeout)
-
Field Details
-
keepPollingWhenEmpty
protected final boolean keepPollingWhenEmpty
-
-
Constructor Details
-
AbstractPollStrategy
public AbstractPollStrategy(boolean keepPollingWhenEmpty) -
AbstractPollStrategy
public AbstractPollStrategy(boolean keepPollingWhenEmpty, int maxMessagePerPoll)
-
-
Method Details
-
getNextPoll
-
poll
public Map<PubSubTopicPartition,List<PubSubMessage<KafkaKey, pollKafkaMessageEnvelope, Long>>> (InMemoryKafkaBroker broker, Map<PubSubTopicPartition, Long> offsets, long timeout) - Specified by:
poll
in interfacePollStrategy
-
incrementOffset
protected void incrementOffset(Map<PubSubTopicPartition, Long> offsets, PubSubTopicPartition topicPartition, long offset)
-