Class CloudTasksCreateTaskSink<T>
java.lang.Object
io.github.flink.gcp.connector.cloudtasks.sink.CloudTasksCreateTaskSink<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>
At-least-once sink creating one Cloud Tasks task per record through the
CreateTask RPC,
with fixed or per-record queue destinations.- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.flink.api.connector.sink2.SinkWriter<T>createWriter(TaskCreator creator, org.apache.flink.api.common.operators.MailboxExecutor mailboxExecutor, org.apache.flink.metrics.groups.SinkWriterMetricGroup metricGroup) Creates the writer against injected collaborators.org.apache.flink.api.connector.sink2.SinkWriter<T>createWriter(org.apache.flink.api.connector.sink2.WriterInitContext context) Returns the sink configuration.The factory the production path builds.
-
Constructor Details
-
CloudTasksCreateTaskSink
Creates the sink; called byCloudTasksSinkBuilder.- Parameters:
config- the sink configuration
-
-
Method Details
-
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
-
taskCreatorFactory
The factory the production path builds. A separate method so a test can assert the configuration actually reaches it — the wiring is three config lookups, and a dropped or swapped one compiles. -
createWriter
@VisibleForTesting public org.apache.flink.api.connector.sink2.SinkWriter<T> createWriter(TaskCreator creator, org.apache.flink.api.common.operators.MailboxExecutor mailboxExecutor, org.apache.flink.metrics.groups.SinkWriterMetricGroup metricGroup) Creates the writer against injected collaborators. Deliberately does not open the failure handler: opening belongs to the production path above, and a test driving this overload opens whatever it needs itself.
-