Class ProcessingShard<K,V>
java.lang.Object
io.confluent.parallelconsumer.state.ProcessingShard<K,V>
Models the queue of work to be processed, based on the
ParallelConsumerOptions.ProcessingOrder modes.-
Constructor Summary
ConstructorsConstructorDescriptionProcessingShard(ShardKey key, ParallelConsumerOptions<?, ?> options, PartitionStateManager<K, V> pm) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddWorkContainer(WorkContainer<K, V> wc) longlonglongMap of offset to WorkUnits.booleanisEmpty()voidonSuccess(WorkContainer<?, ?> wc) remove(long offset) boolean
-
Constructor Details
-
ProcessingShard
public ProcessingShard(ShardKey key, ParallelConsumerOptions<?, ?> options, PartitionStateManager<K, V> pm)
-
-
Method Details
-
workIsWaitingToBeProcessed
public boolean workIsWaitingToBeProcessed() -
addWorkContainer
-
onSuccess
-
isEmpty
public boolean isEmpty() -
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). This is addressed in PR#270.
Is a Map because need random access into collection, as records don't always complete in order (i.e. UNORDERED mode).
-