use of org.msgpack.core.annotations.VisibleForTesting in project fluency by komamitsu.
the class AwsS3Sender method buildClient.
@VisibleForTesting
protected S3Client buildClient(S3ClientBuilder s3ClientBuilder) {
if (config.getEndpoint() != null) {
try {
URI uri = new URI(config.getEndpoint());
s3ClientBuilder.endpointOverride(uri);
} catch (URISyntaxException e) {
throw new NonRetryableException(String.format("Invalid endpoint. %s", config.getEndpoint()), e);
}
}
if (config.getRegion() != null) {
s3ClientBuilder.region(Region.of(config.getRegion()));
}
if (config.getAwsAccessKeyId() != null && config.getAwsSecretAccessKey() != null) {
AwsBasicCredentials credentials = AwsBasicCredentials.create(config.getAwsAccessKeyId(), config.getAwsSecretAccessKey());
s3ClientBuilder.credentialsProvider(StaticCredentialsProvider.create(credentials));
}
return s3ClientBuilder.build();
}
use of org.msgpack.core.annotations.VisibleForTesting in project fluency by komamitsu.
the class FluencyBuilder method createFluency.
@VisibleForTesting
public Fluency createFluency(RecordFormatter recordFormatter, Ingester ingester, Buffer.Config bufferConfig, Flusher.Config flusherConfig) {
Buffer buffer = new Buffer(bufferConfig, recordFormatter);
Flusher flusher = new Flusher(flusherConfig, buffer, ingester);
return new Fluency(buffer, flusher);
}
Aggregations