Class FlinkKinesisProducer<OUT>
- java.lang.Object
-
- org.apache.flink.api.common.functions.AbstractRichFunction
-
- org.apache.flink.streaming.api.functions.sink.RichSinkFunction<OUT>
-
- org.apache.flink.streaming.connectors.kinesis.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 moduleflink-connectors/flink-connector-aws-kinesis-streamsand packageKinesisStreamsSink. 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
-
-
Field Summary
Fields Modifier and Type Field Description static StringKINESIS_PRODUCER_METRIC_GROUPDeprecated.static StringKINESIS_PRODUCER_RELEASE_HOOK_NAMEDeprecated.static StringMETRIC_BACKPRESSURE_CYCLESDeprecated.static StringMETRIC_OUTSTANDING_RECORDS_COUNTDeprecated.
-
Constructor Summary
Constructors Constructor Description FlinkKinesisProducer(org.apache.flink.api.common.serialization.SerializationSchema<OUT> schema, Properties configProps)Deprecated.Create a new FlinkKinesisProducer.FlinkKinesisProducer(KinesisSerializationSchema<OUT> schema, Properties configProps)Deprecated.Create a new FlinkKinesisProducer.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidclose()Deprecated.protected com.amazonaws.services.kinesis.producer.KinesisProducergetKinesisProducer(com.amazonaws.services.kinesis.producer.KinesisProducerConfiguration producerConfig)Deprecated.Creates aKinesisProducer.voidinitializeState(org.apache.flink.runtime.state.FunctionInitializationContext context)Deprecated.voidinvoke(OUT value, org.apache.flink.streaming.api.functions.sink.SinkFunction.Context context)Deprecated.voidopen(org.apache.flink.configuration.Configuration parameters)Deprecated.voidsetCustomPartitioner(KinesisPartitioner<OUT> partitioner)Deprecated.voidsetDefaultPartition(String defaultPartition)Deprecated.Set default partition id.voidsetDefaultStream(String defaultStream)Deprecated.Set a default stream name.voidsetFailOnError(boolean failOnError)Deprecated.If set to true, the producer will immediately fail with an exception on any error.voidsetQueueLimit(int queueLimit)Deprecated.TheKinesisProducerholds an unbounded queue internally.voidsnapshotState(org.apache.flink.runtime.state.FunctionSnapshotContext context)Deprecated.-
Methods inherited from class org.apache.flink.api.common.functions.AbstractRichFunction
getIterationRuntimeContext, getRuntimeContext, setRuntimeContext
-
-
-
-
Field Detail
-
KINESIS_PRODUCER_METRIC_GROUP
public static final String KINESIS_PRODUCER_METRIC_GROUP
Deprecated.- See Also:
- Constant Field Values
-
METRIC_BACKPRESSURE_CYCLES
public static final String METRIC_BACKPRESSURE_CYCLES
Deprecated.- See Also:
- Constant Field Values
-
METRIC_OUTSTANDING_RECORDS_COUNT
public static final String METRIC_OUTSTANDING_RECORDS_COUNT
Deprecated.- See Also:
- Constant Field Values
-
KINESIS_PRODUCER_RELEASE_HOOK_NAME
public static final String KINESIS_PRODUCER_RELEASE_HOOK_NAME
Deprecated.- See Also:
- Constant Field Values
-
-
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 typeconfigProps- 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 typeconfigProps- 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.TheKinesisProducerholds 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 ExceptionDeprecated.- Specified by:
openin interfaceorg.apache.flink.api.common.functions.RichFunction- Overrides:
openin classorg.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.
-
close
public void close() throws ExceptionDeprecated.- Specified by:
closein interfaceorg.apache.flink.api.common.functions.RichFunction- Overrides:
closein classorg.apache.flink.api.common.functions.AbstractRichFunction- Throws:
Exception
-
initializeState
public void initializeState(org.apache.flink.runtime.state.FunctionInitializationContext context) throws ExceptionDeprecated.- Specified by:
initializeStatein interfaceorg.apache.flink.streaming.api.checkpoint.CheckpointedFunction- Throws:
Exception
-
snapshotState
public void snapshotState(org.apache.flink.runtime.state.FunctionSnapshotContext context) throws ExceptionDeprecated.- Specified by:
snapshotStatein interfaceorg.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 aKinesisProducer. Exposed so that tests can inject mock producers easily.
-
-