Package org.apache.kafka.streams.state
Interface KeyValueStore<K,V>
- Type Parameters:
K- The key typeV- The value type
- All Superinterfaces:
ReadOnlyKeyValueStore<K,,V> StateStore
- All Known Subinterfaces:
TimestampedKeyValueStore<K,V>
A key-value store that supports put/get/delete and range queries.
-
Method Summary
Modifier and TypeMethodDescriptionDelete the value from the store (if there is one).voidUpdate the value associated with this key.voidUpdate all the given key/value pairs.putIfAbsent(K key, V value) Update the value associated with this key, unless a value is already associated with the key.Methods inherited from interface org.apache.kafka.streams.state.ReadOnlyKeyValueStore
all, approximateNumEntries, get, prefixScan, range, reverseAll, reverseRangeMethods inherited from interface org.apache.kafka.streams.processor.StateStore
close, flush, getPosition, init, init, isOpen, name, persistent, query
-
Method Details
-
put
Update the value associated with this key.- Parameters:
key- The key to associate the value tovalue- The value to update, it can benull; if the serialized bytes are alsonullit is interpreted as deletes- Throws:
NullPointerException- Ifnullis used for key.
-
putIfAbsent
Update the value associated with this key, unless a value is already associated with the key.- Parameters:
key- The key to associate the value tovalue- The value to update, it can benull; if the serialized bytes are alsonullit is interpreted as deletes- Returns:
- The old value or
nullif there is no such key. - Throws:
NullPointerException- Ifnullis used for key.
-
putAll
Update all the given key/value pairs.- Parameters:
entries- A list of entries to put into the store; if the serialized bytes are alsonullit is interpreted as deletes- Throws:
NullPointerException- Ifnullis used for key.
-
delete
Delete the value from the store (if there is one).- Parameters:
key- The key- Returns:
- The old value or
nullif there is no such key. - Throws:
NullPointerException- Ifnullis used for key.
-