http://deprecated-apache-flink-user-mailing-list-archive.369.s1.nabble.com/ValueState-with-pure-Java-class-keeping-lists-map-vs-ListState-MapState-which-one-is-a-recommended-w-tp32246.html
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.