Class PubSubPublisherSink<T>

java.lang.Object
io.github.flink.gcp.connector.pubsub.sink.PubSubPublisherSink<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>

@Internal public class PubSubPublisherSink<T> extends Object implements CrossVersionSink<T>
At-least-once sink publishing through google-cloud-pubsub Publisher instances with dynamic per-record topic destinations.
See Also:
  • Constructor Details

  • Method Details

    • getConfig

      public PubSubSinkConfig<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(PublisherFactory publisherFactory, TopicAdmin topicAdmin, 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 — that belongs to the production path above, so writer tests injecting fakes need no WriterInitContext.