Skip to content

SourceBuilderBase

SourceBuilderBase is an abstraction of source builders (that KSPlanBuilder uses when visitTableSource).

Contract

Building KTable

KTable<K, GenericRow> buildKTable(
  SourceStep<?> streamSource,
  RuntimeBuildContext buildContext,
  Consumed<K, GenericRow> consumed,
  Function<K, Collection<?>> keyGenerator,
  Materialized<K, GenericRow, KeyValueStore<Bytes, byte[]>> materialized,
  Serde<GenericRow> valueSerde,
  String stateStoreName,
  PlanInfo planInfo)

Builds a KTable (Kafka Streams)

Used when:

Building Table Materialized

Materialized<GenericKey, GenericRow, KeyValueStore<Bytes, byte[]>>
buildTableMaterialized(
  SourceStep<KTableHolder<GenericKey>> source,
  RuntimeBuildContext buildContext,
  MaterializedFactory materializedFactory,
  Serde<GenericKey> keySerde,
  Serde<GenericRow> valueSerde,
  String stateStoreName)

Builds a Materialized (Kafka Streams)

Used when:

Implementations

buildTable

KTableHolder<GenericKey> buildTable(
  RuntimeBuildContext buildContext,
  SourceStep<KTableHolder<GenericKey>> source,
  ConsumedFactory consumedFactory,
  MaterializedFactory materializedFactory,
  PlanInfo planInfo)

buildTable gets a PhysicalSchema, a ValueSerde and a KeySerde (Serde<GenericKey>s).

buildTable buildSourceConsumed (with AutoOffsetReset.EARLIEST offset reset).

buildTable buildTableMaterialized and buildKTable (a KTable<GenericKey, GenericRow>).

In the end, buildTable creates a KTableHolder (with the KTable).

buildTable is used when: