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) table
KO - other key type ; key type for the right (foreign key) table

public class TableJoined<K,KO> extends Object
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.
  • Field Details

  • Constructor Details

  • Method Details

    • with

      public static <K, KO> TableJoined<K,KO> with(StreamPartitioner<K,Void> partitioner, StreamPartitioner<KO,Void> otherPartitioner)
      Create an instance of TableJoined with partitioner and otherPartitioner StreamPartitioner 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) table
      KO - other key type ; key type for the right (foreign key) table
      Parameters:
      partitioner - a StreamPartitioner 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 left null if the source table uses the default partitioner.
      otherPartitioner - a StreamPartitioner 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 left null if the source table uses the default partitioner.
      Returns:
      new TableJoined instance with the provided partitioners
    • as

      public static <K, KO> TableJoined<K,KO> as(String name)
      Create an instance of TableJoined 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) table
      KO - 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 the name
    • withPartitioner

      public TableJoined<K,KO> withPartitioner(StreamPartitioner<K,Void> partitioner)
      Set the custom StreamPartitioner to be used as part of computing the join. null values are accepted and will result in the default partitioner being used.
      Parameters:
      partitioner - a StreamPartitioner 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 left null if the source table uses the default partitioner.
      Returns:
      new TableJoined instance configured with the partitioner
    • withOtherPartitioner

      public TableJoined<K,KO> withOtherPartitioner(StreamPartitioner<KO,Void> otherPartitioner)
      Set the custom other StreamPartitioner to be used as part of computing the join. null values are accepted and will result in the default partitioner being used.
      Parameters:
      otherPartitioner - a StreamPartitioner 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 left null if the source table uses the default partitioner.
      Returns:
      new TableJoined instance configured with the otherPartitioner
    • withName

      public TableJoined<K,KO> withName(String name)
      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 the name