use of com.fasterxml.jackson.dataformat.smile.SmileFactory in project druid by druid-io.
the class BrokerServerViewTest method getSmileMapper.
public ObjectMapper getSmileMapper() {
final SmileFactory smileFactory = new SmileFactory();
smileFactory.configure(SmileGenerator.Feature.ENCODE_BINARY_AS_7BIT, false);
smileFactory.delegateToTextual(true);
final ObjectMapper retVal = new DefaultObjectMapper(smileFactory);
retVal.getFactory().setCodec(retVal);
return retVal;
}
use of com.fasterxml.jackson.dataformat.smile.SmileFactory in project druid by druid-io.
the class CachingClusteredClientTestUtils method createObjectMapper.
public static ObjectMapper createObjectMapper() {
final SmileFactory factory = new SmileFactory();
final ObjectMapper objectMapper = new DefaultObjectMapper(factory);
factory.setCodec(objectMapper);
return objectMapper;
}
use of com.fasterxml.jackson.dataformat.smile.SmileFactory in project druid by druid-io.
the class SqlFirehoseTest method setup.
@Before
public void setup() throws IOException {
TEST_DIR = File.createTempFile(SqlFirehose.class.getSimpleName(), "testDir");
org.apache.commons.io.FileUtils.forceDelete(TEST_DIR);
FileUtils.mkdirp(TEST_DIR);
final List<Map<String, Object>> inputTexts = ImmutableList.of(ImmutableMap.of("x", "foostring1", "timestamp", 2000), ImmutableMap.of("x", "foostring2", "timestamp", 2000));
List<FileInputStream> testFile = new ArrayList<>();
this.objectMapper = new ObjectMapper(new SmileFactory());
int i = 0;
for (Map m : inputTexts) {
File file = new File(TEST_DIR, "test_" + i++);
try (FileOutputStream fos = new FileOutputStream(file)) {
final JsonGenerator jg = objectMapper.getFactory().createGenerator(fos);
jg.writeStartArray();
jg.writeObject(m);
jg.writeEndArray();
jg.close();
testFile.add(new FileInputStream(file));
}
}
this.fileList = testFile;
parser = TransformSpec.NONE.decorate(new MapInputRowParser(new TimeAndDimsParseSpec(new TimestampSpec("timestamp", "auto", null), new DimensionsSpec(DimensionsSpec.getDefaultSchemas(ImmutableList.of("x"))))));
this.inputs = inputTexts;
}
use of com.fasterxml.jackson.dataformat.smile.SmileFactory in project spring-framework by spring-projects.
the class Jackson2ObjectMapperBuilderTests method factory.
// SPR-14435
@Test
void factory() {
ObjectMapper objectMapper = new Jackson2ObjectMapperBuilder().factory(new SmileFactory()).build();
assertThat(objectMapper).isNotNull();
assertThat(objectMapper.getFactory().getClass()).isEqualTo(SmileFactory.class);
}
Aggregations