use of org.komamitsu.fluency.aws.s3.ingester.S3DestinationDecider in project fluency by komamitsu.
the class FluencyBuilderForAwsS3 method createIngester.
private AwsS3Ingester createIngester(AwsS3RecordFormatter recordFormatter, AwsS3Sender.Config senderConfig) {
S3DestinationDecider s3DestinationDecider;
if (getCustomS3DestinationDecider() == null) {
DefaultS3DestinationDecider.Config config = new DefaultS3DestinationDecider.Config();
if (getS3KeyPrefix() != null) {
config.setKeyPrefix(getS3KeyPrefix());
}
if (getS3KeySuffix() != null) {
config.setKeySuffix(getS3KeySuffix());
} else {
config.setKeySuffix(defaultKeyPrefix(recordFormatter) + (isCompressionEnabled() ? ".gz" : ""));
}
if (getS3KeyTimeZoneId() != null) {
config.setZoneId(getS3KeyTimeZoneId());
}
s3DestinationDecider = new DefaultS3DestinationDecider(config);
} else {
s3DestinationDecider = getCustomS3DestinationDecider();
}
AwsS3Sender sender = createSender(senderConfig);
return new AwsS3Ingester(sender, s3DestinationDecider);
}
Aggregations