K
- Type of keysV
- Type of valuespublic interface ReadOnlyWindowStore<K,V>
Modifier and Type | Method and Description |
---|---|
KeyValueIterator<Windowed<K>,V> |
all()
Gets all the key-value pairs in the existing windows.
|
WindowStoreIterator<V> |
fetch(K key,
Instant from,
Instant to)
Get all the key-value pairs with the given key and the time range from all the existing windows.
|
KeyValueIterator<Windowed<K>,V> |
fetch(K from,
K to,
Instant fromTime,
Instant toTime)
Get all the key-value pairs in the given key range and time range from all the existing windows.
|
KeyValueIterator<Windowed<K>,V> |
fetch(K from,
K to,
long timeFrom,
long timeTo)
Deprecated.
Use
fetch(Object, Object, Instant, Instant) instead |
V |
fetch(K key,
long time)
Get the value of key from a window.
|
WindowStoreIterator<V> |
fetch(K key,
long timeFrom,
long timeTo)
Deprecated.
Use
fetch(Object, Instant, Instant) instead |
KeyValueIterator<Windowed<K>,V> |
fetchAll(Instant from,
Instant to)
Gets all the key-value pairs that belong to the windows within in the given time range.
|
KeyValueIterator<Windowed<K>,V> |
fetchAll(long timeFrom,
long timeTo)
Deprecated.
Use
fetchAll(Instant, Instant) instead |
V fetch(K key, long time)
key
- the key to fetchtime
- start timestamp (inclusive) of the windownull
if no value is found in the windowInvalidStateStoreException
- if the store is not initializedNullPointerException
- If null
is used for any key.@Deprecated WindowStoreIterator<V> fetch(K key, long timeFrom, long timeTo)
fetch(Object, Instant, Instant)
insteadThis iterator must be closed after use.
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.
key
- the key to fetchtimeFrom
- time range start (inclusive)timeTo
- time range end (inclusive)<timestamp, value>
InvalidStateStoreException
- if the store is not initializedNullPointerException
- If null
is used for key.WindowStoreIterator<V> fetch(K key, Instant from, Instant to) throws IllegalArgumentException
This iterator must be closed after use.
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", Instant.ofEpochMilli(10), Instant.ofEpochMilli(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.
key
- the key to fetchfrom
- time range start (inclusive)to
- time range end (inclusive)<timestamp, value>
InvalidStateStoreException
- if the store is not initializedNullPointerException
- If null
is used for key.IllegalArgumentException
- if duration is negative or can't be represented as long milliseconds
@Deprecated KeyValueIterator<Windowed<K>,V> fetch(K from, K to, long timeFrom, long timeTo)
fetch(Object, Object, Instant, Instant)
insteadThis iterator must be closed after use.
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 initializedNullPointerException
- If null
is used for any key.KeyValueIterator<Windowed<K>,V> fetch(K from, K to, Instant fromTime, Instant toTime) throws IllegalArgumentException
This iterator must be closed after use.
from
- the first key in the rangeto
- the last key in the rangefromTime
- time range start (inclusive)toTime
- time range end (inclusive)<Windowed<K>, value>
InvalidStateStoreException
- if the store is not initializedNullPointerException
- If null
is used for any key.IllegalArgumentException
- if duration is negative or can't be represented as long milliseconds
KeyValueIterator<Windowed<K>,V> all()
<Windowed<K>, value>
InvalidStateStoreException
- if the store is not initialized@Deprecated KeyValueIterator<Windowed<K>,V> fetchAll(long timeFrom, long timeTo)
fetchAll(Instant, Instant)
insteadtimeFrom
- the beginning of the time slot from which to search (inclusive)timeTo
- the end of the time slot from which to search (inclusive)<Windowed<K>, value>
InvalidStateStoreException
- if the store is not initializedNullPointerException
- if null
is used for any keyKeyValueIterator<Windowed<K>,V> fetchAll(Instant from, Instant to) throws IllegalArgumentException
from
- the beginning of the time slot from which to search (inclusive)to
- the end of the time slot from which to search (inclusive)<Windowed<K>, value>
InvalidStateStoreException
- if the store is not initializedNullPointerException
- if null
is used for any keyIllegalArgumentException
- if duration is negative or can't be represented as long milliseconds