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 allPollStrategyimplementations.
-
-
Field Summary
Fields Modifier and Type Field Description protected booleankeepPollingWhenEmpty
-
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 PubSubTopicPartitionOffsetgetNextPoll(java.util.Map<PubSubTopicPartition,java.lang.Long> offsets)protected voidincrementOffset(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:
pollin interfacePollStrategy
-
incrementOffset
protected void incrementOffset(java.util.Map<PubSubTopicPartition,java.lang.Long> offsets, PubSubTopicPartition topicPartition, long offset)
-
-