Class ProcessingShard<K,V>
java.lang.Object
io.confluent.parallelconsumer.state.ProcessingShard<K,V>
public class ProcessingShard<K,V> extends Object
Models the queue of work to be processed, based on the
ParallelConsumerOptions.ProcessingOrder modes.-
Constructor Summary
Constructors Constructor Description ProcessingShard(Object key, ParallelConsumerOptions<?,?> options, PartitionStateManager<K,V> pm) -
Method Summary
Modifier and Type Method Description voidaddWorkContainer(WorkContainer<K,V> wc)longgetCountOfWorkAwaitingSelection()longgetCountOfWorkTracked()longgetCountWorkInFlight()NavigableMap<Long,WorkContainer<K,V>>getEntries()Map of offset to WorkUnits.Optional<WorkContainer<K,V>>getWorkForOffset(long offset)booleanisEmpty()voidonSuccess(WorkContainer<?,?> wc)WorkContainer<K,V>remove(long offset)booleanworkIsWaitingToBeProcessed()
-
Constructor Details
-
ProcessingShard
public ProcessingShard(Object key, ParallelConsumerOptions<?,?> options, PartitionStateManager<K,V> pm)
-
-
Method Details
-
workIsWaitingToBeProcessed
public boolean workIsWaitingToBeProcessed() -
addWorkContainer
-
onSuccess
-
isEmpty
public boolean isEmpty() -
getWorkForOffset
-
getCountOfWorkAwaitingSelection
public long getCountOfWorkAwaitingSelection() -
getCountOfWorkTracked
public long getCountOfWorkTracked() -
getCountWorkInFlight
public long getCountWorkInFlight() -
remove
-
getEntries
Map of offset to WorkUnits.Uses a ConcurrentSkipListMap instead of a TreeMap as under high pressure there appears to be some concurrency errors (missing WorkContainers).
-