Class BigtableMutateRowsSink<T>

java.lang.Object
io.github.flink.gcp.connector.bigtable.sink.BigtableMutateRowsSink<T>
Type Parameters:
T - type of the records written by the sink
All Implemented Interfaces:
CrossVersionSink<T>, Serializable, org.apache.flink.api.connector.sink2.Sink<T>, org.apache.flink.streaming.api.lineage.LineageVertexProvider

@Internal public class BigtableMutateRowsSink<T> extends Object implements CrossVersionSink<T>, org.apache.flink.streaming.api.lineage.LineageVertexProvider
At-least-once sink applying one row mutation per record through the MutateRows bulk batcher of google-cloud-bigtable.
See Also:
  • Constructor Details

    • BigtableMutateRowsSink

      public BigtableMutateRowsSink(BigtableSinkConfig<T> config)
      Creates the sink; called by BigtableSinkBuilder.
      Parameters:
      config - the sink configuration
    • BigtableMutateRowsSink

      public BigtableMutateRowsSink(BigtableSinkConfig<T> config, @Nullable TableDestination initialDestination, @Nullable TableCreateOptions expectedFamilies)
      Creates a Table sink that validates its fixed destination when its writer starts. The destination and expected families must either both be supplied or both be absent.
  • Method Details

    • withTableLineage

      public BigtableMutateRowsSink<T> withTableLineage(String logicalName)
      Returns a copy retaining the writer configuration and startup family validation.
    • getLineageVertex

      public org.apache.flink.streaming.api.lineage.LineageVertex getLineageVertex()
      Specified by:
      getLineageVertex in interface org.apache.flink.streaming.api.lineage.LineageVertexProvider
    • getConfig

      public BigtableSinkConfig<T> getConfig()
      Returns the sink configuration.
    • createWriter

      public org.apache.flink.api.connector.sink2.SinkWriter<T> createWriter(org.apache.flink.api.connector.sink2.WriterInitContext context) throws IOException
      Specified by:
      createWriter in interface org.apache.flink.api.connector.sink2.Sink<T>
      Throws:
      IOException
    • createWriter

      @VisibleForTesting public org.apache.flink.api.connector.sink2.SinkWriter<T> createWriter(MutationBatcherFactory factory, TableAdmin tableAdmin, org.apache.flink.api.common.operators.MailboxExecutor mailboxExecutor, org.apache.flink.metrics.groups.SinkWriterMetricGroup metricGroup)
      Creates the writer against an injected batcher factory and table admin. Deliberately does not open the failure handler — that belongs to the production path above, so writer tests injecting fakes need no WriterInitContext. Table-specific startup validation also belongs to the production lifecycle above; writer tests may call BigtableWriter.prepareTable(TableDestination, TableCreateOptions) explicitly.