I have a usecase where i am aggregating values on the same key in multiple streams it looks something like below:
Input -> window(15 secs) -> window(1 min) -> window(15 min) -> ... -> out_1 -> out_2 -> out_3
In the all the windows i have a separate KeyedProcessFunction having a MapState for all three streams, however the i am using the same name for all the instances while creating the MapStateDescriptor something like:
MapStateDescriptor<Long, Float> test = new MapStateDescriptor<>("test", Long.class, SomeObject.class);
Given all the three streams have the same key on which they are operating will the mapstate will be shared between streams because it has the same name in MapStateDescriptor<>("test", Long.class, SomeObject.class) or it will be unique for each stream
Should i keep the name different in that case?
State is always scoped to the function/operator in which it is used. It cannot be shared with or accessed from other functions/operators. So what you have done is fine.