InternalStreamsBuilder¶
Creating Instance¶
InternalStreamsBuilder takes the following to be created:
InternalStreamsBuilder is created when:
StreamsBuilderis created
Root Node¶
GraphNode root
InternalStreamsBuilder creates a root GraphNode when created.
This root node is used to addGraphNode in the following high-level operators:
This root node is then used to build and optimize a topology (for StreamsBuilder).
globalTable¶
GlobalKTable<K, V> globalTable(
String topic,
ConsumedInternal<K, V> consumed,
MaterializedInternal<K, V, KeyValueStore<Bytes, byte[]>> materialized)
globalTable requests the given MaterializedInternal to disable logging (withLoggingDisabled).
globalTable requests the given ConsumedInternal for the name and creates a NamedInternal.
globalTable requests the NamedInternal for source and processor names.
globalTable requests the given MaterializedInternal for the queryable store name and creates a KTableSource.
globalTable builds a TableSourceNode and addGraphNode it to the root node.
In the end, globalTable creates a GlobalKTableImpl (with a KTableSourceValueGetterSupplier with the store name and the queryable store name from the given MaterializedInternal).
globalTable is used when:
StreamsBuilderis requested to globalTable
buildAndOptimizeTopology¶
void buildAndOptimizeTopology() // (1)
void buildAndOptimizeTopology(
Properties props)
- Used in tests only
buildAndOptimizeTopology...FIXME
buildAndOptimizeTopology is used when:
StreamsBuilderis requested to build a topology
mergeDuplicateSourceNodes¶
void mergeDuplicateSourceNodes()
mergeDuplicateSourceNodes...FIXME
maybePerformOptimizations¶
void maybePerformOptimizations(
Properties props)
maybePerformOptimizations...FIXME
optimizeKTableSourceTopics¶
void optimizeKTableSourceTopics()
optimizeKTableSourceTopics...FIXME
maybeOptimizeRepartitionOperations¶
void maybeOptimizeRepartitionOperations()
maybeOptimizeRepartitionOperations...FIXME
maybeUpdateKeyChangingRepartitionNodeMap¶
void maybeUpdateKeyChangingRepartitionNodeMap()
maybeUpdateKeyChangingRepartitionNodeMap...FIXME
createRepartitionNode¶
OptimizableRepartitionNode<K, V> createRepartitionNode(
String repartitionTopicName,
Serde<K> keySerde,
Serde<V> valueSerde)
createRepartitionNode...FIXME
Adding StateStore to Topology¶
void addStateStore(
StoreBuilder<?> builder)
addStateStore adds a new StateStoreNode to the root node.
addStateStore is used when:
StreamsBuilderis requested to addStateStoreKTableImplis requested todoJoinOnForeignKey
stream¶
KStream<K, V> stream(
Collection<String> topics,
ConsumedInternal<K, V> consumed)
KStream<K, V> stream(
Pattern topicPattern,
ConsumedInternal<K, V> consumed)
stream...FIXME
stream is used when:
StreamsBuilderis requested to stream
Adding GraphNode¶
void addGraphNode(
Collection<GraphNode> parents,
GraphNode child)
addGraphNode adds the given child GraphNode to the children of the given parent GraphNodes.
In the end, addGraphNode maybeAddNodeForOptimizationMetadata (with the child node).
maybeAddNodeForOptimizationMetadata¶
void maybeAddNodeForOptimizationMetadata(
GraphNode node)
maybeAddNodeForOptimizationMetadata setBuildPriority of the given GraphNode to the current buildPriorityIndex (and increments it).
maybeAddNodeForOptimizationMetadata adds the given GraphNode to the following internal registries:
- keyChangingOperationsToOptimizableRepartitionNodes when isKeyChangingOperation
OptimizableRepartitionNode(FIXME)- mergeNodes when isMergeNode
- tableSourceNodes when the GraphNode is TableSourceNode
Merge GraphNodes¶
InternalStreamsBuilder defines mergeNodes internal registry of GraphNodes that are merge nodes (that are found in maybeAddNodeForOptimizationMetadata while adding a new GraphNode).
mergeNodes is used for maybeUpdateKeyChangingRepartitionNodeMap.