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:
  • Field Details

  • Constructor Details

    • RecordContext

      public RecordContext(WorkContainer<K,V> wc)
    • RecordContext

      public RecordContext(WorkContainer<K,V> workContainer, org.apache.kafka.clients.consumer.ConsumerRecord<K,V> consumerRecord)
  • Method Details

    • getRecordId

      public ConsumerRecordId 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 ConsumerRecord has failed processing already
    • getLastFailureAt

      public Optional<Instant> getLastFailureAt()
      Returns:
      if the record has failed, return the time at which is last failed at
    • getSucceededAt

      public Optional<Instant> getSucceededAt()
      Returns:
      if the record had succeeded, returns the time at this the user function returned
    • builder

      public static <K, V> RecordContext.RecordContextBuilder<K,V> builder()
    • toBuilder

      public RecordContext.RecordContextBuilder<K,V> toBuilder()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getWorkContainer

      protected WorkContainer<K,V> getWorkContainer()
    • getConsumerRecord

      public org.apache.kafka.clients.consumer.ConsumerRecord<K,V> getConsumerRecord()
    • topic

      public String topic()
    • partition

      public int partition()
    • headers

      public org.apache.kafka.common.header.Headers headers()
    • key

      public K key()
    • value

      public V 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

      public Optional<Integer> leaderEpoch()