Skip to content

[Feature] do not break operator chain when set writer resource. #7783

@zhoulii

Description

@zhoulii

Search before asking

  • I searched in the issues and found nothing similar.

Motivation

When users configure custom resources (e.g., SINK_WRITER_CPU, SINK_WRITER_MEMORY) for sink operators via FlinkSink#configureSlotSharingGroup, the current implementation creates a dedicated SlotSharingGroup for the operator. This breaks operator chaining — even if the upstream source and the writer are connected by a forward edge, they cannot be chained together because Flink requires chained operators to belong to the same slot sharing group. As a result, data that should be forwarded locally is forced through the network stack, introducing unnecessary serialization/deserialization overhead and extra
thread cost.

Image

Solution

Replace SlotSharingGroup with ResourceSpec for per-operator resource declaration. Instead of operator.slotSharingGroup(slotSharingGroup), use operator.getTransformation().setResources(resourceSpec, resourceSpec). ResourceSpec declares resource requirements at the operator level without altering the slot
sharing group assignment, so the writer operators remain in the default slot sharing group and can still be chained with upstream operators. The Flink scheduler will aggregate the ResourceSpec of all operators within a chain to determine the total slot resource requirement.

Anything else?

No response

Are you willing to submit a PR?

  • I'm willing to submit a PR!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions