Skip to content

[Umbrella][Feature] Datastream API Support #569

Closed
8 of 8 issues completed
Closed

Description

@polyzos

Search before asking

  • I searched in the issues and found nothing similar.

Motivation

Although the implementation is there, we need to provide a cleaner source/sink API as it is currently somewhat messy and has a lot of arguments.

Solution

Source Features

Fluss Source Usage:

   FlussSource<Order> flussSource =
                FlussSource.<Order>builder()
                        .setBootstrapServers(bootstrapServers)
                        .setDatabase(DEFAULT_DB)
                        .setTable(pkTableName)
                        .setStartingOffsets(OffsetsInitializer.earliest())
                        .setScanPartitionDiscoveryIntervalMs(1000L)
                        .setDeserializationSchema(new OrderDeserializationSchema())
                        .build();

        DataStreamSource<Order> stream =
                env.fromSource(flussSource, WatermarkStrategy.noWatermarks(), "Fluss Source");

Currently, it supports setting some key properties via the builder pattern, but to avoid overwhelming users they can set the rest with Configuration via the setFlussConfig(). We can always add more if required and after feedback, I just thought it's better like this for now.

Sink Features

Fluss Sink Usage:

FlinkSink<Order> flussSink =
                FlussSink.<Order>builder()
                        .setBootstrapServers(bootstrapServers)
                        .setDatabase(DEFAULT_DB)
                        .setTable(pkTableName)
                        .useUpsert()
                        .setRowType(rowType)
                        .setInputType(Order.class) // Signals that no conversion is needed
                        .build();

stream.sinkTo(flussSink).name("Fluss Sink");

Anything else?

No response

Willingness to contribute

  • I'm willing to submit a PR!

Sub-issues

Sub-issues

8 of 8 Issues completed
Loading 8 sub-issues

Activity

  1. wuchong commented on Mar 10, 2025

    @wuchong
    Member

    Thanks @polyzos for opening it and taking care of this. Let's discuss the proposed API first here.

    I think Kafka and MongoDB connectors are good example to learn from.

  2. added this to the v0.7 milestone on Mar 10, 2025
  3. wuchong commented on Mar 10, 2025

    @wuchong
    Member

    @polyzos Do you want to contribute this issue?

  4. polyzos commented on Mar 10, 2025

    @polyzos
    ContributorAuthor

    @wuchong Hopefully yes.. I'm gonna spend some time investigating and think of the design and will circle back.

  5. polyzos commented on Mar 18, 2025

    @polyzos
    ContributorAuthor
  6. changed the title [-][Feature] Datastream API Support[/-] [+][Umbrella][Feature] Datastream API Support[/+] on Mar 24, 2025
  7. polyzos commented on May 9, 2025

    @polyzos
    ContributorAuthor

    Update here: The FlussSource has been merged; however, for the FlussSink, we discovered that the original design was insufficient to support a datastream sink with Pojos, as it would require multiple conversions, Pojo -> RowData -> InternalRow.

    We have some initial thoughts on a new design that will allow us to keep track of the operations that care place (INSERT, UPDATE, DELETE) when working with Pojos so we can minimize the type conversions internally and be able to go directly from Pojos -> InternalRow

  8. wuchong commented on Jun 13, 2025

    @wuchong
    Member

    All the tasks of DataStream API are completed, thanks @polyzos and all the contributors!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions