Search in sources :

Example 1 with WindowStoreSupplier

use of org.apache.kafka.streams.state.internals.WindowStoreSupplier in project kafka by apache.

the class TopologyBuilder method createInternalTopicConfig.

private InternalTopicConfig createInternalTopicConfig(final StateStoreSupplier<?> supplier, final String name) {
    if (!(supplier instanceof WindowStoreSupplier)) {
        return new InternalTopicConfig(name, Collections.singleton(InternalTopicConfig.CleanupPolicy.compact), supplier.logConfig());
    }
    final WindowStoreSupplier windowStoreSupplier = (WindowStoreSupplier) supplier;
    final InternalTopicConfig config = new InternalTopicConfig(name, Utils.mkSet(InternalTopicConfig.CleanupPolicy.compact, InternalTopicConfig.CleanupPolicy.delete), supplier.logConfig());
    config.setRetentionMs(windowStoreSupplier.retentionPeriod());
    return config;
}
Also used : WindowStoreSupplier(org.apache.kafka.streams.state.internals.WindowStoreSupplier) InternalTopicConfig(org.apache.kafka.streams.processor.internals.InternalTopicConfig)

Aggregations

InternalTopicConfig (org.apache.kafka.streams.processor.internals.InternalTopicConfig)1 WindowStoreSupplier (org.apache.kafka.streams.state.internals.WindowStoreSupplier)1