Class FlinkKinesisProducer<OUT>

  • Type Parameters:
    OUT - Data type to produce into Kinesis Streams
    All Implemented Interfaces:
    Serializable, org.apache.flink.api.common.functions.Function, org.apache.flink.api.common.functions.RichFunction, org.apache.flink.streaming.api.checkpoint.CheckpointedFunction, org.apache.flink.streaming.api.functions.sink.SinkFunction<OUT>

    @Deprecated
    @PublicEvolving
    public class FlinkKinesisProducer<OUT>
    extends org.apache.flink.streaming.api.functions.sink.RichSinkFunction<OUT>
    implements org.apache.flink.streaming.api.checkpoint.CheckpointedFunction
    Deprecated.
    This producer based on the Kinesis Producer Library KPL has been superseded. The new sink can be found in the module flink-connectors/flink-connector-aws-kinesis-streams and package KinesisStreamsSink. It is based on the AWS SDK for Java 2.x. The work to replace this sink was carried out in FLINK-24227.
    The FlinkKinesisProducer allows to produce from a Flink DataStream into Kinesis.
    See Also:
    Serialized Form
    • Constructor Detail

      • FlinkKinesisProducer

        public FlinkKinesisProducer​(org.apache.flink.api.common.serialization.SerializationSchema<OUT> schema,
                                    Properties configProps)
        Deprecated.
        Create a new FlinkKinesisProducer. This is a constructor supporting Flink's {@see SerializationSchema}.
        Parameters:
        schema - Serialization schema for the data type
        configProps - The properties used to configure KinesisProducer, including AWS credentials and AWS region
      • FlinkKinesisProducer

        public FlinkKinesisProducer​(KinesisSerializationSchema<OUT> schema,
                                    Properties configProps)
        Deprecated.
        Create a new FlinkKinesisProducer. This is a constructor supporting {@see KinesisSerializationSchema}.
        Parameters:
        schema - Kinesis serialization schema for the data type
        configProps - The properties used to configure KinesisProducer, including AWS credentials and AWS region
    • Method Detail

      • setFailOnError

        public void setFailOnError​(boolean failOnError)
        Deprecated.
        If set to true, the producer will immediately fail with an exception on any error. Otherwise, the errors are logged and the producer goes on.
        Parameters:
        failOnError - Error behavior flag
      • setQueueLimit

        public void setQueueLimit​(int queueLimit)
        Deprecated.
        The KinesisProducer holds an unbounded queue internally. To avoid memory problems under high loads, a limit can be employed above which the internal queue will be flushed, thereby applying backpressure.
        Parameters:
        queueLimit - The maximum length of the internal queue before backpressuring
      • setDefaultStream

        public void setDefaultStream​(String defaultStream)
        Deprecated.
        Set a default stream name.
        Parameters:
        defaultStream - Name of the default Kinesis stream
      • setDefaultPartition

        public void setDefaultPartition​(String defaultPartition)
        Deprecated.
        Set default partition id.
        Parameters:
        defaultPartition - Name of the default partition
      • setCustomPartitioner

        public void setCustomPartitioner​(KinesisPartitioner<OUT> partitioner)
        Deprecated.
      • open

        public void open​(org.apache.flink.configuration.Configuration parameters)
                  throws Exception
        Deprecated.
        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
      • invoke

        public void invoke​(OUT value,
                           org.apache.flink.streaming.api.functions.sink.SinkFunction.Context context)
                    throws Exception
        Deprecated.
        Specified by:
        invoke in interface org.apache.flink.streaming.api.functions.sink.SinkFunction<OUT>
        Throws:
        Exception
      • close

        public void close()
                   throws Exception
        Deprecated.
        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
      • initializeState

        public void initializeState​(org.apache.flink.runtime.state.FunctionInitializationContext context)
                             throws Exception
        Deprecated.
        Specified by:
        initializeState in interface org.apache.flink.streaming.api.checkpoint.CheckpointedFunction
        Throws:
        Exception
      • snapshotState

        public void snapshotState​(org.apache.flink.runtime.state.FunctionSnapshotContext context)
                           throws Exception
        Deprecated.
        Specified by:
        snapshotState in interface org.apache.flink.streaming.api.checkpoint.CheckpointedFunction
        Throws:
        Exception
      • getKinesisProducer

        @VisibleForTesting
        protected com.amazonaws.services.kinesis.producer.KinesisProducer getKinesisProducer​(com.amazonaws.services.kinesis.producer.KinesisProducerConfiguration producerConfig)
        Deprecated.
        Creates a KinesisProducer. Exposed so that tests can inject mock producers easily.