use of org.apache.beam.sdk.io.aws2.common.ClientConfiguration in project beam by apache.
the class KinesisSource method createClient.
private SimplifiedKinesisClient createClient(PipelineOptions options) {
AwsOptions awsOptions = options.as(AwsOptions.class);
KinesisClient kinesis;
CloudWatchClient cloudWatch;
if (spec.getAWSClientsProvider() != null) {
kinesis = spec.getAWSClientsProvider().getKinesisClient();
cloudWatch = spec.getAWSClientsProvider().getCloudWatchClient();
} else {
ClientConfiguration config = spec.getClientConfiguration();
kinesis = ClientBuilderFactory.buildClient(awsOptions, KinesisClient.builder(), config);
cloudWatch = ClientBuilderFactory.buildClient(awsOptions, CloudWatchClient.builder(), config);
}
return new SimplifiedKinesisClient(kinesis, cloudWatch, spec.getRequestRecordsLimit(), Instant::now);
}
use of org.apache.beam.sdk.io.aws2.common.ClientConfiguration in project beam by apache.
the class SqsUnboundedReader method initClient.
private void initClient() {
if (sqsClient == null) {
if (source.getRead().sqsClientProvider() != null) {
// build client using legacy SqsClientProvider
sqsClient = source.getRead().sqsClientProvider().getSqsClient();
} else {
ClientConfiguration config = source.getRead().clientConfiguration();
sqsClient = ClientBuilderFactory.buildClient(awsOptions, SqsClient.builder(), config);
}
}
}
Aggregations