Package org.apache.kafka.streams.kstream
Class TableJoined<K,KO>
java.lang.Object
org.apache.kafka.streams.kstream.TableJoined<K,KO>
- Type Parameters:
K
- this key type ; key type for the left (primary) tableKO
- other key type ; key type for the right (foreign key) table
The
TableJoined
class represents optional parameters that can be passed to
KTable#join(KTable,Function,...)
and
KTable#leftJoin(KTable,Function,...)
operations, for foreign key joins.-
Method Summary
Modifier and TypeMethodDescriptionstatic <K,
KO> TableJoined<K, KO> Create an instance ofTableJoined
with base name for all components of the join, including internal topics created to complete the join.static <K,
KO> TableJoined<K, KO> with
(StreamPartitioner<K, Void> partitioner, StreamPartitioner<KO, Void> otherPartitioner) Create an instance ofTableJoined
with partitioner and otherPartitionerStreamPartitioner
instances.Set the base name used for all components of the join, including internal topics created to complete the join.withOtherPartitioner
(StreamPartitioner<KO, Void> otherPartitioner) Set the custom otherStreamPartitioner
to be used as part of computing the join.withPartitioner
(StreamPartitioner<K, Void> partitioner) Set the customStreamPartitioner
to be used as part of computing the join.
-
Method Details
-
with
public static <K,KO> TableJoined<K,KO> with(StreamPartitioner<K, Void> partitioner, StreamPartitioner<KO, Void> otherPartitioner) Create an instance ofTableJoined
with partitioner and otherPartitionerStreamPartitioner
instances.null
values are accepted and will result in the default partitioner being used.- Type Parameters:
K
- this key type ; key type for the left (primary) tableKO
- other key type ; key type for the right (foreign key) table- Parameters:
partitioner
- aStreamPartitioner
that captures the partitioning strategy for the left (primary) table of the foreign key join. Specifying this option does not repartition or otherwise affect the source table; rather, this option informs the foreign key join on how internal topics should be partitioned in order to be co-partitioned with the left join table. The partitioning strategy must depend only on the message key and not the message value, else the source table is not supported with foreign key joins. This option may be leftnull
if the source table uses the default partitioner.otherPartitioner
- aStreamPartitioner
that captures the partitioning strategy for the right (foreign key) table of the foreign key join. Specifying this option does not repartition or otherwise affect the source table; rather, this option informs the foreign key join on how internal topics should be partitioned in order to be co-partitioned with the right join table. The partitioning strategy must depend only on the message key and not the message value, else the source table is not supported with foreign key joins. This option may be leftnull
if the source table uses the default partitioner.- Returns:
- new
TableJoined
instance with the provided partitioners
-
as
Create an instance ofTableJoined
with base name for all components of the join, including internal topics created to complete the join.- Type Parameters:
K
- this key type ; key type for the left (primary) tableKO
- other key type ; key type for the right (foreign key) table- Parameters:
name
- the name used as the base for naming components of the join including internal topics- Returns:
- new
TableJoined
instance configured with thename
-
withPartitioner
Set the customStreamPartitioner
to be used as part of computing the join.null
values are accepted and will result in the default partitioner being used.- Parameters:
partitioner
- aStreamPartitioner
that captures the partitioning strategy for the left (primary) table of the foreign key join. Specifying this option does not repartition or otherwise affect the source table; rather, this option informs the foreign key join on how internal topics should be partitioned in order to be co-partitioned with the left join table. The partitioning strategy must depend only on the message key and not the message value, else the source table is not supported with foreign key joins. This option may be leftnull
if the source table uses the default partitioner.- Returns:
- new
TableJoined
instance configured with thepartitioner
-
withOtherPartitioner
Set the custom otherStreamPartitioner
to be used as part of computing the join.null
values are accepted and will result in the default partitioner being used.- Parameters:
otherPartitioner
- aStreamPartitioner
that captures the partitioning strategy for the right (foreign key) table of the foreign key join. Specifying this option does not repartition or otherwise affect the source table; rather, this option informs the foreign key join on how internal topics should be partitioned in order to be co-partitioned with the right join table. The partitioning strategy must depend only on the message key and not the message value, else the source table is not supported with foreign key joins. This option may be leftnull
if the source table uses the default partitioner.- Returns:
- new
TableJoined
instance configured with theotherPartitioner
-
withName
Set the base name used for all components of the join, including internal topics created to complete the join.- Parameters:
name
- the name used as the base for naming components of the join including internal topics- Returns:
- new
TableJoined
instance configured with thename
-