Class ExtendedBucketStreamWriteFunction

  • All Implemented Interfaces:
    Serializable, org.apache.flink.api.common.functions.Function, org.apache.flink.api.common.functions.RichFunction, org.apache.flink.streaming.api.checkpoint.CheckpointedFunction, org.apache.flink.streaming.api.operators.BoundedOneInput

    public class ExtendedBucketStreamWriteFunction
    extends org.apache.hudi.sink.bucket.BucketStreamWriteFunction
    Extended version of BucketStreamWriteFunction that exposes a public setter for the checkpoint ID.

    This class is necessary because the parent class's checkpointId field is protected and inaccessible from composition-based multi-table write functions. In a multi-table CDC sink, each table requires its own write function instance, and these instances must be updated with the current checkpoint ID for proper coordinator communication during checkpointing.

    The public setCheckpointId(long) method provides a clean API for parent write functions to update the checkpoint ID without resorting to reflection-based access.

    See Also:
    BucketStreamWriteFunction, MultiTableEventStreamWriteFunction, Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.apache.hudi.sink.StreamWriteFunction

        org.apache.hudi.sink.StreamWriteFunction.WriteFunction
      • Nested classes/interfaces inherited from class org.apache.flink.streaming.api.functions.ProcessFunction

        org.apache.flink.streaming.api.functions.ProcessFunction.Context, org.apache.flink.streaming.api.functions.ProcessFunction.OnTimerContext
    • Field Summary

      • Fields inherited from class org.apache.hudi.sink.StreamWriteFunction

        keyGen, memorySegmentPool, recordConverter, rowType, writeFunction, writeMetrics
      • Fields inherited from class org.apache.hudi.sink.common.AbstractStreamWriteFunction

        checkpointId, config, correspondent, currentInstant, eventGateway, metaClient, taskID, writeClient, writeStatuses
    • Constructor Summary

      Constructors 
      Constructor Description
      ExtendedBucketStreamWriteFunction​(org.apache.flink.configuration.Configuration config, org.apache.flink.table.types.logical.RowType rowType)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void setCheckpointId​(long checkpointId)
      Sets the checkpoint ID for this write function.
      • Methods inherited from class org.apache.hudi.sink.bucket.BucketStreamWriteFunction

        initializeState, isBucketToLoad, open, processElement, snapshotState
      • Methods inherited from class org.apache.hudi.sink.StreamWriteFunction

        bufferRecord, close, deduplicateRecordsIfNeeded, endInput, flushRemaining, getDataBuffer, writeRecords
      • Methods inherited from class org.apache.hudi.sink.common.AbstractStreamWriteFunction

        getCorrespondent, getOperatorEventGateway, handleOperatorEvent, instantToWrite, setCorrespondent, setOperatorEventGateway, snapshotState
      • Methods inherited from class org.apache.flink.streaming.api.functions.ProcessFunction

        onTimer
      • Methods inherited from class org.apache.flink.api.common.functions.AbstractRichFunction

        getIterationRuntimeContext, getRuntimeContext, setRuntimeContext
      • Methods inherited from interface org.apache.flink.api.common.functions.RichFunction

        open
    • Constructor Detail

      • ExtendedBucketStreamWriteFunction

        public ExtendedBucketStreamWriteFunction​(org.apache.flink.configuration.Configuration config,
                                                 org.apache.flink.table.types.logical.RowType rowType)
    • Method Detail

      • setCheckpointId

        public void setCheckpointId​(long checkpointId)
        Sets the checkpoint ID for this write function.

        This method provides public access to update the protected checkpointId field inherited from the parent class. The checkpoint ID is required for the write function to properly communicate with the coordinator during checkpoint operations.

        Parameters:
        checkpointId - the checkpoint ID to set