public abstract static class KinesisIO.Write<T> extends PTransform<PCollection<T>,KinesisIO.Write.Result>
KinesisIO.write()
.Modifier and Type | Class and Description |
---|---|
static class |
KinesisIO.Write.Result
Result of
KinesisIO.write() . |
name, resourceHints
Constructor and Description |
---|
Write() |
Modifier and Type | Method and Description |
---|---|
KinesisIO.Write.Result |
expand(PCollection<T> input)
Override this method to specify how this
PTransform should be expanded on the given
InputT . |
KinesisIO.Write<T> |
withBatchMaxBytes(int bytes)
Max.
|
KinesisIO.Write<T> |
withBatchMaxRecords(int records)
Max.
|
KinesisIO.Write<T> |
withClientConfiguration(ClientConfiguration config)
Configuration of Kinesis client.
|
KinesisIO.Write<T> |
withConcurrentRequests(int concurrentRequests)
Max number of concurrent batch write requests per bundle.
|
KinesisIO.Write<T> |
withPartitioner(KinesisPartitioner<T> partitioner)
Specify how to partition records among all stream shards (required).
|
KinesisIO.Write<T> |
withRecordAggregation(java.util.function.Consumer<KinesisIO.RecordAggregation.Builder> aggregation)
Enable record aggregation that is compatible with the KPL / KCL.
|
KinesisIO.Write<T> |
withRecordAggregation(KinesisIO.RecordAggregation aggregation)
Enable record aggregation that is compatible with the KPL / KCL.
|
KinesisIO.Write<T> |
withRecordAggregationDisabled()
Disable KPL / KCL like record aggregation.
|
KinesisIO.Write<T> |
withSerializer(SerializableFunction<T,byte[]> serializer)
Specify how to serialize records to bytes on the stream (required).
|
KinesisIO.Write<T> |
withStreamName(java.lang.String streamName)
Kinesis stream name which will be used for writing (required).
|
compose, compose, getAdditionalInputs, getDefaultOutputCoder, getDefaultOutputCoder, getDefaultOutputCoder, getKindString, getName, getResourceHints, populateDisplayData, setResourceHints, toString, validate
public KinesisIO.Write<T> withStreamName(java.lang.String streamName)
public KinesisIO.Write<T> withBatchMaxRecords(int records)
public KinesisIO.Write<T> withBatchMaxBytes(int bytes)
Single records that exceed this limit are sent individually. Though, be careful to not violate the AWS API limit of 1MB per request.
This includes both partition keys and data.
public KinesisIO.Write<T> withConcurrentRequests(int concurrentRequests)
Note: Concurrency settings above the default have caused a bug in the AWS SDK v2. Therefore, this configuration is currently not exposed to users.
public KinesisIO.Write<T> withRecordAggregation(KinesisIO.RecordAggregation aggregation)
https://docs.aws.amazon.com/streams/latest/dev/kinesis-kpl-concepts.html#kinesis-kpl-concepts-aggretation
Note: The aggregation is a lot simpler than the one offered by KPL. It only aggregates records with the same partition key as it's not aware of explicit hash key ranges per shard.
public KinesisIO.Write<T> withRecordAggregation(java.util.function.Consumer<KinesisIO.RecordAggregation.Builder> aggregation)
https://docs.aws.amazon.com/streams/latest/dev/kinesis-kpl-concepts.html#kinesis-kpl-concepts-aggretation
Note: The aggregation is a lot simpler than the one offered by KPL. It only aggregates records with the same partition key as it's not aware of explicit hash key ranges per shard.
public KinesisIO.Write<T> withRecordAggregationDisabled()
public KinesisIO.Write<T> withPartitioner(KinesisPartitioner<T> partitioner)
The partitioner is critical to distribute new records among all stream shards.
public KinesisIO.Write<T> withSerializer(SerializableFunction<T,byte[]> serializer)
public KinesisIO.Write<T> withClientConfiguration(ClientConfiguration config)
public KinesisIO.Write.Result expand(PCollection<T> input)
PTransform
PTransform
should be expanded on the given
InputT
.
NOTE: This method should not be called directly. Instead apply the PTransform
should
be applied to the InputT
using the apply
method.
Composite transforms, which are defined in terms of other transforms, should return the output of one of the composed transforms. Non-composite transforms, which do not apply any transforms internally, should return a new unbound output and register evaluators (via backend-specific registration methods).
expand
in class PTransform<PCollection<T>,KinesisIO.Write.Result>