Class KinesisStreamsSinkBuilder<InputT>

  • Type Parameters:
    InputT - type of elements that should be persisted in the destination

    @PublicEvolving
    public class KinesisStreamsSinkBuilder<InputT>
    extends org.apache.flink.connector.base.sink.AsyncSinkBaseBuilder<InputT,​software.amazon.awssdk.services.kinesis.model.PutRecordsRequestEntry,​KinesisStreamsSinkBuilder<InputT>>
    Builder to construct KinesisStreamsSink.

    The following example shows the minimum setup to create a KinesisStreamsSink that writes String values to a Kinesis Data Streams stream.

    
     KinesisStreamsSink<String> kdsSink =
                     KinesisStreamsSink.<String>builder()
                             .setElementConverter(elementConverter)
                             .setStreamArn("your_stream_arn")
                             .setSerializationSchema(new SimpleStringSchema())
                             .setPartitionKeyGenerator(element -> String.valueOf(element.hashCode()))
                             .build();
     

    If the following parameters are not set in this builder, the following defaults will be used:

    • maxBatchSize will be 500
    • maxInFlightRequests will be 50
    • maxBufferedRequests will be 10000
    • maxBatchSizeInBytes will be 5 MB i.e. 5 * 1024 * 1024
    • maxTimeInBufferMS will be 5000ms
    • maxRecordSizeInBytes will be 1 MB i.e. 1 * 1024 * 1024
    • failOnError will be false