Class SpannerMutationsSink<T>

java.lang.Object
io.github.flink.gcp.connector.spanner.sink.SpannerMutationsSink<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 SpannerMutationsSink<T> extends Object implements CrossVersionSink<T>, org.apache.flink.streaming.api.lineage.LineageVertexProvider
At-least-once sink applying one mutation per record through batchWriteAtLeastOnce of google-cloud-spanner.
See Also:
  • Constructor Details

  • Method Details

    • getConfig

      public SpannerSinkConfig<T> getConfig()
      Returns the sink configuration.
    • getLineageVertex

      public org.apache.flink.streaming.api.lineage.LineageVertex getLineageVertex()
      Specified by:
      getLineageVertex in interface org.apache.flink.streaming.api.lineage.LineageVertexProvider
    • 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(SpannerDatabaseAccess access, CellWeights cellWeights, org.apache.flink.metrics.groups.SinkWriterMetricGroup metricGroup)
      Creates the writer against an injected database access. Deliberately does not open the failure handler — that belongs to the production path above, so writer tests injecting fakes need no WriterInitContext.