Interface ReadOnlyRecord<K,V>

Type Parameters:
K - The type of the key
V - The type of the value
All Known Implementing Classes:
Record

@Public @Evolving public interface ReadOnlyRecord<K,V>
A read-only view of a record's key, value, timestamp, and headers.

This is the shared read surface of a record: the processing-layer Record extends it with transform-and-forward builders (withKey/withValue/withTimestamp/withHeaders), while an Interactive Query (IQv2) result is exactly this read-only snapshot and exposes nothing more. It is the result type returned by the headers-aware IQv2 query types, which surface the record headers persisted by header-aware state stores.

  • Method Summary

    Modifier and Type
    Method
    Description
    The headers of the record.
    key()
    The key of the record.
    long
    The timestamp of the record.
    The value of the record.
  • Method Details

    • key

      K key()
      The key of the record. May be null.
    • value

      V value()
      The value of the record. May be null.
    • timestamp

      long timestamp()
      The timestamp of the record. Will never be negative.
    • headers

      Headers headers()
      The headers of the record. Never null.

      The returned Headers should be treated as read-only. Records served as IQv2 results from a state store have their headers frozen via RecordHeaders.setReadOnly(), so adding or removing a header throws IllegalStateException. Freezing is not a deep copy, however: the value() bytes of an existing header can still be mutated in place, so callers must not modify them.