Package io.confluent.parallelconsumer
Class RecordContext<K,V>
java.lang.Object
io.confluent.parallelconsumer.RecordContext<K,V>
public class RecordContext<K,V> extends Object
Context information for the wrapped
ConsumerRecord.
Includes all accessors (~getters) in ConsumerRecord via delegation (Delegate).
- See Also:
getNumberOfFailedAttempts()
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRecordContext.RecordContextBuilder<K,V> -
Field Summary
Fields Modifier and Type Field Description protected WorkContainer<K,V>workContainer -
Constructor Summary
Constructors Constructor Description RecordContext(WorkContainer<K,V> wc)RecordContext(WorkContainer<K,V> workContainer, org.apache.kafka.clients.consumer.ConsumerRecord<K,V> consumerRecord) -
Method Summary
Modifier and Type Method Description static <K, V> RecordContext.RecordContextBuilder<K,V>builder()protected booleancanEqual(Object other)booleanequals(Object o)org.apache.kafka.clients.consumer.ConsumerRecord<K,V>getConsumerRecord()Optional<Instant>getLastFailureAt()intgetNumberOfFailedAttempts()ConsumerRecordIdgetRecordId()A useful ID class for consumer records.Optional<Instant>getSucceededAt()protected WorkContainer<K,V>getWorkContainer()inthashCode()org.apache.kafka.common.header.Headersheaders()Kkey()Optional<Integer>leaderEpoch()longoffset()intpartition()intserializedKeySize()intserializedValueSize()longtimestamp()org.apache.kafka.common.record.TimestampTypetimestampType()RecordContext.RecordContextBuilder<K,V>toBuilder()Stringtopic()StringtoString()Vvalue()
-
Field Details
-
Constructor Details
-
RecordContext
-
RecordContext
public RecordContext(WorkContainer<K,V> workContainer, org.apache.kafka.clients.consumer.ConsumerRecord<K,V> consumerRecord)
-
-
Method Details
-
getRecordId
A useful ID class for consumer records.- Returns:
- the ID for the contained record
-
getNumberOfFailedAttempts
public int getNumberOfFailedAttempts()- Returns:
- the number of times this
ConsumerRecordhas failed processing already
-
getLastFailureAt
- Returns:
- if the record has failed, return the time at which is last failed at
-
getSucceededAt
- Returns:
- if the record had succeeded, returns the time at this the user function returned
-
builder
-
toBuilder
-
toString
-
equals
-
canEqual
-
hashCode
public int hashCode() -
getWorkContainer
-
getConsumerRecord
-
topic
-
partition
public int partition() -
headers
public org.apache.kafka.common.header.Headers headers() -
key
-
value
-
offset
public long offset() -
timestamp
public long timestamp() -
timestampType
public org.apache.kafka.common.record.TimestampType timestampType() -
serializedKeySize
public int serializedKeySize() -
serializedValueSize
public int serializedValueSize() -
leaderEpoch
-