flink-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Elkhan Dadashov <elkhan.dadas...@gmail.com>
Subject ValueState with pure Java class keeping lists/map vs ListState/MapState, which one is a recommended way?
Date Fri, 17 Jan 2020 19:45:01 GMT
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.

Mime
View raw message