Package io.confluent.parallelconsumer
Class BrokerPollSystem<K,V>
java.lang.Object
io.confluent.parallelconsumer.BrokerPollSystem<K,V>
- Type Parameters:
K-V-
- All Implemented Interfaces:
OffsetCommitter
public class BrokerPollSystem<K,V> extends java.lang.Object implements OffsetCommitter
Subsystem for polling the broker for messages.
-
Constructor Summary
Constructors Constructor Description BrokerPollSystem(ConsumerManager<K,V> consumerMgr, WorkManager<K,V> wm, ParallelEoSStreamProcessor<K,V> pc, ParallelConsumerOptions options) -
Method Summary
Modifier and Type Method Description voidcloseAndWait()voiddrain()Will begin the shutdown process, eventually closing itself once drainedstatic java.time.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(java.time.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()voidsupervise()voidwakeupIfPaused()Wakeup if colling the broker
-
Constructor Details
-
BrokerPollSystem
public BrokerPollSystem(ConsumerManager<K,V> consumerMgr, WorkManager<K,V> wm, ParallelEoSStreamProcessor<K,V> pc, ParallelConsumerOptions options)
-
-
Method Details
-
start
public void start() -
supervise
public void supervise() -
drain
public void drain()Will begin the shutdown process, eventually closing itself once drained -
closeAndWait
public void closeAndWait() throws java.util.concurrent.TimeoutException, java.util.concurrent.ExecutionException- Throws:
java.util.concurrent.TimeoutExceptionjava.util.concurrent.ExecutionException
-
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
public static void setLongPollTimeout(java.time.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. -
getLongPollTimeout
public static java.time.Duration 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.
-