Class BrokerPollSystem<K,V>
java.lang.Object
io.confluent.parallelconsumer.internal.BrokerPollSystem<K,V>
- Type Parameters:
K-V-
- All Implemented Interfaces:
OffsetCommitter
Subsystem for polling the broker for messages.
-
Constructor Summary
ConstructorsConstructorDescriptionBrokerPollSystem(ConsumerManager<K, V> consumerMgr, WorkManager<K, V> wm, AbstractParallelEoSStreamProcessor<K, V> pc, ParallelConsumerOptions<K, V> options) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoiddrain()Will begin the shutdown process, eventually closing itself once drainedstatic DurationNote how this relates togetLongPollTimeout()- if longPollTimeout is high and loading factor is low, there may not be enough messages queued up to satisfy demand.booleanisPaused()Whilepausedis an externally controlled state that temporarily stops polling and work registration, thepausedflag is used internally to pause subscriptions if polling needs to be throttled.voidPause polling from the underlying Kafka Broker.voidResume polling from the underlying Kafka Broker.voidOptionally blocks.static voidsetLongPollTimeout(Duration longPollTimeout) Note how this relates togetLongPollTimeout()- if longPollTimeout is high and loading factor is low, there may not be enough messages queued up to satisfy demand.voidvoidvoidWakeup if colling the broker
-
Constructor Details
-
BrokerPollSystem
public BrokerPollSystem(ConsumerManager<K, V> consumerMgr, WorkManager<K, V> wm, AbstractParallelEoSStreamProcessor<K, V> pc, ParallelConsumerOptions<K, V> options)
-
-
Method Details
-
start
-
supervise
public void supervise() -
drain
public void drain()Will begin the shutdown process, eventually closing itself once drained -
closeAndWait
- Throws:
TimeoutExceptionExecutionException
-
retrieveOffsetsAndCommit
public void retrieveOffsetsAndCommit()Optionally blocks. Threadsafe- Specified by:
retrieveOffsetsAndCommitin interfaceOffsetCommitter- See Also:
-
wakeupIfPaused
public void wakeupIfPaused()Wakeup if colling the broker -
pausePollingAndWorkRegistrationIfRunning
public void pausePollingAndWorkRegistrationIfRunning()Pause polling from the underlying Kafka Broker.Note: If the poll system is currently not in state
running, calling this method will be a no-op. -
resumePollingAndWorkRegistrationIfPaused
public void resumePollingAndWorkRegistrationIfPaused()Resume polling from the underlying Kafka Broker.Note: If the poll system is currently not in state
paused, calling this method will be a no-op. -
isPaused
public boolean isPaused()Whilepausedis an externally controlled state that temporarily stops polling and work registration, thepausedflag is used internally to pause subscriptions if polling needs to be throttled. -
setLongPollTimeout
Note how this relates togetLongPollTimeout()- if longPollTimeout is high and loading factor is low, there may not be enough messages queued up to satisfy demand. -
getLongPollTimeout
Note how this relates togetLongPollTimeout()- if longPollTimeout is high and loading factor is low, there may not be enough messages queued up to satisfy demand.
-