|
1 | 1 | == [[AbstractStream]] AbstractStream
|
2 | 2 |
|
3 |
| -`AbstractStream` is a base abstraction for the <<implementations, different concrete streams>>. |
4 |
| - |
5 |
| -[[creating-instance]] |
6 |
| -Every `AbstractStream` has the following internal properties: |
7 |
| - |
8 |
| -* [[builder]] link:kafka-streams-internals-InternalStreamsBuilder.adoc[InternalStreamsBuilder] |
9 |
| -* [[name]] Name |
10 |
| -* [[sourceNodes]] One or more names of the source nodes |
| 3 | +`AbstractStream` is the base abstraction of the <<implementations, streams>>. |
11 | 4 |
|
12 | 5 | [[implementations]]
|
13 | 6 | .AbstractStreams
|
14 |
| -[cols="1,2",options="header",width="100%"] |
| 7 | +[cols="30,70",options="header",width="100%"] |
15 | 8 | |===
|
16 | 9 | | AbstractStream
|
17 | 10 | | Description
|
18 | 11 |
|
19 |
| -| [[KTableImpl]] link:kafka-streams-internals-KTableImpl.adoc[KTableImpl] |
20 |
| -| |
| 12 | +| <<kafka-streams-internals-KGroupedStreamImpl.adoc#, KGroupedStreamImpl>> |
| 13 | +| [[KGroupedStreamImpl]] |
21 | 14 |
|
22 |
| -| [[KGroupedTableImpl]] link:kafka-streams-internals-KGroupedTableImpl.adoc[KGroupedTableImpl] |
23 |
| -| |
| 15 | +| <<kafka-streams-internals-KGroupedTableImpl.adoc#, KGroupedTableImpl>> |
| 16 | +| [[KGroupedTableImpl]] |
24 | 17 |
|
25 |
| -| [[TimeWindowedKStreamImpl]] link:kafka-streams-internals-TimeWindowedKStreamImpl.adoc[TimeWindowedKStreamImpl] |
26 |
| -| |
| 18 | +| <<kafka-streams-internals-KStreamImpl.adoc#, KStreamImpl>> |
| 19 | +| [[KStreamImpl]] |
27 | 20 |
|
28 |
| -| [[SessionWindowedKStreamImpl]] link:kafka-streams-internals-SessionWindowedKStreamImpl.adoc[SessionWindowedKStreamImpl] |
29 |
| -| |
| 21 | +| <<kafka-streams-internals-KTableImpl.adoc#, KTableImpl>> |
| 22 | +| [[KTableImpl]] |
30 | 23 |
|
31 |
| -| [[KStreamImpl]] link:kafka-streams-internals-KStreamImpl.adoc[KStreamImpl] |
32 |
| -| |
| 24 | +| <<kafka-streams-internals-SessionWindowedKStreamImpl.adoc#, SessionWindowedKStreamImpl>> |
| 25 | +| [[SessionWindowedKStreamImpl]] |
| 26 | + |
| 27 | +| <<kafka-streams-internals-TimeWindowedKStreamImpl.adoc#, TimeWindowedKStreamImpl>> |
| 28 | +| [[TimeWindowedKStreamImpl]] |
33 | 29 |
|
34 |
| -| [[KGroupedStreamImpl]] link:kafka-streams-internals-KGroupedStreamImpl.adoc[KGroupedStreamImpl] |
35 |
| -| |
36 | 30 | |===
|
37 | 31 |
|
38 |
| -=== [[storeFactory]] `storeFactory` Static Method |
| 32 | +[[creating-instance]] |
| 33 | +Every `AbstractStream` has the following properties: |
| 34 | + |
| 35 | +* [[name]] Name |
| 36 | +* [[keySerde]] Key Serde (`Serde<K>`) |
| 37 | +* [[valSerde]] Value Serde (`Serde<V>`) |
| 38 | +* [[sourceNodes]] Names of the source nodes (`Set<String>`) |
| 39 | +* [[streamsGraphNode]] <<kafka-streams-internals-StreamsGraphNode.adoc#, StreamsGraphNode>> |
| 40 | +* [[builder]] <<kafka-streams-internals-InternalStreamsBuilder.adoc#, InternalStreamsBuilder>> |
| 41 | +
|
| 42 | +=== [[ensureJoinableWith]] `ensureJoinableWith` Method |
39 | 43 |
|
40 | 44 | [source, java]
|
41 | 45 | ----
|
42 |
| -static <T, K> Stores.PersistentKeyValueFactory<K, T> storeFactory( |
43 |
| - final Serde<K> keySerde, |
44 |
| - final Serde<T> aggValueSerde, |
45 |
| - final String storeName) |
| 46 | +Set<String> ensureJoinableWith( |
| 47 | + AbstractStream<K, ?> other) |
46 | 48 | ----
|
47 | 49 |
|
48 |
| -`storeFactory` simply requests `Stores` to link:kafka-streams-Stores.adoc#create[create a StoreFactory] with the input parameters. |
| 50 | +`ensureJoinableWith`...FIXME |
49 | 51 |
|
50 | 52 | [NOTE]
|
51 | 53 | ====
|
52 |
| -`storeFactory` is used when: |
| 54 | +`ensureJoinableWith` is used when: |
53 | 55 |
|
54 |
| -* `AbstractStream` is requested for <<keyValueStore, keyValueStore>> and <<windowedStore, windowedStore>> |
| 56 | +* `KStreamImpl` is requested to <<kafka-streams-internals-KStreamImpl.adoc#join, join>>, <<kafka-streams-internals-KStreamImpl.adoc#outerJoin, outerJoin>> and <<kafka-streams-internals-KStreamImpl.adoc#leftJoin, leftJoin>> |
55 | 57 |
|
56 |
| -* `KGroupedStreamImpl` is requested for link:kafka-streams-internals-KGroupedStreamImpl.adoc#aggregate[aggregate] and link:kafka-streams-internals-KGroupedStreamImpl.adoc#reduce[reduce] |
| 58 | +* `KTableImpl` is requested to <<kafka-streams-internals-KTableImpl.adoc#join, join>>, <<kafka-streams-internals-KTableImpl.adoc#leftJoin, leftJoin>> and <<kafka-streams-internals-KTableImpl.adoc#outerJoin, outerJoin>> |
57 | 59 | ====
|
58 | 60 |
|
59 |
| -=== [[keyValueStore]] `keyValueStore` Static Method |
| 61 | +=== [[toValueTransformerWithKeySupplier]] `toValueTransformerWithKeySupplier` Static Method |
60 | 62 |
|
61 | 63 | [source, java]
|
62 | 64 | ----
|
63 |
| -static <T, K> org.apache.kafka.streams.processor.StateStoreSupplier<KeyValueStore> |
64 |
| -keyValueStore( |
65 |
| - final Serde<K> keySerde, |
66 |
| - final Serde<T> aggValueSerde, |
67 |
| - final String storeName) |
| 65 | +ValueTransformerWithKeySupplier<K, V, VR> toValueTransformerWithKeySupplier( |
| 66 | + ValueTransformerSupplier<V, VR> valueTransformerSupplier) |
68 | 67 | ----
|
69 | 68 |
|
70 |
| -`keyValueStore`...FIXME |
| 69 | +`toValueTransformerWithKeySupplier`...FIXME |
71 | 70 |
|
72 |
| -NOTE: `keyValueStore` is used when...FIXME |
| 71 | +NOTE: `toValueTransformerWithKeySupplier` is used when `KStreamImpl` is requested to <<kafka-streams-internals-KStreamImpl.adoc#transformValues, transformValues>> and <<kafka-streams-internals-KStreamImpl.adoc#flatTransformValues, flatTransformValues>>. |
73 | 72 |
|
74 |
| -=== [[windowedStore]] `windowedStore` Static Method |
| 73 | +=== [[reverseJoiner]] `reverseJoiner` Static Method |
75 | 74 |
|
76 | 75 | [source, java]
|
77 | 76 | ----
|
78 |
| -static <W extends Window, T, K> org.apache.kafka.streams.processor.StateStoreSupplier<WindowStore> |
79 |
| -windowedStore( |
80 |
| - final Serde<K> keySerde, |
81 |
| - final Serde<T> aggValSerde, |
82 |
| - final Windows<W> windows, |
83 |
| - final String storeName) |
| 77 | +ValueJoiner<T2, T1, R> reverseJoiner( |
| 78 | + ValueJoiner<T1, T2, R> joiner) |
84 | 79 | ----
|
85 | 80 |
|
86 |
| -`windowedStore`...FIXME |
87 |
| - |
88 |
| -NOTE: `windowedStore` is used when...FIXME |
| 81 | +`reverseJoiner`...FIXME |
89 | 82 |
|
90 |
| -=== [[toInternalValueTransformerSupplier]] Converting ValueTransformerSupplier or ValueTransformerWithKeySupplier to InternalValueTransformerWithKeySupplier -- `toInternalValueTransformerSupplier` Method |
91 |
| - |
92 |
| -[source, java] |
93 |
| ----- |
94 |
| -static <K, V, VR> InternalValueTransformerWithKeySupplier<K, V, VR> |
95 |
| -toInternalValueTransformerSupplier(final ValueTransformerSupplier<V, VR> valueTransformerSupplier) |
96 |
| -static <K, V, VR> InternalValueTransformerWithKeySupplier<K, V, VR> |
97 |
| -toInternalValueTransformerSupplier(final ValueTransformerWithKeySupplier<K, V, VR> valueTransformerWithKeySupplier) |
98 |
| ----- |
99 |
| - |
100 |
| -`toInternalValueTransformerSupplier` requests a `ValueTransformer` or `ValueTransformerWithKey` from the link:kafka-streams-ValueTransformerSupplier.adoc#get[ValueTransformerSupplier] or `ValueTransformerWithKeySupplier`, respectively. |
101 |
| - |
102 |
| -`toInternalValueTransformerSupplier` then creates a `InternalValueTransformerWithKeySupplier` that can produce a `InternalValueTransformerWithKey` that passes all calls to the `ValueTransformerSupplier` or `ValueTransformerWithKeySupplier`, respectively. |
| 83 | +[NOTE] |
| 84 | +==== |
| 85 | +`reverseJoiner` is used when: |
103 | 86 |
|
104 |
| -`toInternalValueTransformerSupplier` reports an `NullPointerException` when `ValueTransformerSupplier` or `ValueTransformerWithKeySupplier` are `null`. |
| 87 | +* `KStreamImplJoin` is requested to <<kafka-streams-internals-KStreamImpl-KStreamImplJoin.adoc#join, join>> (for <<kafka-streams-internals-KStreamImpl.adoc#join, KStreamImpl.join>>, <<kafka-streams-internals-KStreamImpl.adoc#outerJoin, KStreamImpl.outerJoin>> and <<kafka-streams-internals-KStreamImpl.adoc#leftJoin, KStreamImpl.leftJoin>> operators) |
105 | 88 |
|
106 |
| -NOTE: `toInternalValueTransformerSupplier` is used exclusively when `KStreamImpl` is requested for link:kafka-streams-internals-KStreamImpl.adoc#transformValues[transforming values with state]. |
| 89 | +* `KTableImpl` is requested to <<kafka-streams-internals-KTableImpl.adoc#doJoin, doJoin>> (for <<kafka-streams-internals-KTableImpl.adoc#join, KTableImpl.join>>, <<kafka-streams-internals-KTableImpl.adoc#leftJoin, KTableImpl.leftJoin>> and <<kafka-streams-internals-KTableImpl.adoc#outerJoin, KTableImpl.outerJoin>> operators) |
| 90 | +==== |
107 | 91 |
|
108 |
| -=== [[ensureJoinableWith]] `ensureJoinableWith` Method |
| 92 | +=== [[withKey]] `withKey` Static Method |
109 | 93 |
|
110 | 94 | [source, java]
|
111 | 95 | ----
|
112 |
| -Set<String> ensureJoinableWith(final AbstractStream<K> other) |
| 96 | +ValueMapperWithKey<K, V, VR> withKey( |
| 97 | + ValueMapper<V, VR> valueMapper) |
113 | 98 | ----
|
114 | 99 |
|
115 |
| -`ensureJoinableWith`...FIXME |
| 100 | +`withKey`...FIXME |
116 | 101 |
|
117 | 102 | [NOTE]
|
118 | 103 | ====
|
119 |
| -`ensureJoinableWith` is used when: |
| 104 | +`withKey` is used when: |
120 | 105 |
|
121 |
| -* `KStreamImpl` is requested to link:kafka-streams-internals-KStreamImpl.adoc#doJoin[doJoin] and link:kafka-streams-internals-KStreamImpl.adoc#doStreamTableJoin[doStreamTableJoin] |
| 106 | +* `KStreamImpl` is requested to <<kafka-streams-internals-KStreamImpl.adoc#mapValues, mapValues>> and <<kafka-streams-internals-KStreamImpl.adoc#flatMapValues, flatMapValues>> |
122 | 107 |
|
123 |
| -* `KTableImpl` is requested to link:kafka-streams-internals-KTableImpl.adoc#buildJoin[buildJoin] |
| 108 | +* `KTableImpl` is requested to <<kafka-streams-internals-KTableImpl.adoc#mapValues, mapValues>> |
124 | 109 | ====
|
0 commit comments