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).void
Update the value associated with this key.void
Update 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, reverseRange
Methods inherited from interface org.apache.kafka.streams.processor.StateStore
close, flush, init, init, isOpen, name, persistent
-
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 alsonull
it is interpreted as deletes- Throws:
NullPointerException
- Ifnull
is 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 alsonull
it is interpreted as deletes- Returns:
- The old value or
null
if there is no such key. - Throws:
NullPointerException
- Ifnull
is 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 alsonull
it is interpreted as deletes- Throws:
NullPointerException
- Ifnull
is used for key.
-
delete
Delete the value from the store (if there is one).- Parameters:
key
- The key- Returns:
- The old value or
null
if there is no such key. - Throws:
NullPointerException
- Ifnull
is used for key.
-