Enum HashFunctionStrategy

    • Enum Constant Detail

      • SINK_DEFINED

        public static final HashFunctionStrategy SINK_DEFINED
        Use the HashFunctionProvider defined by the sink.

        This is the default behavior when sink.partitioning.strategy is not explicitly set. The provider returned by the sink's getDataChangeEventHashFunctionProvider method will be used, preserving backward compatibility with existing pipeline configurations.

        This is the only supported strategy for sinks that require sink-defined routing, such as paimon, fluss, and maxcompute.

      • PRIMARY_KEY

        public static final HashFunctionStrategy PRIMARY_KEY
        Hash by TableId and primary keys.

        This strategy computes hash based on TableId (namespace, schema, table) combined with primary key column values. Events with the same TableId and primary key will be routed to the same subtask, while events from the same table with different primary keys may be spread across multiple subtasks for load balancing.

        This is suitable when you want good distribution of data across subtasks and don't require strict ordering within a table.

        This strategy is not supported for paimon, fluss, or maxcompute sinks.

      • TABLE_ID

        public static final HashFunctionStrategy TABLE_ID
        Hash by TableId only.

        This strategy computes hash based solely on TableId (namespace, schema, table), ignoring the record payload entirely. All events from the same table will be routed to the same subtask, ensuring per-table ordering semantics.

        This is suitable when:

        • The sink requires strict single-writer-per-table semantics.
        • The table has no primary key or has a changing primary key set.
        • You want to avoid cross-subtask reordering within the same table.

        This strategy is not supported for paimon, fluss, or maxcompute sinks.

    • Method Detail

      • values

        public static HashFunctionStrategy[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (HashFunctionStrategy c : HashFunctionStrategy.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static HashFunctionStrategy valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null