mirror of https://github.com/apache/druid.git
Merge pull request #927 from metamx/speedup-smile-bytes
Improve Smile serde performance by writing binary data as is
This commit is contained in:
commit
529e7e0272
|
@ -21,6 +21,7 @@ package io.druid.jackson;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import com.fasterxml.jackson.dataformat.smile.SmileFactory;
|
import com.fasterxml.jackson.dataformat.smile.SmileFactory;
|
||||||
|
import com.fasterxml.jackson.dataformat.smile.SmileGenerator;
|
||||||
import com.google.inject.Binder;
|
import com.google.inject.Binder;
|
||||||
import com.google.inject.Key;
|
import com.google.inject.Key;
|
||||||
import com.google.inject.Module;
|
import com.google.inject.Module;
|
||||||
|
@ -49,6 +50,7 @@ public class JacksonModule implements Module
|
||||||
public ObjectMapper smileMapper()
|
public ObjectMapper smileMapper()
|
||||||
{
|
{
|
||||||
final SmileFactory smileFactory = new SmileFactory();
|
final SmileFactory smileFactory = new SmileFactory();
|
||||||
|
smileFactory.configure(SmileGenerator.Feature.ENCODE_BINARY_AS_7BIT, false);
|
||||||
smileFactory.delegateToTextual(true);
|
smileFactory.delegateToTextual(true);
|
||||||
final ObjectMapper retVal = new DefaultObjectMapper(smileFactory);
|
final ObjectMapper retVal = new DefaultObjectMapper(smileFactory);
|
||||||
retVal.getFactory().setCodec(retVal);
|
retVal.getFactory().setCodec(retVal);
|
||||||
|
|
Loading…
Reference in New Issue