Class WorkContainer<K,V>
java.lang.Object
io.confluent.parallelconsumer.state.WorkContainer<K,V>
- All Implemented Interfaces:
Comparable<WorkContainer<K,V>>
public class WorkContainer<K,V> extends Object implements Comparable<WorkContainer<K,V>>
-
Constructor Summary
Constructors Constructor Description WorkContainer(long epoch, org.apache.kafka.clients.consumer.ConsumerRecord<K,V> cr, Function<RecordContext<K,V>,Duration> retryDelayProvider, String workType, Clock clock)WorkContainer(long epoch, org.apache.kafka.clients.consumer.ConsumerRecord<K,V> cr, Function<RecordContext<K,V>,Duration> retryDelayProvider, Clock clock) -
Method Summary
-
Constructor Details
-
Method Details
-
endFlight
public void endFlight() -
hasDelayPassed
public boolean hasDelayPassed() -
getDelayUntilRetryDue
- Returns:
- time until it should be retried
-
getRetryDelayConfig
- Returns:
- the delay between retries e.g. retry after 1 second
-
compareTo
- Specified by:
compareToin interfaceComparable<K>
-
isNotInFlight
public boolean isNotInFlight() -
isInFlight
public boolean isInFlight() -
onQueueingForExecution
public void onQueueingForExecution() -
getTopicPartition
public org.apache.kafka.common.TopicPartition getTopicPartition() -
onUserFunctionSuccess
public void onUserFunctionSuccess() -
onUserFunctionFailure
-
isUserFunctionComplete
public boolean isUserFunctionComplete() -
isUserFunctionSucceeded
public boolean isUserFunctionSucceeded() -
toString
-
getTimeInFlight
-
offset
public long offset() -
hasPreviouslyFailed
public boolean hasPreviouslyFailed() -
isAvailableToTakeAsWork
public boolean isAvailableToTakeAsWork() -
equals
-
canEqual
-
hashCode
public int hashCode() -
getEpoch
public long getEpoch()Assignment generation this record comes from. Used for fencing messages after partition loss, for work lingering in the system of in flight. -
getWorkType
Simple way to differentiate treatment based on type -
setWorkType
Simple way to differentiate treatment based on type -
getCr
-
getNumberOfFailedAttempts
public int getNumberOfFailedAttempts() -
getLastFailedAt
-
getSucceededAt
-
getLastFailureReason
-
getMaybeUserFunctionSucceeded
-
setDefaultRetryDelay
-
getFuture
-
setFuture
-