public abstract static class KinesisIO.Read extends PTransform<PBegin,PCollection<KinesisRecord>>
KinesisIO.read()
.name
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,
Regions region)
Specify credential details and region to be used to read from Kinesis.
|
KinesisIO.Read |
withAWSClientsProvider(java.lang.String awsAccessKey,
java.lang.String awsSecretKey,
Regions region,
java.lang.String serviceEndpoint)
Specify credential details and region to be used to read from Kinesis.
|
KinesisIO.Read |
withCustomWatermarkPolicy(WatermarkPolicyFactory watermarkPolicyFactory)
Specifies the
WatermarkPolicyFactory as a custom watermarkPolicyFactory. |
KinesisIO.Read |
withInitialPositionInStream(com.amazonaws.services.kinesis.clientlibrary.lib.worker.InitialPositionInStream initialPosition)
Specify reading from some initial position in stream.
|
KinesisIO.Read |
withInitialTimestampInStream(Instant initialTimestamp)
Specify reading beginning at given
Instant . |
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, populateDisplayData, toString, validate
public KinesisIO.Read withStreamName(java.lang.String streamName)
public KinesisIO.Read withInitialPositionInStream(com.amazonaws.services.kinesis.clientlibrary.lib.worker.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
AmazonKinesis
and AmazonCloudWatch
instances which are later used for
communication with Kinesis. You should use this method if withAWSClientsProvider(String, String, Regions)
does not suit your needs.public KinesisIO.Read withAWSClientsProvider(java.lang.String awsAccessKey, java.lang.String awsSecretKey, Regions region)
withAWSClientsProvider(AWSClientsProvider)
.public KinesisIO.Read withAWSClientsProvider(java.lang.String awsAccessKey, java.lang.String awsSecretKey, Regions 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 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>>