Search in sources :

Example 1 with GlobalStoreNode

use of org.apache.kafka.streams.kstream.internals.graph.GlobalStoreNode in project kafka by apache.

the class InternalStreamsBuilder method addGlobalStore.

public synchronized <KIn, VIn> void addGlobalStore(final StoreBuilder<?> storeBuilder, final String topic, final ConsumedInternal<KIn, VIn> consumed, final org.apache.kafka.streams.processor.api.ProcessorSupplier<KIn, VIn, Void, Void> stateUpdateSupplier) {
    // explicitly disable logging for global stores
    storeBuilder.withLoggingDisabled();
    final NamedInternal named = new NamedInternal(consumed.name());
    final String sourceName = named.suffixWithOrElseGet(TABLE_SOURCE_SUFFIX, this, KStreamImpl.SOURCE_NAME);
    final String processorName = named.orElseGenerateWithPrefix(this, KTableImpl.SOURCE_NAME);
    final GraphNode globalStoreNode = new GlobalStoreNode<>(storeBuilder, sourceName, topic, consumed, processorName, stateUpdateSupplier);
    addGraphNode(root, globalStoreNode);
}
Also used : GlobalStoreNode(org.apache.kafka.streams.kstream.internals.graph.GlobalStoreNode) GraphNode(org.apache.kafka.streams.kstream.internals.graph.GraphNode)

Aggregations

GlobalStoreNode (org.apache.kafka.streams.kstream.internals.graph.GlobalStoreNode)1 GraphNode (org.apache.kafka.streams.kstream.internals.graph.GraphNode)1