Search in sources :

Example 1 with SharedVersionedBufferStoreImpl

use of com.github.fhuss.kafka.streams.cep.state.internal.SharedVersionedBufferStoreImpl 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)

Example 2 with SharedVersionedBufferStoreImpl

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

the class SharedVersionedBufferTest method getInMemorySharedBuffer.

@SuppressWarnings("unchecked")
private <K, V> SharedVersionedBufferStore<K, V> getInMemorySharedBuffer(Serde<K> keySerDe, Serde<V> valueSerDe) {
    InMemoryKeyValueStore test = new InMemoryKeyValueStore("test", Serdes.Bytes(), Serdes.ByteArray());
    SharedVersionedBufferStore<K, V> store = new SharedVersionedBufferStoreImpl<>(test, keySerDe, valueSerDe);
    store.init(new NoOpProcessorContext(), null);
    return store;
}
Also used : NoOpProcessorContext(org.apache.kafka.test.NoOpProcessorContext) SharedVersionedBufferStoreImpl(com.github.fhuss.kafka.streams.cep.state.internal.SharedVersionedBufferStoreImpl) InMemoryKeyValueStore(org.apache.kafka.streams.state.internals.InMemoryKeyValueStore)

Aggregations

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