Package org.apache.flink.cdc.common.sink
Class TableIdHashFunctionProvider
- java.lang.Object
-
- org.apache.flink.cdc.common.sink.TableIdHashFunctionProvider
-
- All Implemented Interfaces:
Serializable,HashFunctionProvider<DataChangeEvent>
public class TableIdHashFunctionProvider extends Object implements HashFunctionProvider<DataChangeEvent>
AHashFunctionProviderimplementation that hashes events based solely onTableId.This provider ensures all events from the same table are routed to the same downstream subtask, regardless of their primary key values or record payload. The hash is computed once when the HashFunction is created and cached for all subsequent events.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description TableIdHashFunctionProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HashFunction<DataChangeEvent>getHashFunction(TableId tableId, Schema schema)Gets a hash function based on the given table ID and schema, to helpPrePartitionOperatorto shuffleDataChangeEventto designated subtask.
-
-
-
Method Detail
-
getHashFunction
public HashFunction<DataChangeEvent> getHashFunction(@Nullable TableId tableId, Schema schema)
Description copied from interface:HashFunctionProviderGets a hash function based on the given table ID and schema, to helpPrePartitionOperatorto shuffleDataChangeEventto designated subtask.- Specified by:
getHashFunctionin interfaceHashFunctionProvider<DataChangeEvent>- Parameters:
tableId- table IDschema- flink table schema- Returns:
- hash function based on the given table ID and schema
-
-