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 Summary
ConstructorsConstructorDescriptionSpannerMutationsSink(SpannerSinkConfig<T> config) Creates the sink; called bySpannerSinkBuilder. -
Method Summary
Modifier and TypeMethodDescriptionorg.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.org.apache.flink.api.connector.sink2.SinkWriter<T>createWriter(org.apache.flink.api.connector.sink2.WriterInitContext context) Returns the sink configuration.org.apache.flink.streaming.api.lineage.LineageVertex
-
Constructor Details
-
SpannerMutationsSink
Creates the sink; called bySpannerSinkBuilder.- Parameters:
config- the sink configuration
-
-
Method Details
-
getConfig
Returns the sink configuration. -
getLineageVertex
public org.apache.flink.streaming.api.lineage.LineageVertex getLineageVertex()- Specified by:
getLineageVertexin interfaceorg.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:
createWriterin interfaceorg.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 noWriterInitContext.
-