Hey,

Yes what you wrote should work. You can alternatively use
TypeExtractor.getForObject(modelMapInit) to extract the tye information.

I also like to implement my custom type info for Hashmaps and the other
types and use that.

Cheers,
Gyula

Martin Neumann <mneum...@sics.se> ezt írta (időpont: 2015. nov. 11., Sze,
16:30):

> Hej,
>
> What is the correct way of initializing a state-full operator that is using
> a hashmap? modelMapInit.getClass() does not work neither does
> HashMap.class. Do I have to implement my own TypeInformation class or is
> there a simpler way?
>
> cheers Martin
>
> private OperatorState<HashMap<InputType,MicroModel>> microModelMap;
>
> @Override
> public void open(Configuration parameters) throws Exception {
>     HashMap<InputType,MicroModel> modelMapInit = new HashMap<>();
>     this.microModelMap =
> getRuntimeContext().getKeyValueState("microModelMap",
> modelMapInit.getClass() , modelMapInit);
> }
>

Reply via email to