|
Hi Flinkers,
Was curious about if there is any performance(memory/speed) difference
between these two options:
in window process functions, when keeping state:
*1) Create a single ValueState<MyClass>, and store state in pure Java
objects*
class MyClass {
List<OtherClass> listOtherClass;
Map<String, SomeOtherClass> mapKeyToSomeValue;
}
public class MyProcessFunc
extends KeyedProcessFunction<String, X, Tuple3<Long, Long, Float>> {
...
ValueState<MyClass> valueState;
...
}
vs
*2) Create ListState and MapState as 2 Flink state variables:*
public class MyProcessFunc
extends KeyedProcessFunction<String, X, Tuple3<Long, Long, Float>> {
...
ListState<OtherClass> listState;
MapState<String, SomeOtherClass> mapState;
...
}
Which option is a recommended way of storing the states?
Thanks.
|