public abstract static class KinesisIO.Read extends PTransform<PBegin,PCollection<KinesisRecord>>
KinesisIO.read()
.name, resourceHints
Constructor and Description |
---|
Read() |
Modifier and Type | Method and Description |
---|---|
PCollection<KinesisRecord> |
expand(PBegin input)
Override this method to specify how this
PTransform should be expanded on the given
InputT . |
KinesisIO.Read |
withArrivalTimeWatermarkPolicy()
Specifies the
WatermarkPolicyFactory as ArrivalTimeWatermarkPolicyFactory. |
KinesisIO.Read |
withArrivalTimeWatermarkPolicy(Duration watermarkIdleDurationThreshold)
Specifies the
WatermarkPolicyFactory as ArrivalTimeWatermarkPolicyFactory. |
KinesisIO.Read |
withAWSClientsProvider(AWSClientsProvider awsClientsProvider)
Allows to specify custom
AWSClientsProvider . |
KinesisIO.Read |
withAWSClientsProvider(java.lang.String awsAccessKey,
java.lang.String awsSecretKey,
Region region)
Specify credential details and region to be used to read from Kinesis.
|
KinesisIO.Read |
withAWSClientsProvider(java.lang.String awsAccessKey,
java.lang.String awsSecretKey,
Region region,
java.lang.String serviceEndpoint)
Specify credential details and region to be used to read from Kinesis.
|
KinesisIO.Read |
withCustomRateLimitPolicy(RateLimitPolicyFactory rateLimitPolicyFactory)
Specifies the
RateLimitPolicyFactory for a custom rate limiter. |
KinesisIO.Read |
withCustomWatermarkPolicy(WatermarkPolicyFactory watermarkPolicyFactory)
Specifies the
WatermarkPolicyFactory as a custom watermarkPolicyFactory. |
KinesisIO.Read |
withDynamicDelayRateLimitPolicy(java.util.function.Supplier<Duration> delay)
Specifies a dynamic delay rate limit policy with the given function being called at each
polling interval to get the next delay value.
|
KinesisIO.Read |
withFixedDelayRateLimitPolicy()
Specifies a fixed delay rate limit policy with the default delay of 1 second.
|
KinesisIO.Read |
withFixedDelayRateLimitPolicy(Duration delay)
Specifies a fixed delay rate limit policy with the given delay.
|
KinesisIO.Read |
withInitialPositionInStream(software.amazon.kinesis.common.InitialPositionInStream initialPosition)
Specify reading from some initial position in stream.
|
KinesisIO.Read |
withInitialTimestampInStream(Instant initialTimestamp)
Specify reading beginning at given
Instant . |
KinesisIO.Read |
withMaxCapacityPerShard(java.lang.Integer maxCapacity)
Specifies the maximum number of messages per one shard.
|
KinesisIO.Read |
withMaxNumRecords(long maxNumRecords)
Specifies to read at most a given number of records.
|
KinesisIO.Read |
withMaxReadTime(Duration maxReadTime)
Specifies to read records during
maxReadTime . |
KinesisIO.Read |
withProcessingTimeWatermarkPolicy()
Specifies the
WatermarkPolicyFactory as ProcessingTimeWatermarkPolicyFactory. |
KinesisIO.Read |
withRequestRecordsLimit(int limit)
Specifies the maximum number of records in GetRecordsResult returned by GetRecords call which
is limited by 10K records.
|
KinesisIO.Read |
withStreamName(java.lang.String streamName)
Specify reading from streamName.
|
KinesisIO.Read |
withUpToDateThreshold(Duration upToDateThreshold)
Specifies how late records consumed by this source can be to still be considered on time.
|
compose, compose, getAdditionalInputs, getDefaultOutputCoder, getDefaultOutputCoder, getDefaultOutputCoder, getKindString, getName, getResourceHints, populateDisplayData, setResourceHints, toString, validate
public KinesisIO.Read withStreamName(java.lang.String streamName)
public KinesisIO.Read withInitialPositionInStream(software.amazon.kinesis.common.InitialPositionInStream initialPosition)
public KinesisIO.Read withInitialTimestampInStream(Instant initialTimestamp)
Instant
. This Instant
must be in the past,
i.e. before Instant.now()
.public KinesisIO.Read withAWSClientsProvider(AWSClientsProvider awsClientsProvider)
AWSClientsProvider
. AWSClientsProvider
provides
KinesisClient
and CloudWatchClient
instances which are later used for
communication with Kinesis. You should use this method if withAWSClientsProvider(String, String, Region)
does not suit your needs.public KinesisIO.Read withAWSClientsProvider(java.lang.String awsAccessKey, java.lang.String awsSecretKey, Region region)
withAWSClientsProvider(AWSClientsProvider)
.public KinesisIO.Read withAWSClientsProvider(java.lang.String awsAccessKey, java.lang.String awsSecretKey, Region region, java.lang.String serviceEndpoint)
withAWSClientsProvider(AWSClientsProvider)
.
The serviceEndpoint
sets an alternative service host. This is useful to execute
the tests with a kinesis service emulator.
public KinesisIO.Read withMaxNumRecords(long maxNumRecords)
public KinesisIO.Read withMaxReadTime(Duration maxReadTime)
maxReadTime
.public KinesisIO.Read withUpToDateThreshold(Duration upToDateThreshold)
public KinesisIO.Read withRequestRecordsLimit(int limit)
public KinesisIO.Read withArrivalTimeWatermarkPolicy()
WatermarkPolicyFactory
as ArrivalTimeWatermarkPolicyFactory.public KinesisIO.Read withArrivalTimeWatermarkPolicy(Duration watermarkIdleDurationThreshold)
WatermarkPolicyFactory
as ArrivalTimeWatermarkPolicyFactory.
Denotes the duration for which the watermark can be idle.
public KinesisIO.Read withProcessingTimeWatermarkPolicy()
WatermarkPolicyFactory
as ProcessingTimeWatermarkPolicyFactory.public KinesisIO.Read withCustomWatermarkPolicy(WatermarkPolicyFactory watermarkPolicyFactory)
WatermarkPolicyFactory
as a custom watermarkPolicyFactory.watermarkPolicyFactory
- Custom Watermark policy factory.public KinesisIO.Read withFixedDelayRateLimitPolicy()
public KinesisIO.Read withFixedDelayRateLimitPolicy(Duration delay)
delay
- Denotes the fixed delay duration.public KinesisIO.Read withDynamicDelayRateLimitPolicy(java.util.function.Supplier<Duration> delay)
delay
- The function to invoke to get the next delay duration.public KinesisIO.Read withCustomRateLimitPolicy(RateLimitPolicyFactory rateLimitPolicyFactory)
RateLimitPolicyFactory
for a custom rate limiter.rateLimitPolicyFactory
- Custom rate limit policy factory.public KinesisIO.Read withMaxCapacityPerShard(java.lang.Integer maxCapacity)
public PCollection<KinesisRecord> expand(PBegin 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<PBegin,PCollection<KinesisRecord>>