Interface ReadOnlyRecord<K,V>
- Type Parameters:
K- The type of the keyV- The type of the value
- All Known Implementing Classes:
Record
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
-
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
Headersshould be treated as read-only. Records served as IQv2 results from a state store have their headers frozen viaRecordHeaders.setReadOnly(), so adding or removing a header throwsIllegalStateException. Freezing is not a deep copy, however: thevalue()bytes of an existing header can still be mutated in place, so callers must not modify them.
-