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>>
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
| 限定符和类型 | 方法和说明 |
|---|---|
KinesisStreamsSink<InputT> |
build() |
KinesisStreamsSinkBuilder<InputT> |
setFailOnError(boolean failOnError) |
KinesisStreamsSinkBuilder<InputT> |
setKinesisClientProperties(Properties kinesisClientProperties) |
KinesisStreamsSinkBuilder<InputT> |
setPartitionKeyGenerator(PartitionKeyGenerator<InputT> partitionKeyGenerator) |
KinesisStreamsSinkBuilder<InputT> |
setSerializationSchema(org.apache.flink.api.common.serialization.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, setMaxTimeInBufferMSpublic KinesisStreamsSinkBuilder<InputT> setStreamName(String streamName)
streamName - the name of the streamKinesisStreamsSinkBuilder itselfpublic KinesisStreamsSinkBuilder<InputT> setSerializationSchema(org.apache.flink.api.common.serialization.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()
build 在类中 org.apache.flink.connector.base.sink.AsyncSinkBaseBuilder<InputT,software.amazon.awssdk.services.kinesis.model.PutRecordsRequestEntry,KinesisStreamsSinkBuilder<InputT>>Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.