Class WindowMapState<W,UV>
java.lang.Object
org.apache.flink.table.runtime.operators.window.tvf.state.WindowMapState<W,UV>
- All Implemented Interfaces:
WindowState<W>
A wrapper of
MapState which is easier to update based on window namespace.-
Constructor Summary
ConstructorsConstructorDescriptionWindowMapState(org.apache.flink.runtime.state.internal.InternalMapState<org.apache.flink.table.data.RowData, W, org.apache.flink.table.data.RowData, UV> windowState) -
Method Summary
Modifier and TypeMethodDescriptionvoidRemoves the value mapped under current key and the given window.booleanReturns whether there exists the given mapping.Returns all the mappings in the state.Returns the current value associated with the given key.booleanReturns true if this state contains no key-value mappings, otherwise false.Iterates over all the mappings in the state.Iterable<org.apache.flink.table.data.RowData>Returns all the keys in the state.voidAssociates a new value with the given key.voidCopies all of the mappings from the given map into the state.voidDeletes the mapping of the given key.Returns all the values in the state.
-
Constructor Details
-
WindowMapState
-
-
Method Details
-
clear
Description copied from interface:WindowStateRemoves the value mapped under current key and the given window.- Specified by:
clearin interfaceWindowState<W>
-
get
Returns the current value associated with the given key.- Parameters:
key- The key of the mapping- Returns:
- The value of the mapping with the given key
- Throws:
Exception- Thrown if the system cannot access the state.
-
put
Associates a new value with the given key.- Parameters:
key- The key of the mappingvalue- The new value of the mapping- Throws:
Exception- Thrown if the system cannot access the state.
-
putAll
Copies all of the mappings from the given map into the state.- Parameters:
map- The mappings to be stored in this state- Throws:
Exception- Thrown if the system cannot access the state.
-
remove
Deletes the mapping of the given key.- Parameters:
key- The key of the mapping- Throws:
Exception- Thrown if the system cannot access the state.
-
contains
Returns whether there exists the given mapping.- Parameters:
key- The key of the mapping- Returns:
- True if there exists a mapping whose key equals to the given key
- Throws:
Exception- Thrown if the system cannot access the state.
-
entries
public Iterable<Map.Entry<org.apache.flink.table.data.RowData,UV>> entries(W window) throws Exception Returns all the mappings in the state.- Returns:
- An iterable view of all the key-value pairs in the state.
- Throws:
Exception- Thrown if the system cannot access the state.
-
keys
Returns all the keys in the state.- Returns:
- An iterable view of all the keys in the state.
- Throws:
Exception- Thrown if the system cannot access the state.
-
values
Returns all the values in the state.- Returns:
- An iterable view of all the values in the state.
- Throws:
Exception- Thrown if the system cannot access the state.
-
iterator
public Iterator<Map.Entry<org.apache.flink.table.data.RowData,UV>> iterator(W window) throws Exception Iterates over all the mappings in the state.- Returns:
- An iterator over all the mappings in the state
- Throws:
Exception- Thrown if the system cannot access the state.
-
isEmpty
Returns true if this state contains no key-value mappings, otherwise false.- Returns:
- True if this state contains no key-value mappings, otherwise false.
- Throws:
Exception- Thrown if the system cannot access the state.
-