Interface TableSink
public interface TableSink
Interface for CDC table sink that allows writing data to a specific table.
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the sink, releasing any resources held by it.voidflush()Flushes the sink, ensuring that all data written so far is persisted.voidinit(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.voidremoveBatch(List<org.apache.ignite.table.Tuple> entriesToDelete) Removes a batch of tuples from the sink based on their keys.voidupdateKvBatch(List<Map.Entry<org.apache.ignite.table.Tuple, org.apache.ignite.table.Tuple>> kvBatch) Updates a batch of key-value tuples in the sink based on their keys.voidwriteBatch(List<org.apache.ignite.table.Tuple> batch) Writes a batch of tuples to the sink.voidwriteKvBatch(List<Map.Entry<org.apache.ignite.table.Tuple, org.apache.ignite.table.Tuple>> kvBatch) Writes a batch of key-value tuples to the sink.
-
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
Writes a batch of tuples to the sink. Does not guarantee immediate persistence of the data.- Parameters:
batch- The list of tuples to write to the sink.
-
writeKvBatch
void writeKvBatch(List<Map.Entry<org.apache.ignite.table.Tuple, org.apache.ignite.table.Tuple>> kvBatch) Writes a batch of key-value tuples to the sink. Does not guarantee immediate persistence of the data.- Parameters:
kvBatch- The list of key-value pairs to write to the sink, where each entry contains a key and a value as tuples.
-
updateKvBatch
void updateKvBatch(List<Map.Entry<org.apache.ignite.table.Tuple, org.apache.ignite.table.Tuple>> kvBatch) Updates a batch of key-value tuples in the sink based on their keys. Does not guarantee immediate persistence of the data.- Parameters:
kvBatch- The list of key-value pairs to update in the sink, where each entry contains a key and a value as tuples.
-
removeBatch
Removes a batch of tuples from the sink based on their keys. Does not guarantee immediate persistence of the data.- Parameters:
entriesToDelete- The list of keys (as tuples) to remove from the sink.
-
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.
-