K
- Key type.S
- State type.public abstract class PartitionedState<K,S>
extends java.lang.Object
Window
.Modifier | Constructor and Description |
---|---|
protected |
PartitionedState(Supplier<S> initialState)
Construct with an initial state function.
|
Modifier and Type | Method and Description |
---|---|
protected S |
getState(K key)
Get the current state for
key . |
protected S |
removeState(K key) |
protected S |
setState(K key,
S state)
Set the current state for
key . |
protected PartitionedState(Supplier<S> initialState)
initialState
- Function used to create the initial state for a key.getState(Object)
protected S getState(K key)
key
.
If no state is held then initialState.get()
is called to create the initial state for key
.key
- Partition key.key
.protected S setState(K key, S state)
key
.key
- Partition key.state
- State for key
key
, will be null if no state was held.Copyright © 2016 The Apache Software Foundation. All Rights Reserved - bbe71fa-20161201-1641