K
- Type of keysV
- Type of valuespublic interface ReadOnlyWindowStore<K,V>
Modifier and Type | Method and Description |
---|---|
KeyValueIterator<Windowed<K>,V> |
fetch(K from,
K to,
long timeFrom,
long timeTo)
Get all the key-value pairs in the given key range and time range from all
the existing windows.
|
WindowStoreIterator<V> |
fetch(K key,
long timeFrom,
long timeTo)
Get all the key-value pairs with the given key and the time range from all
the existing windows.
|
WindowStoreIterator<V> fetch(K key, long timeFrom, long timeTo)
The time range is inclusive and applies to the starting timestamp of the window. For example, if we have the following windows:
+-------------------------------+ | key | start time | end time | +-------+------------+----------+ | A | 10 | 20 | +-------+------------+----------+ | A | 15 | 25 | +-------+------------+----------+ | A | 20 | 30 | +-------+------------+----------+ | A | 25 | 35 | +--------------------------------And we call
store.fetch("A", 10, 20)
then the results will contain the first
three windows from the table above, i.e., all those where 10 <= start time <= 20.
For each key, the iterator guarantees ordering of windows, starting from the oldest/earliest available window to the newest/latest window.
<timestamp, value>
InvalidStateStoreException
- if the store is not initializedKeyValueIterator<Windowed<K>,V> fetch(K from, K to, long timeFrom, long timeTo)
from
- the first key in the rangeto
- the last key in the rangetimeFrom
- time range start (inclusive)timeTo
- time range end (inclusive)<Windowed<K>, value>
InvalidStateStoreException
- if the store is not initialized