Class ReadOnlyKeyValueStoreFacade<K,V>
- java.lang.Object
-
- org.apache.kafka.streams.state.internals.ReadOnlyKeyValueStoreFacade<K,V>
-
- All Implemented Interfaces:
ReadOnlyKeyValueStore<K,V>
public class ReadOnlyKeyValueStoreFacade<K,V> extends java.lang.Object implements ReadOnlyKeyValueStore<K,V>
-
-
Field Summary
Fields Modifier and Type Field Description protected TimestampedKeyValueStore<K,V>inner
-
Constructor Summary
Constructors Modifier Constructor Description protectedReadOnlyKeyValueStoreFacade(TimestampedKeyValueStore<K,V> store)
-
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.longapproximateNumEntries()Return an approximate count of key-value mappings in this store.Vget(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.
-
-
-
Field Detail
-
inner
protected final TimestampedKeyValueStore<K,V> inner
-
-
Constructor Detail
-
ReadOnlyKeyValueStoreFacade
protected ReadOnlyKeyValueStoreFacade(TimestampedKeyValueStore<K,V> store)
-
-
Method Detail
-
get
public V get(K key)
Description copied from interface:ReadOnlyKeyValueStoreGet the value corresponding to this key.- Specified by:
getin 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:ReadOnlyKeyValueStoreGet an iterator over a given range of keys. This iterator must be closed after use. The returned iterator must be safe fromConcurrentModificationExceptions and must not return null values. No ordering guarantees are provided.- Specified by:
rangein 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:ReadOnlyKeyValueStoreReturn an iterator over all keys in this store. This iterator must be closed after use. The returned iterator must be safe fromConcurrentModificationExceptions and must not return null values. No ordering guarantees are provided.- Specified by:
allin interfaceReadOnlyKeyValueStore<K,V>- Returns:
- An iterator of all key/value pairs in the store.
-
approximateNumEntries
public long approximateNumEntries()
Description copied from interface:ReadOnlyKeyValueStoreReturn 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:
approximateNumEntriesin interfaceReadOnlyKeyValueStore<K,V>- Returns:
- an approximate count of key-value mappings in the store.
-
-