Search in sources :

Example 1 with S3DestinationDecider

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);
}
Also used : DefaultS3DestinationDecider(org.komamitsu.fluency.aws.s3.ingester.DefaultS3DestinationDecider) S3DestinationDecider(org.komamitsu.fluency.aws.s3.ingester.S3DestinationDecider) AwsS3Sender(org.komamitsu.fluency.aws.s3.ingester.sender.AwsS3Sender) DefaultS3DestinationDecider(org.komamitsu.fluency.aws.s3.ingester.DefaultS3DestinationDecider) AwsS3Ingester(org.komamitsu.fluency.aws.s3.ingester.AwsS3Ingester)

Aggregations

AwsS3Ingester (org.komamitsu.fluency.aws.s3.ingester.AwsS3Ingester)1 DefaultS3DestinationDecider (org.komamitsu.fluency.aws.s3.ingester.DefaultS3DestinationDecider)1 S3DestinationDecider (org.komamitsu.fluency.aws.s3.ingester.S3DestinationDecider)1 AwsS3Sender (org.komamitsu.fluency.aws.s3.ingester.sender.AwsS3Sender)1