Class BrokerPollSystem<K,V>
java.lang.Object
io.confluent.parallelconsumer.internal.BrokerPollSystem<K,V>
- Type Parameters:
K-V-
- All Implemented Interfaces:
OffsetCommitter
public class BrokerPollSystem<K,V> extends Object implements OffsetCommitter
Subsystem for polling the broker for messages.
-
Constructor Summary
Constructors Constructor Description BrokerPollSystem(ConsumerManager<K,V> consumerMgr, WorkManager<K,V> wm, AbstractParallelEoSStreamProcessor<K,V> pc, ParallelConsumerOptions<K,V> options) -
Method Summary
Modifier and Type Method Description voidcloseAndWait()voiddrain()Will begin the shutdown process, eventually closing itself once drainedstatic DurationgetLongPollTimeout()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.booleanisPaused()voidretrieveOffsetsAndCommit()Optionally 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.voidstart(String managedExecutorService)voidsupervise()voidwakeupIfPaused()Wakeup 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:
ParallelConsumerOptions.CommitMode
-
wakeupIfPaused
public void wakeupIfPaused()Wakeup if colling the broker -
isPaused
public boolean isPaused() -
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.
-