THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
Code Block | ||
---|---|---|
| ||
public class Produced<K, V> { protected String topicName; protected Boolean topicCreated = false; protected Boolean repartitionNeeded = true; protected Boolean useAsInternalTopicOnly = true; protected Integer partitions; protected Produced(finalString Produced<KtopicName, V>Boolean producedalreadyCreated) { this.keySerdetopicName = produced.keySerdetopicName; this.valueSerdealreadyCreated = produced.valueSerdealreadyCreated; } protected Produced(String topicName, Integer partitions) { this.topicName = topicName; this.partitionerpartitions = produced.partitionerpartitions; } public static <K, V> Produced<K, V> withwithTopic(String topicName, Boolean alreadyCreated) { return new Produced<>(keySerdetopicName, valueSerde, nullalreadyCreated); } } |
Public interfaces
We try to avoid many overloads by not implementing all the overloaded combinations of related methods.
|
...
KStream
Code Block | ||
---|---|---|
| ||
public <VT, VR> KStream<K, VR> join(final KTable<K, VT> other, final ValueJoiner<? super V, ? super VT, ? extends VR> joiner, final Joined<K, V, VT> joined, final RepartitionHint hintThisStream) public <VT, VR> KStream<K, VR> leftJoin(final KTable<K, VT> other, final ValueJoiner<? super V, ? super VT, ? extends VR> joiner, final Joined<K, V, VT> joined, final RepartitionHint hintThisStream) public <VO, VR> KStream<K, VR> join(final KStream<K, VO> otherStream, final ValueJoiner<? super V, ? super VO, ? extends VR> joiner, final JoinWindows windows, final Joined<K, V, VO> joined, final RepartitionHint hintThisStream, final RepartitionHint hintOtherStream) public <V1, R> KStream<K, R> join(final KStream<K, V1> other, final ValueJoiner<? super V, ? super V1, ? extends R> joiner, final JoinWindows windows, final Serde<K> keySerde, final Serde<V> thisValueSerde, final Serde<V1> otherValueSerde, final RepartitionHint hintThisStream, final RepartitionHint hintOtherStream) public <VO, VR> KStream<K, VR> outerJoin(final KStream<K, VO> other, final ValueJoiner<? super V, ? super VO, ? extends VR> joiner, final JoinWindows windows, final Joined<K, V, VO> joined, final RepartitionHint hintThisStream, final RepartitionHint hintOtherStream) public <V1, R> KStream<K, R> leftJoin(final KStream<K, V1> other, final ValueJoiner<? super V, ? super V1, ? extends R> joiner, final JoinWindows windows, final Serde<K> keySerde, final Serde<V> thisValSerde, final Serde<V1> otherValueSerde, final RepartitionHint hintThisStream, final RepartitionHint hintOtherStream) public <VO, VR> KStream<K, VR> leftJoin(final KStream<K, VO> other, final ValueJoiner<? super V, ? super VO, ? extends VR> joiner, final JoinWindows windows, final Joined<K, V, VO> joined, final RepartitionHint hintThisStream, final RepartitionHint hintOtherStream) |
KGroupedStream
public static <K, V> Produced<K, V> withTopic(String topicName, Integer partitions) {
return new Produced<>(topicName, partitions);
}
public Produced<K, V> repartitionNeeded(Boolean repartitionNeeded) {
this.repartitionNeeded = repartitionNeeded;
return this;
}
public Produced<K, V> useAsInternalTopicOnly(Boolean useAsInternalTopicOnly) {
this.useAsInternalTopicOnly = useAsInternalTopicOnly;
return this;
}
} |
Public interfaces
We try to avoid many overloads by not implementing all the overloaded combinations of related methods.
KStream
Code Block | ||
---|---|---|
| ||
Code Block | ||
| ||
public <T> KTable<Windowed<K>, T> aggregate(final Initializer<T> initializer,
final Aggregator<? super K, ? super V, T> aggregator,
final Merger<? super K, T> sessionMerger,
final SessionWindows sessionWindows,
final Serde<T> aggValueSerde,
final org.apache.kafka.streams.processor.StateStoreSupplier<SessionStore> storeSupplier,
final RepartitionHint repartitionHint)
public <T> KTable<K, T> aggregate(final Initializer<T> initializer,
final Aggregator<? super K, ? super V, T> aggregator,
final org.apache.kafka.streams.processor.StateStoreSupplier<KeyValueStore> storeSupplier,
final RepartitionHint repartitionHint)
public <W extends Window, T> KTable<Windowed<K>, T> aggregate(final Initializer<T> initializer,
final Aggregator<? super K, ? super V, T> aggregator,
final Windows<W> windows,
final org.apache.kafka.streams.processor.StateStoreSupplier<WindowStore> storeSupplier,
final RepartitionHint repartitionHint)
public KTable<K, V> reduce(final Reducer<V> reducer,
final org.apache.kafka.streams.processor.StateStoreSupplier<KeyValueStore> storeSupplier,
final RepartitionHint repartitionHint)
public <W extends Window> KTable<Windowed<K>, V> reduce(final Reducer<V> reducer,
final Windows<W> windows,
final org.apache.kafka.streams.processor.StateStoreSupplier<WindowStore> storeSupplier,
final RepartitionHint repartitionHint)
|
Rejected Alternatives
If there are alternative ways of accomplishing the same thing, what were they? The purpose of this section is to motivate why the design is the way it is and not some other way.