InputT
- type of elements that should be persisted in the destination@PublicEvolving public class KinesisStreamsSinkBuilder<InputT> extends AsyncSinkBaseBuilder<InputT,software.amazon.awssdk.services.kinesis.model.PutRecordsRequestEntry,KinesisStreamsSinkBuilder<InputT>>
KinesisStreamsSink
.
The following example shows the minimum setup to create a KinesisStreamsSink
that
writes String values to a Kinesis Data Streams stream named your_stream_here.
KinesisStreamsSink<String> kdsSink =
KinesisStreamsSink.<String>builder()
.setElementConverter(elementConverter)
.setStreamName("your_stream_name")
.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
Modifier and Type | Method and Description |
---|---|
KinesisStreamsSink<InputT> |
build()
Builds the Sink with the settings applied to this builder.
|
KinesisStreamsSinkBuilder<InputT> |
setFailOnError(boolean failOnError) |
KinesisStreamsSinkBuilder<InputT> |
setKinesisClientProperties(Properties kinesisClientProperties) |
KinesisStreamsSinkBuilder<InputT> |
setPartitionKeyGenerator(PartitionKeyGenerator<InputT> partitionKeyGenerator) |
KinesisStreamsSinkBuilder<InputT> |
setSerializationSchema(SerializationSchema<InputT> serializationSchema) |
KinesisStreamsSinkBuilder<InputT> |
setStreamName(String streamName)
Sets the name of the KDS stream that the sink will connect to.
|
getMaxBatchSize, getMaxBatchSizeInBytes, getMaxBufferedRequests, getMaxInFlightRequests, getMaxRecordSizeInBytes, getMaxTimeInBufferMS, setMaxBatchSize, setMaxBatchSizeInBytes, setMaxBufferedRequests, setMaxInFlightRequests, setMaxRecordSizeInBytes, setMaxTimeInBufferMS
public KinesisStreamsSinkBuilder<InputT> setStreamName(String streamName)
streamName
- the name of the streamKinesisStreamsSinkBuilder
itselfpublic KinesisStreamsSinkBuilder<InputT> setSerializationSchema(SerializationSchema<InputT> serializationSchema)
public KinesisStreamsSinkBuilder<InputT> setPartitionKeyGenerator(PartitionKeyGenerator<InputT> partitionKeyGenerator)
public KinesisStreamsSinkBuilder<InputT> setFailOnError(boolean failOnError)
public KinesisStreamsSinkBuilder<InputT> setKinesisClientProperties(Properties kinesisClientProperties)
public KinesisStreamsSink<InputT> build()
AsyncSinkBaseBuilder
build
in class AsyncSinkBaseBuilder<InputT,software.amazon.awssdk.services.kinesis.model.PutRecordsRequestEntry,KinesisStreamsSinkBuilder<InputT>>
Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.