Class PubSubSource<OUT>

  • All Implemented Interfaces:
    Serializable, org.apache.flink.api.common.functions.Function, org.apache.flink.api.common.functions.RichFunction, org.apache.flink.api.common.state.CheckpointListener, org.apache.flink.api.java.typeutils.ResultTypeQueryable<OUT>, org.apache.flink.streaming.api.checkpoint.ListCheckpointed<AcknowledgeIdsForCheckpoint<String>>, org.apache.flink.streaming.api.functions.source.ParallelSourceFunction<OUT>, org.apache.flink.streaming.api.functions.source.SourceFunction<OUT>

    public class PubSubSource<OUT>
    extends org.apache.flink.streaming.api.functions.source.RichSourceFunction<OUT>
    implements org.apache.flink.api.java.typeutils.ResultTypeQueryable<OUT>, org.apache.flink.streaming.api.functions.source.ParallelSourceFunction<OUT>, org.apache.flink.api.common.state.CheckpointListener, org.apache.flink.streaming.api.checkpoint.ListCheckpointed<AcknowledgeIdsForCheckpoint<String>>
    PubSub Source, this Source will consume PubSub messages from a subscription and Acknowledge them on the next checkpoint. This ensures every message will get acknowledged at least once.
    See Also:
    Serialized Form
    • Field Detail

      • credentials

        protected final com.google.auth.Credentials credentials
      • acknowledgeOnCheckpointFactory

        protected final org.apache.flink.streaming.connectors.gcp.pubsub.PubSubSource.AcknowledgeOnCheckpointFactory acknowledgeOnCheckpointFactory
      • rateLimiter

        protected final org.apache.flink.api.common.io.ratelimiting.FlinkConnectorRateLimiter rateLimiter
      • messagePerSecondRateLimit

        protected final int messagePerSecondRateLimit
      • isRunning

        protected transient volatile boolean isRunning
    • Method Detail

      • open

        public void open​(org.apache.flink.configuration.Configuration configuration)
                  throws Exception
        Specified by:
        open in interface org.apache.flink.api.common.functions.RichFunction
        Overrides:
        open in class org.apache.flink.api.common.functions.AbstractRichFunction
        Throws:
        Exception
      • run

        public void run​(org.apache.flink.streaming.api.functions.source.SourceFunction.SourceContext<OUT> sourceContext)
                 throws Exception
        Specified by:
        run in interface org.apache.flink.streaming.api.functions.source.SourceFunction<OUT>
        Throws:
        Exception
      • close

        public void close()
                   throws Exception
        Specified by:
        close in interface org.apache.flink.api.common.functions.RichFunction
        Overrides:
        close in class org.apache.flink.api.common.functions.AbstractRichFunction
        Throws:
        Exception
      • cancel

        public void cancel()
        Specified by:
        cancel in interface org.apache.flink.streaming.api.functions.source.SourceFunction<OUT>
      • getProducedType

        public org.apache.flink.api.common.typeinfo.TypeInformation<OUT> getProducedType()
        Specified by:
        getProducedType in interface org.apache.flink.api.java.typeutils.ResultTypeQueryable<OUT>
      • notifyCheckpointComplete

        public void notifyCheckpointComplete​(long checkpointId)
                                      throws Exception
        Specified by:
        notifyCheckpointComplete in interface org.apache.flink.api.common.state.CheckpointListener
        Throws:
        Exception
      • notifyCheckpointAborted

        public void notifyCheckpointAborted​(long checkpointId)
        Specified by:
        notifyCheckpointAborted in interface org.apache.flink.api.common.state.CheckpointListener