Class LinkedMultiSetState

  • All Implemented Interfaces:
    SequencedMultiSetState<org.apache.flink.table.data.RowData>

    @Internal
    public class LinkedMultiSetState
    extends Object
    implements SequencedMultiSetState<org.apache.flink.table.data.RowData>
    This class implements an ordered multi-set state backend using Flink's state primitives. It maintains the insertion order of elements and supports operations such as adding, appending, and removing elements. The state is backed by Flink's `MapState` and `ValueState` to store and manage the relationships between rows and sequence numbers (SQNs).

    Key features of this state implementation:

    • Maintains insertion order of elements using a doubly-linked list structure.
    • Supports both normal set semantics (replacing existing elements) and multi-set semantics (allowing duplicates).
    • Efficiently tracks the highest sequence number and links between elements for fast traversal and updates.
    • Provides methods to add, append, and remove elements with appropriate handling of state transitions.

    Note: This implementation is marked as @Internal and is intended for internal use within Flink. It may be subject to changes in future versions.

    Usage:

    See Also:
    SequencedMultiSetState, MapState, ValueState