State Access Beyond RichCoFlatMapFunction
Posted by
Sandeep khanzode on
URL: http://deprecated-apache-flink-user-mailing-list-archive.369.s1.nabble.com/State-Access-Beyond-RichCoFlatMapFunction-tp41373.html
Hello,
I am creating a class that extends RichCoFlatMapFunction. I need to connect() two streams to basically share the state of one stream in another.
This is what I do:
private transient MapState<KeyClass, ValueClass> state;
@Override
public void open(Configuration parameters) throws Exception {
MapStateDescriptor<KeyClass, ValueClass> stateDescriptor =
new MapStateDescriptor<>(“abc-saved-state",
Types.POJO(KeyClass.class), Types.POJO(ValueClass.class));
state = getRuntimeContext().getMapState(stateDescriptor);
This works correctly.
I have two questions:
(a) Whenever I debug, I can only see the current key in the MapState, not all the possible keys that were created before and saved. Next time, I get a hit for another key, I will only see the other key and not the rest of previous keys. Is it by design or am I missing something?
Your response will be greatly appreciated. I will be happy to add more details if required.
Thanks,
Sandeep Ramesh Khanzode