Search in sources :

Example 1 with SessionBytesStoreSupplier

use of org.apache.kafka.streams.state.SessionBytesStoreSupplier in project apache-kafka-on-k8s by banzaicloud.

the class SessionWindowedKStreamImpl method materialize.

private <VR> StoreBuilder<SessionStore<K, VR>> materialize(final MaterializedInternal<K, VR, SessionStore<Bytes, byte[]>> materialized) {
    SessionBytesStoreSupplier supplier = (SessionBytesStoreSupplier) materialized.storeSupplier();
    if (supplier == null) {
        supplier = Stores.persistentSessionStore(materialized.storeName(), windows.maintainMs());
    }
    final StoreBuilder<SessionStore<K, VR>> builder = Stores.sessionStoreBuilder(supplier, materialized.keySerde(), materialized.valueSerde());
    if (materialized.loggingEnabled()) {
        builder.withLoggingEnabled(materialized.logConfig());
    } else {
        builder.withLoggingDisabled();
    }
    if (materialized.cachingEnabled()) {
        builder.withCachingEnabled();
    }
    return builder;
}
Also used : SessionStore(org.apache.kafka.streams.state.SessionStore) SessionBytesStoreSupplier(org.apache.kafka.streams.state.SessionBytesStoreSupplier)

Aggregations

SessionBytesStoreSupplier (org.apache.kafka.streams.state.SessionBytesStoreSupplier)1 SessionStore (org.apache.kafka.streams.state.SessionStore)1