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
- Direct Known Subclasses:
StreamJoinedInternal
public class StreamJoined<K,V1,V2> extends java.lang.ObjectClass used to configure the name of the join processor, the repartition topic name, state stores or state store names in Stream-Stream join.
-
-
Field Summary
Fields Modifier and Type Field Description protected org.apache.kafka.common.serialization.Serde<K>keySerdeprotected java.lang.Stringnameprotected WindowBytesStoreSupplierotherStoreSupplierprotected org.apache.kafka.common.serialization.Serde<V2>otherValueSerdeprotected java.lang.StringstoreNameprotected WindowBytesStoreSupplierthisStoreSupplierprotected org.apache.kafka.common.serialization.Serde<V1>valueSerde
-
Constructor Summary
Constructors Modifier Constructor Description protectedStreamJoined(StreamJoined<K,V1,V2> streamJoined)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <K,V1,V2>
StreamJoined<K,V1,V2>as(java.lang.String storeName)Creates aStreamJoinedinstance using the provided name for the state stores and hence the changelog topics for the join stores.java.lang.StringtoString()static <K,V1,V2>
StreamJoined<K,V1,V2>with(org.apache.kafka.common.serialization.Serde<K> keySerde, org.apache.kafka.common.serialization.Serde<V1> valueSerde, org.apache.kafka.common.serialization.Serde<V2> otherValueSerde)Creates aStreamJoinedinstance with the provided serdes to configure the stores for the join.static <K,V1,V2>
StreamJoined<K,V1,V2>with(WindowBytesStoreSupplier storeSupplier, WindowBytesStoreSupplier otherStoreSupplier)Creates a StreamJoined instance with the provided store suppliers.StreamJoined<K,V1,V2>withKeySerde(org.apache.kafka.common.serialization.Serde<K> keySerde)Configure with the providedSerdefor the keyStreamJoined<K,V1,V2>withName(java.lang.String name)Set the name to use for the join processor and the repartition topic(s) if required.StreamJoined<K,V1,V2>withOtherStoreSupplier(WindowBytesStoreSupplier otherStoreSupplier)Configure with the providedWindowBytesStoreSupplierfor the other store supplier.StreamJoined<K,V1,V2>withOtherValueSerde(org.apache.kafka.common.serialization.Serde<V2> otherValueSerde)Configure with the providedSerdefor the other valueStreamJoined<K,V1,V2>withStoreName(java.lang.String storeName)Sets the base store name to use for both sides of the join.StreamJoined<K,V1,V2>withThisStoreSupplier(WindowBytesStoreSupplier thisStoreSupplier)Configure with the providedWindowBytesStoreSupplierfor this store supplier.StreamJoined<K,V1,V2>withValueSerde(org.apache.kafka.common.serialization.Serde<V1> valueSerde)Configure with the providedSerdefor this value
-
-
-
Field Detail
-
keySerde
protected final org.apache.kafka.common.serialization.Serde<K> keySerde
-
valueSerde
protected final org.apache.kafka.common.serialization.Serde<V1> valueSerde
-
otherValueSerde
protected final org.apache.kafka.common.serialization.Serde<V2> otherValueSerde
-
thisStoreSupplier
protected final WindowBytesStoreSupplier thisStoreSupplier
-
otherStoreSupplier
protected final WindowBytesStoreSupplier otherStoreSupplier
-
name
protected final java.lang.String name
-
storeName
protected final java.lang.String storeName
-
-
Constructor Detail
-
StreamJoined
protected StreamJoined(StreamJoined<K,V1,V2> streamJoined)
-
-
Method Detail
-
with
public static <K,V1,V2> StreamJoined<K,V1,V2> with(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
-
as
public static <K,V1,V2> StreamJoined<K,V1,V2> as(java.lang.String storeName)
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.- 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,V2> StreamJoined<K,V1,V2> with(org.apache.kafka.common.serialization.Serde<K> keySerde, org.apache.kafka.common.serialization.Serde<V1> valueSerde, org.apache.kafka.common.serialization.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
public StreamJoined<K,V1,V2> withName(java.lang.String name)
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
public StreamJoined<K,V1,V2> withStoreName(java.lang.String storeName)
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
public StreamJoined<K,V1,V2> withKeySerde(org.apache.kafka.common.serialization.Serde<K> keySerde)
Configure with the providedSerdefor the key- Parameters:
keySerde- the serde to use for the key- Returns:
- a new
StreamJoinedconfigured with the keySerde
-
withValueSerde
public StreamJoined<K,V1,V2> withValueSerde(org.apache.kafka.common.serialization.Serde<V1> valueSerde)
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
public StreamJoined<K,V1,V2> withOtherValueSerde(org.apache.kafka.common.serialization.Serde<V2> otherValueSerde)
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
-
withThisStoreSupplier
public StreamJoined<K,V1,V2> withThisStoreSupplier(WindowBytesStoreSupplier thisStoreSupplier)
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
public StreamJoined<K,V1,V2> withOtherStoreSupplier(WindowBytesStoreSupplier otherStoreSupplier)
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
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-