use of org.apache.flink.cep.nfa.NFAStateSerializer in project flink by apache.
the class CepOperator method initializeState.
@Override
public void initializeState(StateInitializationContext context) throws Exception {
super.initializeState(context);
// initializeState through the provided context
computationStates = context.getKeyedStateStore().getState(new ValueStateDescriptor<>(NFA_STATE_NAME, new NFAStateSerializer()));
partialMatches = new SharedBuffer<>(context.getKeyedStateStore(), inputSerializer, SharedBufferCacheConfig.of(getOperatorConfig().getConfiguration()));
elementQueueState = context.getKeyedStateStore().getMapState(new MapStateDescriptor<>(EVENT_QUEUE_STATE_NAME, LongSerializer.INSTANCE, new ListSerializer<>(inputSerializer)));
if (context.isRestored()) {
partialMatches.migrateOldState(getKeyedStateBackend(), computationStates);
}
}
Aggregations