Package org.apache.kafka.streams.state
Interface SessionStore<K,AGG>
-
- Type Parameters:
K
- type of the record keysAGG
- type of the aggregated values
- All Superinterfaces:
ReadOnlySessionStore<K,AGG>
,StateStore
public interface SessionStore<K,AGG> extends StateStore, ReadOnlySessionStore<K,AGG>
Interface for storing the aggregated values of sessions.The key is internally represented as
Windowed<K>
that comprises the plain key and theWindow
that represents window start- and end-timestamp.If two sessions are merged, a new session with new start- and end-timestamp must be inserted into the store while the two old sessions must be deleted.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
put(Windowed<K> sessionKey, AGG aggregate)
Write the aggregated value for the provided key to the storevoid
remove(Windowed<K> sessionKey)
Remove the session aggregated with providedWindowed
key from the store-
Methods inherited from interface org.apache.kafka.streams.state.ReadOnlySessionStore
backwardFetch, backwardFetch, backwardFindSessions, backwardFindSessions, fetch, fetch, fetchSession, findSessions, findSessions
-
Methods inherited from interface org.apache.kafka.streams.processor.StateStore
close, flush, init, init, isOpen, name, persistent
-
-
-
-
Method Detail
-
remove
void remove(Windowed<K> sessionKey)
Remove the session aggregated with providedWindowed
key from the store- Parameters:
sessionKey
- key of the session to remove- Throws:
NullPointerException
- If null is used for sessionKey.
-
put
void put(Windowed<K> sessionKey, AGG aggregate)
Write the aggregated value for the provided key to the store- Parameters:
sessionKey
- key of the session to writeaggregate
- the aggregated value for the session, it can be null; if the serialized bytes are also null it is interpreted as deletes- Throws:
NullPointerException
- If null is used for sessionKey.
-
-