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 ofTableJoinedwith 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 ofTableJoinedwith partitioner and otherPartitionerStreamPartitionerinstances.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 otherStreamPartitionerto be used as part of computing the join.withPartitioner(StreamPartitioner<K, Void> partitioner) Set the customStreamPartitionerto 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 ofTableJoinedwith partitioner and otherPartitionerStreamPartitionerinstances.nullvalues 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- aStreamPartitionerthat 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 leftnullif the source table uses the default partitioner.otherPartitioner- aStreamPartitionerthat 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 leftnullif the source table uses the default partitioner.- Returns:
- new
TableJoinedinstance with the provided partitioners
-
as
Create an instance ofTableJoinedwith 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
TableJoinedinstance configured with thename
-
withPartitioner
Set the customStreamPartitionerto be used as part of computing the join.nullvalues are accepted and will result in the default partitioner being used.- Parameters:
partitioner- aStreamPartitionerthat 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 leftnullif the source table uses the default partitioner.- Returns:
- new
TableJoinedinstance configured with thepartitioner
-
withOtherPartitioner
Set the custom otherStreamPartitionerto be used as part of computing the join.nullvalues are accepted and will result in the default partitioner being used.- Parameters:
otherPartitioner- aStreamPartitionerthat 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 leftnullif the source table uses the default partitioner.- Returns:
- new
TableJoinedinstance 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
TableJoinedinstance configured with thename
-