Search in sources :

Example 1 with Smile

use of io.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(io.druid.guice.LazySingleton) Provides(com.google.inject.Provides) Smile(io.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 (io.druid.guice.LazySingleton)1 Smile (io.druid.guice.annotations.Smile)1