Search in sources :

Example 6 with TimestampedKeyValueStoreMaterializer

use of org.apache.kafka.streams.kstream.internals.TimestampedKeyValueStoreMaterializer in project kafka by apache.

the class TimestampedKeyValueStoreMaterializerTest method shouldCreateBuilderThatBuildsStoreWithLoggingDisabled.

@Test
public void shouldCreateBuilderThatBuildsStoreWithLoggingDisabled() {
    final MaterializedInternal<String, String, KeyValueStore<Bytes, byte[]>> materialized = new MaterializedInternal<>(Materialized.<String, String, KeyValueStore<Bytes, byte[]>>as("store").withLoggingDisabled(), nameProvider, storePrefix);
    final TimestampedKeyValueStoreMaterializer<String, String> materializer = new TimestampedKeyValueStoreMaterializer<>(materialized);
    final StoreBuilder<TimestampedKeyValueStore<String, String>> builder = materializer.materialize();
    final TimestampedKeyValueStore<String, String> store = builder.build();
    final WrappedStateStore caching = (WrappedStateStore) ((WrappedStateStore) store).wrapped();
    assertThat(caching, instanceOf(CachingKeyValueStore.class));
    assertThat(caching.wrapped(), not(instanceOf(ChangeLoggingKeyValueBytesStore.class)));
}
Also used : TimestampedKeyValueStoreMaterializer(org.apache.kafka.streams.kstream.internals.TimestampedKeyValueStoreMaterializer) CachingKeyValueStore(org.apache.kafka.streams.state.internals.CachingKeyValueStore) WrappedStateStore(org.apache.kafka.streams.state.internals.WrappedStateStore) TimestampedKeyValueStore(org.apache.kafka.streams.state.TimestampedKeyValueStore) MeteredTimestampedKeyValueStore(org.apache.kafka.streams.state.internals.MeteredTimestampedKeyValueStore) KeyValueStore(org.apache.kafka.streams.state.KeyValueStore) InMemoryKeyValueStore(org.apache.kafka.streams.state.internals.InMemoryKeyValueStore) CachingKeyValueStore(org.apache.kafka.streams.state.internals.CachingKeyValueStore) TimestampedKeyValueStore(org.apache.kafka.streams.state.TimestampedKeyValueStore) MeteredTimestampedKeyValueStore(org.apache.kafka.streams.state.internals.MeteredTimestampedKeyValueStore) MaterializedInternal(org.apache.kafka.streams.kstream.internals.MaterializedInternal) Test(org.junit.Test)

Aggregations

MaterializedInternal (org.apache.kafka.streams.kstream.internals.MaterializedInternal)6 TimestampedKeyValueStoreMaterializer (org.apache.kafka.streams.kstream.internals.TimestampedKeyValueStoreMaterializer)6 KeyValueStore (org.apache.kafka.streams.state.KeyValueStore)6 Test (org.junit.Test)6 TimestampedKeyValueStore (org.apache.kafka.streams.state.TimestampedKeyValueStore)5 CachingKeyValueStore (org.apache.kafka.streams.state.internals.CachingKeyValueStore)5 InMemoryKeyValueStore (org.apache.kafka.streams.state.internals.InMemoryKeyValueStore)5 MeteredTimestampedKeyValueStore (org.apache.kafka.streams.state.internals.MeteredTimestampedKeyValueStore)5 WrappedStateStore (org.apache.kafka.streams.state.internals.WrappedStateStore)4 StateStore (org.apache.kafka.streams.processor.StateStore)3 Bytes (org.apache.kafka.common.utils.Bytes)2 File (java.io.File)1 Collections (java.util.Collections)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Set (java.util.Set)1 InvalidOffsetException (org.apache.kafka.clients.consumer.InvalidOffsetException)1 MockConsumer (org.apache.kafka.clients.consumer.MockConsumer)1 OffsetResetStrategy (org.apache.kafka.clients.consumer.OffsetResetStrategy)1 Node (org.apache.kafka.common.Node)1