[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Initializing mapstate hangs

Flink 1.6.0. Valuestate initialises successful but mapstate hangs 


On 20 Oct 2018, at 02:55, vino yang <yanghua1127@xxxxxxxxx> wrote:

Hi Ahmad,

Which version of Flink do you use?

Thanks, vino.

Ahmad Hassan <ahmad.hassan@xxxxxxxxx> 于2018年10月19日周五 下午11:32写道:

Initializing mapstate hangs in window function. However if i use valuestate then it is initialized succcessfully. I am using rocksdb to store the state.

public class MyWindowFunction extends RichWindowFunction<Event, Payload, Tuple, TimeWindow>
private transient MapStateDescriptor<String, String> productsDescriptor = new MapStateDescriptor<>(
"mapState", String.class, String.class);

public void apply(Tuple key, TimeWindow window, final Iterable<Event> input,
final Collector<Payload> out)
// do something

public void open(Configuration parameters) throws Exception
System.out.println("## open init window state ");
MapState<String, String> state = this.getRuntimeContext().getMapState(productsDescriptor); <<< program hangs here
System.out.println("## open window state " + state);

Thanks for the help.