Search in sources :

Example 1 with AggregatesStoreImpl

use of com.github.fhuss.kafka.streams.cep.state.internal.AggregatesStoreImpl in project kafkastreams-cep by fhussonnois.

the class NFATest method newNFA.

private <K, V> NFA<K, V> newNFA(Pattern<K, V> pattern, Serde<K> keySerde, Serde<V> valSerde) {
    List<Stage<K, V>> stages = new StagesFactory<K, V>().make(pattern);
    SharedVersionedBufferStore<K, V> bufferStore = new SharedVersionedBufferStoreImpl<>(new InMemoryKeyValueStore<>("test-buffer", Serdes.Bytes(), Serdes.ByteArray()), keySerde, valSerde);
    bufferStore.init(new NoOpProcessorContext(), null);
    AggregatesStore<K> aggStore = new AggregatesStoreImpl<>(new InMemoryKeyValueStore<>("test-aggregate", Serdes.Bytes(), Serdes.ByteArray()));
    aggStore.init(new NoOpProcessorContext(), null);
    return new NFA<>(aggStore, bufferStore, stages);
}
Also used : NoOpProcessorContext(org.apache.kafka.test.NoOpProcessorContext) SharedVersionedBufferStoreImpl(com.github.fhuss.kafka.streams.cep.state.internal.SharedVersionedBufferStoreImpl) AggregatesStoreImpl(com.github.fhuss.kafka.streams.cep.state.internal.AggregatesStoreImpl)

Aggregations

AggregatesStoreImpl (com.github.fhuss.kafka.streams.cep.state.internal.AggregatesStoreImpl)1 SharedVersionedBufferStoreImpl (com.github.fhuss.kafka.streams.cep.state.internal.SharedVersionedBufferStoreImpl)1 NoOpProcessorContext (org.apache.kafka.test.NoOpProcessorContext)1