Class ShardManager<K,V>
java.lang.Object
io.confluent.parallelconsumer.state.ShardManager<K,V>
Shards are local queues of work to be processed.
Generally they are keyed by one of the corresponding ParallelConsumerOptions.ProcessingOrder modes - key, partition etc...
This state is shared between the BrokerPollSystem thread (write - adding and removing shards and work) and
the AbstractParallelEoSStreamProcessor Controller thread (read - how many records are in the shards?), so
must be thread safe.
-
Constructor Summary
ConstructorsConstructorDescriptionShardManager(ParallelConsumerOptions options, WorkManager<K, V> wm, Clock clock) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddWorkContainer(WorkContainer<K, V> wc) longList<WorkContainer<K,V>> getWorkIfAvailable(int requestedMaxWorkToRetrieve) voidonFailure(WorkContainer<?, ?> wc) Idempotent - work may have not been removed, either way it's put backvoidonSuccess(WorkContainer<?, ?> wc) boolean
-
Constructor Details
-
ShardManager
-
-
Method Details
-
getNumberOfWorkQueuedInShardsAwaitingSelection
public long getNumberOfWorkQueuedInShardsAwaitingSelection()- Returns:
- Work ready in the processing shards, awaiting selection as work to do
-
workIsWaitingToBeProcessed
public boolean workIsWaitingToBeProcessed() -
addWorkContainer
-
onSuccess
-
onFailure
Idempotent - work may have not been removed, either way it's put back -
getLowestRetryTime
- Returns:
- none if there are no messages to retry
-
getWorkIfAvailable
-
getOptions
-