Class KinesisStreamsSink<InputT>
- java.lang.Object
-
- org.apache.flink.connector.base.sink.AsyncSinkBase<InputT,software.amazon.awssdk.services.kinesis.model.PutRecordsRequestEntry>
-
- org.apache.flink.connector.kinesis.sink.KinesisStreamsSink<InputT>
-
- Type Parameters:
InputT- Type of the elements handled by this sink
- All Implemented Interfaces:
Serializable,org.apache.flink.api.connector.sink2.Sink<InputT>,org.apache.flink.api.connector.sink2.StatefulSink<InputT,org.apache.flink.connector.base.sink.writer.BufferedRequestState<software.amazon.awssdk.services.kinesis.model.PutRecordsRequestEntry>>
@PublicEvolving public class KinesisStreamsSink<InputT> extends org.apache.flink.connector.base.sink.AsyncSinkBase<InputT,software.amazon.awssdk.services.kinesis.model.PutRecordsRequestEntry>A Kinesis Data Streams (KDS) Sink that performs async requests against a destination stream using the buffering protocol specified inAsyncSinkBase.The sink internally uses a
KinesisAsyncClientto communicate with the AWS endpoint.The behaviour of the buffering may be specified by providing configuration during the sink build time.
maxBatchSize: the maximum size of a batch of entries that may be sent to KDSmaxInFlightRequests: the maximum number of in flight requests that may exist, if any more in flight requests need to be initiated once the maximum has been reached, then it will be blocked until some have completedmaxBufferedRequests: the maximum number of elements held in the buffer, requests to add elements will be blocked while the number of elements in the buffer is at the maximummaxBatchSizeInBytes: the maximum size of a batch of entries that may be sent to KDS measured in bytesmaxTimeInBufferMS: the maximum amount of time an entry is allowed to live in the buffer, if any element reaches this age, the entire buffer will be flushed immediatelymaxRecordSizeInBytes: the maximum size of a record the sink will accept into the buffer, a record of size larger than this will be rejected when passed to the sinkfailOnError: when an exception is encountered while persisting to Kinesis Data Streams, the job will fail immediately if failOnError is set
Please see the writer implementation in
KinesisStreamsSinkWriter- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <InputT> KinesisStreamsSinkBuilder<InputT>builder()Create aKinesisStreamsSinkBuilderto allow the fluent construction of a newKinesisStreamsSink.org.apache.flink.api.connector.sink2.StatefulSink.StatefulSinkWriter<InputT,org.apache.flink.connector.base.sink.writer.BufferedRequestState<software.amazon.awssdk.services.kinesis.model.PutRecordsRequestEntry>>createWriter(org.apache.flink.api.connector.sink2.Sink.InitContext context)org.apache.flink.core.io.SimpleVersionedSerializer<org.apache.flink.connector.base.sink.writer.BufferedRequestState<software.amazon.awssdk.services.kinesis.model.PutRecordsRequestEntry>>getWriterStateSerializer()org.apache.flink.api.connector.sink2.StatefulSink.StatefulSinkWriter<InputT,org.apache.flink.connector.base.sink.writer.BufferedRequestState<software.amazon.awssdk.services.kinesis.model.PutRecordsRequestEntry>>restoreWriter(org.apache.flink.api.connector.sink2.Sink.InitContext context, Collection<org.apache.flink.connector.base.sink.writer.BufferedRequestState<software.amazon.awssdk.services.kinesis.model.PutRecordsRequestEntry>> recoveredState)
-
-
-
Method Detail
-
builder
public static <InputT> KinesisStreamsSinkBuilder<InputT> builder()
Create aKinesisStreamsSinkBuilderto allow the fluent construction of a newKinesisStreamsSink.- Type Parameters:
InputT- type of incoming records- Returns:
KinesisStreamsSinkBuilder
-
createWriter
@Internal public org.apache.flink.api.connector.sink2.StatefulSink.StatefulSinkWriter<InputT,org.apache.flink.connector.base.sink.writer.BufferedRequestState<software.amazon.awssdk.services.kinesis.model.PutRecordsRequestEntry>> createWriter(org.apache.flink.api.connector.sink2.Sink.InitContext context) throws IOException
- Throws:
IOException
-
getWriterStateSerializer
@Internal public org.apache.flink.core.io.SimpleVersionedSerializer<org.apache.flink.connector.base.sink.writer.BufferedRequestState<software.amazon.awssdk.services.kinesis.model.PutRecordsRequestEntry>> getWriterStateSerializer()
-
restoreWriter
@Internal public org.apache.flink.api.connector.sink2.StatefulSink.StatefulSinkWriter<InputT,org.apache.flink.connector.base.sink.writer.BufferedRequestState<software.amazon.awssdk.services.kinesis.model.PutRecordsRequestEntry>> restoreWriter(org.apache.flink.api.connector.sink2.Sink.InitContext context, Collection<org.apache.flink.connector.base.sink.writer.BufferedRequestState<software.amazon.awssdk.services.kinesis.model.PutRecordsRequestEntry>> recoveredState) throws IOException
- Throws:
IOException
-
-