public abstract static class SnsIO.Write extends PTransform<PCollection<PublishRequest>,PCollectionTuple>
SnsIO.write()
.annotations, displayData, name, resourceHints
Constructor and Description |
---|
Write() |
Modifier and Type | Method and Description |
---|---|
PCollectionTuple |
expand(PCollection<PublishRequest> input)
Override this method to specify how this
PTransform should be expanded on the given
InputT . |
SnsIO.Write |
withAWSClientsProvider(AwsClientsProvider awsClientsProvider)
Allows to specify custom
AwsClientsProvider . |
SnsIO.Write |
withAWSClientsProvider(java.lang.String awsAccessKey,
java.lang.String awsSecretKey,
Regions region)
Specify credential details and region to be used to write to SNS.
|
SnsIO.Write |
withAWSClientsProvider(java.lang.String awsAccessKey,
java.lang.String awsSecretKey,
Regions region,
java.lang.String serviceEndpoint)
Specify credential details and region to be used to write to SNS.
|
SnsIO.Write |
withCoder(Coder<PublishResult> coder)
Encode the
PublishResult with the given coder. |
SnsIO.Write |
withFullPublishResult()
Encode the full
PublishResult object, including sdkResponseMetadata and
sdkHttpMetadata with the HTTP response headers. |
SnsIO.Write |
withFullPublishResultWithoutHeaders()
Encode the full
PublishResult object, including sdkResponseMetadata and
sdkHttpMetadata but excluding the HTTP response headers. |
SnsIO.Write |
withResultOutputTag(TupleTag<PublishResult> results)
Tuple tag to store results.
|
SnsIO.Write |
withRetryConfiguration(SnsIO.RetryConfiguration retryConfiguration)
Provides configuration to retry a failed request to publish a message to SNS.
|
SnsIO.Write |
withTopicName(java.lang.String topicName)
Specify the SNS topic which will be used for writing, this name is mandatory.
|
addAnnotation, compose, compose, getAdditionalInputs, getAnnotations, getDefaultOutputCoder, getDefaultOutputCoder, getDefaultOutputCoder, getKindString, getName, getResourceHints, populateDisplayData, setDisplayData, setResourceHints, toString, validate, validate
public SnsIO.Write withTopicName(java.lang.String topicName)
topicName
- topicNamepublic SnsIO.Write withAWSClientsProvider(AwsClientsProvider awsClientsProvider)
AwsClientsProvider
. AwsClientsProvider
creates new
AmazonSNS
which is later used for writing to a SNS topic.public SnsIO.Write withAWSClientsProvider(java.lang.String awsAccessKey, java.lang.String awsSecretKey, Regions region)
withAWSClientsProvider(AwsClientsProvider)
.public SnsIO.Write 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 Kinesis service emulator.
public SnsIO.Write withRetryConfiguration(SnsIO.RetryConfiguration retryConfiguration)
Example use:
SnsIO.write()
.withRetryConfiguration(SnsIO.RetryConfiguration.create(5, Duration.standardMinutes(1))
...
retryConfiguration
- the rules which govern the retry behaviorSnsIO.Write
with retrying configuredpublic SnsIO.Write withResultOutputTag(TupleTag<PublishResult> results)
public SnsIO.Write withFullPublishResult()
PublishResult
object, including sdkResponseMetadata and
sdkHttpMetadata with the HTTP response headers.public SnsIO.Write withFullPublishResultWithoutHeaders()
PublishResult
object, including sdkResponseMetadata and
sdkHttpMetadata but excluding the HTTP response headers.public SnsIO.Write withCoder(Coder<PublishResult> coder)
PublishResult
with the given coder.public PCollectionTuple expand(PCollection<PublishRequest> 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<PublishRequest>,PCollectionTuple>