Package org.apache.kafka.streams.kstream
Class StreamJoined<K,V1,V2>
java.lang.Object
org.apache.kafka.streams.kstream.StreamJoined<K,V1,V2>
- Type Parameters:
K- the key typeV1- this value typeV2- other value type
Class used to configure the name of the join processor, the repartition topic name,
state stores or state store names in Stream-Stream join.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <K,V1, V2>
StreamJoined<K, V1, V2> Creates aStreamJoinedinstance using the provided name for the state stores and hence the changelog topics for the join stores.toString()static <K,V1, V2>
StreamJoined<K, V1, V2> Creates aStreamJoinedinstance with the provided serdes to configure the stores for the join.static <K,V1, V2>
StreamJoined<K, V1, V2> with(DslStoreSuppliers storeSuppliers) Creates a StreamJoined instance with the givenDslStoreSuppliers.static <K,V1, V2>
StreamJoined<K, V1, V2> with(WindowBytesStoreSupplier storeSupplier, WindowBytesStoreSupplier otherStoreSupplier) Creates a StreamJoined instance with the provided store suppliers.withDslStoreSuppliers(DslStoreSuppliers dslStoreSuppliers) Configure with the providedDslStoreSuppliersfor store suppliers that are not provided.withKeySerde(Serde<K> keySerde) Configure with the providedSerdefor the keyDisable change logging for both state stores.withLoggingEnabled(Map<String, String> config) Configures logging for both state stores.Set the name to use for the join processor and the repartition topic(s) if required.withOtherStoreSupplier(WindowBytesStoreSupplier otherStoreSupplier) Configure with the providedWindowBytesStoreSupplierfor the other store supplier.withOtherValueSerde(Serde<V2> otherValueSerde) Configure with the providedSerdefor the other valuewithStoreName(String storeName) Sets the base store name to use for both sides of the join.withThisStoreSupplier(WindowBytesStoreSupplier thisStoreSupplier) Configure with the providedWindowBytesStoreSupplierfor this store supplier.withValueSerde(Serde<V1> valueSerde) Configure with the providedSerdefor this value
-
Method Details
-
with
public static <K,V1, StreamJoined<K,V2> V1, withV2> (WindowBytesStoreSupplier storeSupplier, WindowBytesStoreSupplier otherStoreSupplier) Creates a StreamJoined instance with the provided store suppliers. The store suppliers must implement theWindowBytesStoreSupplierinterface. The store suppliers must provide unique names or aStreamsExceptionis thrown.- Type Parameters:
K- the key typeV1- this value typeV2- other value type- Parameters:
storeSupplier- this store supplierotherStoreSupplier- other store supplier- Returns:
StreamJoinedinstance
-
with
Creates a StreamJoined instance with the givenDslStoreSuppliers. The store plugin will be used to get all the state stores in this operation that do not otherwise have an explicitly configuredDslStoreSuppliers.- Type Parameters:
K- the key typeV1- this value typeV2- other value type- Parameters:
storeSuppliers- the store plugin that will be used for state stores- Returns:
StreamJoinedinstance
-
as
Creates aStreamJoinedinstance using the provided name for the state stores and hence the changelog topics for the join stores. The name for the stores will be ${applicationId}-<storeName>-this-join and ${applicationId}-<storeName>-other-join or ${applicationId}-<storeName>-outer-this-join and ${applicationId}-<storeName>-outer-other-join depending if the join is an inner-join or an outer join. The changelog topics will have the -changelog suffix. The user should note that even though the join stores will have a specified name, the stores will remain unavailable for querying. Please note that if you are usingStreamJoinedto replace deprecatedKStream.join(org.apache.kafka.streams.kstream.KStream<K, VO>, org.apache.kafka.streams.kstream.ValueJoiner<? super V, ? super VO, ? extends VR>, org.apache.kafka.streams.kstream.JoinWindows)functions withJoinedparameters in order to set the name for the join processors, you would need to create theStreamJoinedobject first and then callwithName(java.lang.String)- Type Parameters:
K- The key typeV1- This value typeV2- Other value type- Parameters:
storeName- The name to use for the store- Returns:
StreamJoinedinstance
-
with
public static <K,V1, StreamJoined<K,V2> V1, withV2> (Serde<K> keySerde, Serde<V1> valueSerde, Serde<V2> otherValueSerde) Creates aStreamJoinedinstance with the provided serdes to configure the stores for the join.- Type Parameters:
K- The key typeV1- This value typeV2- Other value type- Parameters:
keySerde- The key serdevalueSerde- This value serdeotherValueSerde- Other value serde- Returns:
StreamJoinedinstance
-
withName
Set the name to use for the join processor and the repartition topic(s) if required.- Parameters:
name- the name to use- Returns:
- a new
StreamJoinedinstance
-
withStoreName
Sets the base store name to use for both sides of the join. The name for the state stores and hence the changelog topics for the join stores. The name for the stores will be ${applicationId}-<storeName>-this-join and ${applicationId}-<storeName>-other-join or ${applicationId}-<storeName>-outer-this-join and ${applicationId}-<storeName>-outer-other-join depending if the join is an inner-join or an outer join. The changelog topics will have the -changelog suffix. The user should note that even though the join stores will have a specified name, the stores will remain unavailable for querying.- Parameters:
storeName- the storeName to use- Returns:
- a new
StreamJoinedinstance
-
withKeySerde
Configure with the providedSerdefor the key- Parameters:
keySerde- the serde to use for the key- Returns:
- a new
StreamJoinedconfigured with the keySerde
-
withValueSerde
Configure with the providedSerdefor this value- Parameters:
valueSerde- the serde to use for this value (calling or left side of the join)- Returns:
- a new
StreamJoinedconfigured with the valueSerde
-
withOtherValueSerde
Configure with the providedSerdefor the other value- Parameters:
otherValueSerde- the serde to use for the other value (other or right side of the join)- Returns:
- a new
StreamJoinedconfigured with the otherValueSerde
-
withDslStoreSuppliers
Configure with the providedDslStoreSuppliersfor store suppliers that are not provided.- Parameters:
dslStoreSuppliers- the default store suppliers to use for this StreamJoined- Returns:
- a new
StreamJoinedconfigured with dslStoreSuppliers
-
withThisStoreSupplier
Configure with the providedWindowBytesStoreSupplierfor this store supplier. Please note this method only provides the store supplier for the left side of the join. If you wish to also provide a store supplier for the right (i.e., other) side you must use thewithOtherStoreSupplier(WindowBytesStoreSupplier)method- Parameters:
thisStoreSupplier- the store supplier to use for this store supplier (calling or left side of the join)- Returns:
- a new
StreamJoinedconfigured with thisStoreSupplier
-
withOtherStoreSupplier
Configure with the providedWindowBytesStoreSupplierfor the other store supplier. Please note this method only provides the store supplier for the right side of the join. If you wish to also provide a store supplier for the left side you must use thewithThisStoreSupplier(WindowBytesStoreSupplier)method- Parameters:
otherStoreSupplier- the store supplier to use for the other store supplier (other or right side of the join)- Returns:
- a new
StreamJoinedconfigured with otherStoreSupplier
-
withLoggingEnabled
Configures logging for both state stores. The changelog will be created with the provided configs.Note: Any unrecognized configs will be ignored
- Parameters:
config- configs applied to the changelog topic- Returns:
- a new
StreamJoinedconfigured with logging enabled
-
withLoggingDisabled
Disable change logging for both state stores.- Returns:
- a new
StreamJoinedconfigured with logging disabled
-
toString
-