use of org.apache.kafka.streams.state.KeyValueBytesStoreSupplier in project kafkastreams-cep by fhussonnois.
the class QueryStoreBuilders method getAggregateStateStores.
/**
* Build all {@link StoreBuilder} used to store aggregate states for stages.
*
* @return a new collection of {@link StoreBuilder}.
*/
public StoreBuilder<AggregatesStore<K>> getAggregateStateStores() {
final String storeName = QueryStores.getQueryAggregateStatesStoreName(queryName);
KeyValueBytesStoreSupplier storeSupplier = Stores.persistentKeyValueStore(storeName);
return QueryStores.aggregatesStoreBuilder(storeSupplier);
}
use of org.apache.kafka.streams.state.KeyValueBytesStoreSupplier in project apache-kafka-on-k8s by banzaicloud.
the class KeyValueStoreMaterializer method materialize.
/**
* @return StoreBuilder
*/
public StoreBuilder<KeyValueStore<K, V>> materialize() {
KeyValueBytesStoreSupplier supplier = (KeyValueBytesStoreSupplier) materialized.storeSupplier();
if (supplier == null) {
final String name = materialized.storeName();
supplier = Stores.persistentKeyValueStore(name);
}
final StoreBuilder<KeyValueStore<K, V>> builder = Stores.keyValueStoreBuilder(supplier, materialized.keySerde(), materialized.valueSerde());
if (materialized.loggingEnabled()) {
builder.withLoggingEnabled(materialized.logConfig());
} else {
builder.withLoggingDisabled();
}
if (materialized.cachingEnabled()) {
builder.withCachingEnabled();
}
return builder;
}
Aggregations