use of com.datastax.oss.dsbulk.codecs.api.ConvertingCodecFactory in project dsbulk by datastax.
the class JsonNodeToFloatCodecTest method setUp.
@BeforeEach
void setUp() {
ConversionContext context = new TextConversionContext().setNullStrings("NULL");
ConvertingCodecFactory codecFactory = new ConvertingCodecFactory(context);
codec = (JsonNodeToFloatCodec) codecFactory.<JsonNode, Float>createConvertingCodec(DataTypes.FLOAT, JSON_NODE_TYPE, true);
}
use of com.datastax.oss.dsbulk.codecs.api.ConvertingCodecFactory in project dsbulk by datastax.
the class JsonNodeToInstantCodecTest method setUpCodec1.
@BeforeEach
void setUpCodec1() {
ConversionContext context1 = new TextConversionContext().setNullStrings("NULL");
ConversionContext context2 = new TextConversionContext().setNullStrings("NULL").setTimestampFormat("yyyyMMddHHmmss");
ConversionContext context3 = new TextConversionContext().setNullStrings("NULL").setTimeUnit(MINUTES).setEpoch(ZonedDateTime.parse("2000-01-01T00:00:00Z"));
ConversionContext context4 = new TextConversionContext().setNullStrings("NULL").setTimeUnit(MINUTES).setEpoch(ZonedDateTime.parse("2000-01-01T00:00:00Z")).setTimestampFormat("UNITS_SINCE_EPOCH");
codec1 = (JsonNodeToInstantCodec) new ConvertingCodecFactory(context1).<JsonNode, Instant>createConvertingCodec(DataTypes.TIMESTAMP, JSON_NODE_TYPE, true);
codec2 = (JsonNodeToInstantCodec) new ConvertingCodecFactory(context2).<JsonNode, Instant>createConvertingCodec(DataTypes.TIMESTAMP, JSON_NODE_TYPE, true);
codec3 = (JsonNodeToInstantCodec) new ConvertingCodecFactory(context3).<JsonNode, Instant>createConvertingCodec(DataTypes.TIMESTAMP, JSON_NODE_TYPE, true);
codec4 = (JsonNodeToInstantCodec) new ConvertingCodecFactory(context4).<JsonNode, Instant>createConvertingCodec(DataTypes.TIMESTAMP, JSON_NODE_TYPE, true);
}
use of com.datastax.oss.dsbulk.codecs.api.ConvertingCodecFactory in project dsbulk by datastax.
the class JsonNodeToIntegerCodecTest method setUp.
@BeforeEach
void setUp() {
ConversionContext context = new TextConversionContext().setNullStrings("NULL").setFormatNumbers(true);
ConvertingCodecFactory codecFactory = new ConvertingCodecFactory(context);
codec = (JsonNodeToIntegerCodec) codecFactory.<JsonNode, Integer>createConvertingCodec(DataTypes.INT, JSON_NODE_TYPE, true);
}
use of com.datastax.oss.dsbulk.codecs.api.ConvertingCodecFactory in project dsbulk by datastax.
the class JsonNodeToListCodecTest method setUp.
@BeforeEach
void setUp() {
ConversionContext context = new TextConversionContext().setNullStrings("NULL");
ConvertingCodecFactory codecFactory = new ConvertingCodecFactory(context);
codec1 = (JsonNodeToListCodec<Double>) codecFactory.<JsonNode, List<Double>>createConvertingCodec(DataTypes.listOf(DataTypes.DOUBLE), JSON_NODE_TYPE, true);
codec2 = (JsonNodeToListCodec<String>) codecFactory.<JsonNode, List<String>>createConvertingCodec(DataTypes.listOf(DataTypes.TEXT), JSON_NODE_TYPE, true);
}
use of com.datastax.oss.dsbulk.codecs.api.ConvertingCodecFactory in project dsbulk by datastax.
the class JsonNodeToBigDecimalCodecTest method setUp.
@BeforeEach
void setUp() {
ConversionContext context = new TextConversionContext().setNullStrings("NULL").setFormatNumbers(true);
ConvertingCodecFactory codecFactory = new ConvertingCodecFactory(context);
codec = (JsonNodeToBigDecimalCodec) codecFactory.<JsonNode, BigDecimal>createConvertingCodec(DataTypes.DECIMAL, JSON_NODE_TYPE, true);
}
Aggregations