public abstract static class SnsIO.Write<T> extends PTransform<PCollection<T>,PCollection<PublishResponse>>
SnsIO.write()
.name, resourceHints
Constructor and Description |
---|
Write() |
Modifier and Type | Method and Description |
---|---|
PCollection<PublishResponse> |
expand(PCollection<T> input)
Override this method to specify how this
PTransform should be expanded on the given
InputT . |
SnsIO.Write<T> |
withCoder(Coder<PublishResponse> coder)
Encode the
PublishResult with the given coder. |
SnsIO.Write<T> |
withFullPublishResponse()
Encode the full
PublishResult object, including sdkResponseMetadata and
sdkHttpMetadata with the HTTP response headers. |
SnsIO.Write<T> |
withFullPublishResponseWithoutHeaders()
Encode the full
PublishResult object, including sdkResponseMetadata and
sdkHttpMetadata but excluding the HTTP response headers. |
SnsIO.Write<T> |
withPublishRequestFn(SerializableFunction<T,PublishRequest> publishRequestFn)
Specify a function for converting a message into PublishRequest object, this function is
mandatory.
|
SnsIO.Write<T> |
withRetryConfiguration(SnsIO.RetryConfiguration retryConfiguration)
Provides configuration to retry a failed request to publish a message to SNS.
|
SnsIO.Write<T> |
withSnsClientProvider(AwsCredentialsProvider credentialsProvider,
java.lang.String region)
Specify
AwsCredentialsProvider and region to be used to write to SNS. |
SnsIO.Write<T> |
withSnsClientProvider(AwsCredentialsProvider credentialsProvider,
java.lang.String region,
java.net.URI serviceEndpoint)
Specify
AwsCredentialsProvider and region to be used to write to SNS. |
SnsIO.Write<T> |
withSnsClientProvider(SnsClientProvider awsClientsProvider)
Allows to specify custom
SnsClientProvider . |
SnsIO.Write<T> |
withTopicArn(java.lang.String topicArn)
Specify the SNS topic which will be used for writing, this name is mandatory.
|
compose, compose, getAdditionalInputs, getDefaultOutputCoder, getDefaultOutputCoder, getDefaultOutputCoder, getKindString, getName, getResourceHints, populateDisplayData, setResourceHints, toString, validate
public SnsIO.Write<T> withTopicArn(java.lang.String topicArn)
topicArn
- topicArnpublic SnsIO.Write<T> withPublishRequestFn(SerializableFunction<T,PublishRequest> publishRequestFn)
publishRequestFn
- publishRequestFnpublic SnsIO.Write<T> withSnsClientProvider(SnsClientProvider awsClientsProvider)
SnsClientProvider
. SnsClientProvider
creates new
SnsClient
which is later used for writing to a SNS topic.public SnsIO.Write<T> withSnsClientProvider(AwsCredentialsProvider credentialsProvider, java.lang.String region)
AwsCredentialsProvider
and region to be used to write to SNS. If you need
more sophisticated credential protocol, then you should look at withSnsClientProvider(SnsClientProvider)
.public SnsIO.Write<T> withSnsClientProvider(AwsCredentialsProvider credentialsProvider, java.lang.String region, java.net.URI serviceEndpoint)
AwsCredentialsProvider
and region to be used to write to SNS. If you need
more sophisticated credential protocol, then you should look at withSnsClientProvider(SnsClientProvider)
.
The serviceEndpoint
sets an alternative service host. This is useful to execute
the tests with Kinesis service emulator.
public SnsIO.Write<T> 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<T> withFullPublishResponse()
PublishResult
object, including sdkResponseMetadata and
sdkHttpMetadata with the HTTP response headers.public SnsIO.Write<T> withFullPublishResponseWithoutHeaders()
PublishResult
object, including sdkResponseMetadata and
sdkHttpMetadata but excluding the HTTP response headers.public SnsIO.Write<T> withCoder(Coder<PublishResponse> coder)
PublishResult
with the given coder.public PCollection<PublishResponse> 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>,PCollection<PublishResponse>>