Class ReadOnlyKeyValueStoreFacade<K,V>
- java.lang.Object
-
- org.apache.kafka.streams.state.internals.ReadOnlyKeyValueStoreFacade<K,V>
-
- All Implemented Interfaces:
ReadOnlyKeyValueStore<K,V>
- Direct Known Subclasses:
KeyValueStoreFacade
public class ReadOnlyKeyValueStoreFacade<K,V> extends Object implements ReadOnlyKeyValueStore<K,V>
-
-
Field Summary
Fields Modifier and Type Field Description protected TimestampedKeyValueStore<K,V>
inner
-
Constructor Summary
Constructors Modifier Constructor Description protected
ReadOnlyKeyValueStoreFacade(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.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.
-
-
-
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: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.
-
-