Search in sources :

Example 1 with Smile

use of org.apache.druid.guice.annotations.Smile in project druid by druid-io.

the class JacksonModule method smileMapper.

@Provides
@LazySingleton
@Smile
public ObjectMapper smileMapper() {
    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;
}
Also used : SmileFactory(com.fasterxml.jackson.dataformat.smile.SmileFactory) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) LazySingleton(org.apache.druid.guice.LazySingleton) Provides(com.google.inject.Provides) Smile(org.apache.druid.guice.annotations.Smile)

Aggregations

ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 SmileFactory (com.fasterxml.jackson.dataformat.smile.SmileFactory)1 Provides (com.google.inject.Provides)1 LazySingleton (org.apache.druid.guice.LazySingleton)1 Smile (org.apache.druid.guice.annotations.Smile)1