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 Summary
ConstructorsConstructorDescriptionBigtableMutateRowsSink(BigtableSinkConfig<T> config) Creates the sink; called byBigtableSinkBuilder.BigtableMutateRowsSink(BigtableSinkConfig<T> config, TableDestination initialDestination, TableCreateOptions expectedFamilies) Creates a Table sink that validates its fixed destination when its writer starts. -
Method Summary
Modifier and TypeMethodDescriptionorg.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.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.LineageVertexwithTableLineage(String logicalName) Returns a copy retaining the writer configuration and startup family validation.
-
Constructor Details
-
BigtableMutateRowsSink
Creates the sink; called byBigtableSinkBuilder.- 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
Returns a copy retaining the writer configuration and startup family validation. -
getLineageVertex
public org.apache.flink.streaming.api.lineage.LineageVertex getLineageVertex()- Specified by:
getLineageVertexin interfaceorg.apache.flink.streaming.api.lineage.LineageVertexProvider
-
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:
createWriterin interfaceorg.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 noWriterInitContext. Table-specific startup validation also belongs to the production lifecycle above; writer tests may callBigtableWriter.prepareTable(TableDestination, TableCreateOptions)explicitly.
-