use of org.apache.kafka.streams.state.internals.WrappedStateStore 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)));
}
use of org.apache.kafka.streams.state.internals.WrappedStateStore in project kafka by apache.
the class StoresTest method shouldCreateRocksDbWindowStore.
@Test
public void shouldCreateRocksDbWindowStore() {
final WindowStore store = Stores.persistentWindowStore("store", ofMillis(1L), ofMillis(1L), false).get();
final StateStore wrapped = ((WrappedStateStore) store).wrapped();
assertThat(store, instanceOf(RocksDBWindowStore.class));
assertThat(wrapped, allOf(not(instanceOf(RocksDBTimestampedSegmentedBytesStore.class)), instanceOf(RocksDBSegmentedBytesStore.class)));
}
use of org.apache.kafka.streams.state.internals.WrappedStateStore in project apache-kafka-on-k8s by banzaicloud.
the class KeyValueStoreMaterializerTest method shouldCreateBuilderThatBuildsStoreWithCachingDisabled.
@Test
public void shouldCreateBuilderThatBuildsStoreWithCachingDisabled() {
final MaterializedInternal<String, String, KeyValueStore<Bytes, byte[]>> materialized = new MaterializedInternal<>(Materialized.<String, String, KeyValueStore<Bytes, byte[]>>as("store").withCachingDisabled(), 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 WrappedStateStore logging = (WrappedStateStore) ((WrappedStateStore) store).wrappedStore();
assertThat(logging, instanceOf(ChangeLoggingKeyValueBytesStore.class));
}
use of org.apache.kafka.streams.state.internals.WrappedStateStore in project apache-kafka-on-k8s by banzaicloud.
the class KeyValueStoreMaterializerTest method shouldCreateBuilderThatBuildsMeteredStoreWithCachingAndLoggingEnabled.
@Test
public void shouldCreateBuilderThatBuildsMeteredStoreWithCachingAndLoggingEnabled() {
final MaterializedInternal<String, String, KeyValueStore<Bytes, byte[]>> materialized = new MaterializedInternal<>(Materialized.<String, String, KeyValueStore<Bytes, byte[]>>as("store"), 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 WrappedStateStore caching = (WrappedStateStore) ((WrappedStateStore) store).wrappedStore();
final StateStore logging = caching.wrappedStore();
assertThat(store, instanceOf(MeteredKeyValueBytesStore.class));
assertThat(caching, instanceOf(CachedStateStore.class));
assertThat(logging, instanceOf(ChangeLoggingKeyValueBytesStore.class));
}
use of org.apache.kafka.streams.state.internals.WrappedStateStore 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)));
}
Aggregations