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>, TimestampedKeyValueStoreWithHeaders<K, V>, VersionedBytesStore
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 ReadOnlyKeyValueStore
all, approximateNumEntries, get, prefixScan, range, reverseAll, reverseRangeMethods inherited from interface StateStore
close, commit, committedOffset, flush, getPosition, init, isOpen, managesOffsets, 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.InvalidStateStoreException- if the store is not initialized
-
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.InvalidStateStoreException- if the store is not initialized
-
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.InvalidStateStoreException- if the store is not initialized
-
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.InvalidStateStoreException- if the store is not initialized
-