Search in sources :

Example 1 with CsvRecordFormatter

use of org.komamitsu.fluency.aws.s3.recordformat.CsvRecordFormatter in project fluency by komamitsu.

the class FluencyBuilderForAwsS3 method createRecordFormatter.

private AwsS3RecordFormatter createRecordFormatter() {
    if (formatType == null) {
        throw new IllegalArgumentException("format type must be set");
    }
    AwsS3RecordFormatter recordFormatter;
    switch(getFormatType()) {
        case MESSAGE_PACK:
            recordFormatter = new MessagePackRecordFormatter();
            break;
        case JSONL:
            recordFormatter = new JsonlRecordFormatter();
            break;
        case CSV:
            CsvRecordFormatter.Config config = new CsvRecordFormatter.Config();
            config.setColumnNames(getFormatCsvColumnNames());
            recordFormatter = new CsvRecordFormatter(config);
            break;
        default:
            throw new IllegalArgumentException("Unexpected format type: " + getFormatType());
    }
    return recordFormatter;
}
Also used : AwsS3RecordFormatter(org.komamitsu.fluency.aws.s3.recordformat.AwsS3RecordFormatter) CsvRecordFormatter(org.komamitsu.fluency.aws.s3.recordformat.CsvRecordFormatter) JsonlRecordFormatter(org.komamitsu.fluency.aws.s3.recordformat.JsonlRecordFormatter) MessagePackRecordFormatter(org.komamitsu.fluency.aws.s3.recordformat.MessagePackRecordFormatter)

Aggregations

AwsS3RecordFormatter (org.komamitsu.fluency.aws.s3.recordformat.AwsS3RecordFormatter)1 CsvRecordFormatter (org.komamitsu.fluency.aws.s3.recordformat.CsvRecordFormatter)1 JsonlRecordFormatter (org.komamitsu.fluency.aws.s3.recordformat.JsonlRecordFormatter)1 MessagePackRecordFormatter (org.komamitsu.fluency.aws.s3.recordformat.MessagePackRecordFormatter)1