Search in sources :

Example 6 with KeyValueStoreMaterializer

use of org.apache.kafka.streams.kstream.internals.KeyValueStoreMaterializer in project apache-kafka-on-k8s by banzaicloud.

the class KeyValueStoreMaterializerTest method shouldCreateBuilderThatBuildsStoreWithCachingAndLoggingDisabled.

@Test
public void shouldCreateBuilderThatBuildsStoreWithCachingAndLoggingDisabled() {
    final MaterializedInternal<String, String, KeyValueStore<Bytes, byte[]>> materialized = new MaterializedInternal<>(Materialized.<String, String, KeyValueStore<Bytes, byte[]>>as("store").withCachingDisabled().withLoggingDisabled(), nameProvider, storePrefix);
    final KeyValueStoreMaterializer<String, String> materializer = new KeyValueStoreMaterializer<>(materialized);
    final StoreBuilder<KeyValueStore<String, String>> builder = materializer.materialize();
    final KeyValueStore<String, String> store = builder.build();
    final StateStore wrapped = ((WrappedStateStore) store).wrappedStore();
    assertThat(wrapped, not(instanceOf(CachedStateStore.class)));
    assertThat(wrapped, not(instanceOf(ChangeLoggingKeyValueBytesStore.class)));
}
Also used : Bytes(org.apache.kafka.common.utils.Bytes) WrappedStateStore(org.apache.kafka.streams.state.internals.WrappedStateStore) WrappedStateStore(org.apache.kafka.streams.state.internals.WrappedStateStore) CachedStateStore(org.apache.kafka.streams.state.internals.CachedStateStore) StateStore(org.apache.kafka.streams.processor.StateStore) KeyValueStore(org.apache.kafka.streams.state.KeyValueStore) InMemoryKeyValueStore(org.apache.kafka.streams.state.internals.InMemoryKeyValueStore) MaterializedInternal(org.apache.kafka.streams.kstream.internals.MaterializedInternal) KeyValueStoreMaterializer(org.apache.kafka.streams.kstream.internals.KeyValueStoreMaterializer) Test(org.junit.Test)

Aggregations

KeyValueStoreMaterializer (org.apache.kafka.streams.kstream.internals.KeyValueStoreMaterializer)6 MaterializedInternal (org.apache.kafka.streams.kstream.internals.MaterializedInternal)6 KeyValueStore (org.apache.kafka.streams.state.KeyValueStore)6 InMemoryKeyValueStore (org.apache.kafka.streams.state.internals.InMemoryKeyValueStore)5 WrappedStateStore (org.apache.kafka.streams.state.internals.WrappedStateStore)5 Test (org.junit.Test)5 Bytes (org.apache.kafka.common.utils.Bytes)4 CachedStateStore (org.apache.kafka.streams.state.internals.CachedStateStore)4 StateStore (org.apache.kafka.streams.processor.StateStore)3 ChangeLoggingKeyValueBytesStore (org.apache.kafka.streams.state.internals.ChangeLoggingKeyValueBytesStore)2 HashMap (java.util.HashMap)1 Metrics (org.apache.kafka.common.metrics.Metrics)1 MockTime (org.apache.kafka.common.utils.MockTime)1 StreamsConfig (org.apache.kafka.streams.StreamsConfig)1 InternalNameProvider (org.apache.kafka.streams.kstream.internals.InternalNameProvider)1 KeyValueBytesStoreSupplier (org.apache.kafka.streams.state.KeyValueBytesStoreSupplier)1 MeteredKeyValueBytesStore (org.apache.kafka.streams.state.internals.MeteredKeyValueBytesStore)1 Before (org.junit.Before)1