use of org.apache.kafka.streams.state.WindowStore in project apache-kafka-on-k8s by banzaicloud.
the class TimeWindowedKStreamImpl method materialize.
private <VR> StoreBuilder<WindowStore<K, VR>> materialize(final MaterializedInternal<K, VR, WindowStore<Bytes, byte[]>> materialized) {
WindowBytesStoreSupplier supplier = (WindowBytesStoreSupplier) materialized.storeSupplier();
if (supplier == null) {
supplier = Stores.persistentWindowStore(materialized.storeName(), windows.maintainMs(), windows.segments, windows.size(), false);
}
final StoreBuilder<WindowStore<K, VR>> builder = Stores.windowStoreBuilder(supplier, materialized.keySerde(), materialized.valueSerde());
if (materialized.loggingEnabled()) {
builder.withLoggingEnabled(materialized.logConfig());
} else {
builder.withLoggingDisabled();
}
if (materialized.cachingEnabled()) {
builder.withCachingEnabled();
}
return builder;
}
Aggregations