Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. First of all, we will repartition the other this KTable's stream, by key computed from the mapper(K1K, V1V) → KK1, so that it is co-partitioned by the same key. The co-partition topic is partitioned on the new key, but the message key and value are unchanged, and log compaction is turned off.
  2. After re-partitioning the other table, materialize both streams. This The other table is materialized as K → V, the other K1 → V1, and this table is materialized as combo key (K1, K, K1) with value V1 V (note that we need to apply the mapper(K1K, V1V) → KK1 again).
  3. When a record (kk1, vv1) is received from this the other table's stream, update its materialized table, and then make a range query on the other materialized table as (kk1, *), and for each matched record (Kk1, K1k)  V1 v apply the joiner(Vv, V1v1) → Rr, and return (K1k, Rr).
  4. When a record (k1k, v1v) is received from the other this table's repartitioned stream, update its materialized table by applying the mapper, and then make a get query on the this materialized table by mapped key key mapper(k, v) -> k1, and for the single matched record apply  k1 → v1 apply reversed joiner(V1v1, Vv) → Rr, and return (K1k, Rr).

 

When sendOldValues is turned on, where a pair <old, new> is passed into the other KTable's stream, then the mapped key may be different, and hence two separate records will be sent to the re-partition topic, one for removal and one for addition.

...