Class CompositeReadOnlyKeyValueStore<K,V>
- java.lang.Object
-
- org.apache.kafka.streams.state.internals.CompositeReadOnlyKeyValueStore<K,V>
-
- Type Parameters:
K
- key typeV
- value type
- All Implemented Interfaces:
ReadOnlyKeyValueStore<K,V>
public class CompositeReadOnlyKeyValueStore<K,V> extends Object implements ReadOnlyKeyValueStore<K,V>
A wrapper over the underlyingReadOnlyKeyValueStore
s found in aProcessorTopology
-
-
Constructor Summary
Constructors Constructor Description CompositeReadOnlyKeyValueStore(StateStoreProvider storeProvider, QueryableStoreType<ReadOnlyKeyValueStore<K,V>> storeType, String storeName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description KeyValueIterator<K,V>
all()
Return an iterator over all keys in this store.long
approximateNumEntries()
Return an approximate count of key-value mappings in this store.V
get(K key)
Get the value corresponding to this key.KeyValueIterator<K,V>
range(K from, K to)
Get an iterator over a given range of keys.
-
-
-
Constructor Detail
-
CompositeReadOnlyKeyValueStore
public CompositeReadOnlyKeyValueStore(StateStoreProvider storeProvider, QueryableStoreType<ReadOnlyKeyValueStore<K,V>> storeType, String storeName)
-
-
Method Detail
-
get
public V get(K key)
Description copied from interface:ReadOnlyKeyValueStore
Get the value corresponding to this key.- Specified by:
get
in interfaceReadOnlyKeyValueStore<K,V>
- Parameters:
key
- The key to fetch- Returns:
- The value or null if no value is found.
-
range
public KeyValueIterator<K,V> range(K from, K to)
Description copied from interface:ReadOnlyKeyValueStore
Get an iterator over a given range of keys. This iterator must be closed after use. The returned iterator must be safe fromConcurrentModificationException
s and must not return null values. No ordering guarantees are provided.- Specified by:
range
in interfaceReadOnlyKeyValueStore<K,V>
- Parameters:
from
- The first key that could be in the rangeto
- The last key that could be in the range- Returns:
- The iterator for this range.
-
all
public KeyValueIterator<K,V> all()
Description copied from interface:ReadOnlyKeyValueStore
Return an iterator over all keys in this store. This iterator must be closed after use. The returned iterator must be safe fromConcurrentModificationException
s and must not return null values. No ordering guarantees are provided.- Specified by:
all
in interfaceReadOnlyKeyValueStore<K,V>
- Returns:
- An iterator of all key/value pairs in the store.
-
approximateNumEntries
public long approximateNumEntries()
Description copied from interface:ReadOnlyKeyValueStore
Return an approximate count of key-value mappings in this store. The count is not guaranteed to be exact in order to accommodate stores where an exact count is expensive to calculate.- Specified by:
approximateNumEntries
in interfaceReadOnlyKeyValueStore<K,V>
- Returns:
- an approximate count of key-value mappings in the store.
-
-