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
public abstract class AbstractPollStrategy extends java.lang.Object implements PollStrategy
A base class which encapsulates the common plumbing needed by allPollStrategy
implementations.
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
keepPollingWhenEmpty
-
Constructor Summary
Constructors Constructor Description AbstractPollStrategy(boolean keepPollingWhenEmpty)
AbstractPollStrategy(boolean keepPollingWhenEmpty, int maxMessagePerPoll)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract PubSubTopicPartitionOffset
getNextPoll(java.util.Map<PubSubTopicPartition,java.lang.Long> offsets)
protected void
incrementOffset(java.util.Map<PubSubTopicPartition,java.lang.Long> offsets, PubSubTopicPartition topicPartition, long offset)
java.util.Map<PubSubTopicPartition,java.util.List<PubSubMessage<KafkaKey,KafkaMessageEnvelope,java.lang.Long>>>
poll(InMemoryKafkaBroker broker, java.util.Map<PubSubTopicPartition,java.lang.Long> offsets, long timeout)
-
-
-
Method Detail
-
getNextPoll
protected abstract PubSubTopicPartitionOffset getNextPoll(java.util.Map<PubSubTopicPartition,java.lang.Long> offsets)
-
poll
public java.util.Map<PubSubTopicPartition,java.util.List<PubSubMessage<KafkaKey,KafkaMessageEnvelope,java.lang.Long>>> poll(InMemoryKafkaBroker broker, java.util.Map<PubSubTopicPartition,java.lang.Long> offsets, long timeout)
- Specified by:
poll
in interfacePollStrategy
-
incrementOffset
protected void incrementOffset(java.util.Map<PubSubTopicPartition,java.lang.Long> offsets, PubSubTopicPartition topicPartition, long offset)
-
-