Search in sources :

Example 6 with StateStoreContext

use of org.apache.kafka.streams.processor.StateStoreContext in project kafka by apache.

the class KeyValueStoreFacadeTest method shouldForwardInit.

@Test
public void shouldForwardInit() {
    final StateStoreContext context = mock(StateStoreContext.class);
    final StateStore store = mock(StateStore.class);
    keyValueStoreFacade.init(context, store);
    verify(mockedKeyValueTimestampStore).init(context, store);
}
Also used : StateStore(org.apache.kafka.streams.processor.StateStore) StateStoreContext(org.apache.kafka.streams.processor.StateStoreContext) Test(org.junit.jupiter.api.Test)

Example 7 with StateStoreContext

use of org.apache.kafka.streams.processor.StateStoreContext in project kafka by apache.

the class WindowStoreFacadeTest method shouldForwardInit.

@Test
public void shouldForwardInit() {
    final StateStoreContext context = mock(StateStoreContext.class);
    final StateStore store = mock(StateStore.class);
    windowStoreFacade.init(context, store);
    verify(mockedWindowTimestampStore).init(context, store);
}
Also used : StateStore(org.apache.kafka.streams.processor.StateStore) StateStoreContext(org.apache.kafka.streams.processor.StateStoreContext) Test(org.junit.jupiter.api.Test)

Example 8 with StateStoreContext

use of org.apache.kafka.streams.processor.StateStoreContext in project kafka by apache.

the class InMemoryKeyValueStoreTest method createStringKeyValueStore.

@Before
public void createStringKeyValueStore() {
    super.before();
    final StateStoreContext byteStoreContext = byteStoreDriver.context();
    final StoreBuilder<KeyValueStore<Bytes, byte[]>> storeBuilder = Stores.keyValueStoreBuilder(Stores.inMemoryKeyValueStore("in-memory-byte-store"), new Serdes.BytesSerde(), new Serdes.ByteArraySerde());
    byteStore = storeBuilder.build();
    byteStore.init(byteStoreContext, byteStore);
    this.inMemoryKeyValueStore = getInMemoryStore();
}
Also used : Serdes(org.apache.kafka.common.serialization.Serdes) KeyValueStore(org.apache.kafka.streams.state.KeyValueStore) StateStoreContext(org.apache.kafka.streams.processor.StateStoreContext) Before(org.junit.Before)

Aggregations

StateStoreContext (org.apache.kafka.streams.processor.StateStoreContext)8 StateStore (org.apache.kafka.streams.processor.StateStore)4 KeyValue (org.apache.kafka.streams.KeyValue)3 TaskId (org.apache.kafka.streams.processor.TaskId)3 ByteBuffer (java.nio.ByteBuffer)2 LinkedList (java.util.LinkedList)2 List (java.util.List)2 Map (java.util.Map)2 Properties (java.util.Properties)2 ConsumerRecord (org.apache.kafka.clients.consumer.ConsumerRecord)2 Serdes (org.apache.kafka.common.serialization.Serdes)2 Bytes (org.apache.kafka.common.utils.Bytes)2 StreamsConfig (org.apache.kafka.streams.StreamsConfig)2 ProcessorContext (org.apache.kafka.streams.processor.ProcessorContext)2 RecordBatchingStateRestoreCallback (org.apache.kafka.streams.processor.internals.RecordBatchingStateRestoreCallback)2 Position (org.apache.kafka.streams.query.Position)2 QueryConfig (org.apache.kafka.streams.query.QueryConfig)2 KeyValueStore (org.apache.kafka.streams.state.KeyValueStore)2 MockInternalProcessorContext (org.apache.kafka.test.MockInternalProcessorContext)2 Test (org.junit.Test)2