Interface TableSink


public interface TableSink
Interface for CDC table sink that allows writing data to a specific table.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Closes the sink, releasing any resources held by it.
    void
    Flushes the sink, ensuring that all data written so far is persisted.
    void
    init(org.apache.ignite.table.QualifiedName tableName, List<org.apache.ignite.internal.schema.Column> columns, SinkDefinition sinkDefinition)
    Initializes the sink with the specified table name, columns, and sink definition.
    void
    writeBatch(List<org.apache.ignite.table.TableRowEvent<Map.Entry<org.apache.ignite.table.Tuple,org.apache.ignite.table.Tuple>>> events)
    Writes a batch of table row events to the sink in temporal order.
  • Method Details

    • init

      void init(org.apache.ignite.table.QualifiedName tableName, List<org.apache.ignite.internal.schema.Column> columns, SinkDefinition sinkDefinition)
      Initializes the sink with the specified table name, columns, and sink definition. Must be called once.
      Parameters:
      tableName - The name of the table to write to.
      columns - The columns of the table.
      sinkDefinition - The definition of the sink.
    • writeBatch

      void writeBatch(List<org.apache.ignite.table.TableRowEvent<Map.Entry<org.apache.ignite.table.Tuple,org.apache.ignite.table.Tuple>>> events)
      Writes a batch of table row events to the sink in temporal order. Does not guarantee immediate persistence of the data.

      This method processes all event types (INSERT, UPDATE, DELETE, ARCHIVED) in the order they occurred, ensuring data consistency when multiple operations affect the same key within a batch.

      Parameters:
      events - The list of table row events in temporal order. Each event contains the operation type (CREATED, UPDATED, REMOVED, ARCHIVED) and associated data.
    • flush

      void flush()
      Flushes the sink, ensuring that all data written so far is persisted. This method should be called after writeBatch to ensure data is saved.
      Throws:
      CdcSinkFlushInternalException - If an error occurs during flushing.
    • close

      void close()
      Closes the sink, releasing any resources held by it.
      Throws:
      CdcSinkCloseInternalException - If an error occurs during closing.