T
- Type of the value in the operator stateValueState
.@Deprecated @PublicEvolving public interface OperatorState<T> extends State
The state is only accessible by functions applied on a KeyedDataStream. The key is automatically supplied by the system, so the function always sees the value mapped to the key of the current element. That way, the system can handle stream and state partitioning consistently together.
Modifier and Type | Method and Description |
---|---|
void |
update(T value)
Deprecated.
Updates the operator state accessible by
value() to the given
value. |
T |
value()
Deprecated.
Returns the current value for the state.
|
T value() throws IOException
IOException
- Thrown if the system cannot access the state.void update(T value) throws IOException
value()
to the given
value. The next time value()
is called (for the same state
partition) the returned state will represent the updated value. When a
partitioned state is updated with null, the state for the current key
will be removed and the default value is returned on the next access.value
- The new value for the state.IOException
- Thrown if the system cannot access the state.Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.