Skip to content

Commit

Permalink
Add smile provider (apache#2951)
Browse files Browse the repository at this point in the history
  • Loading branch information
drcrallen authored and fjy committed May 10, 2016
1 parent 2288c78 commit 6332bd7
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider;
import com.fasterxml.jackson.jaxrs.smile.JacksonSmileProvider;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
import com.google.common.primitives.Ints;
Expand Down Expand Up @@ -50,6 +51,7 @@
import io.druid.guice.annotations.JSR311Resource;
import io.druid.guice.annotations.Json;
import io.druid.guice.annotations.Self;
import io.druid.guice.annotations.Smile;
import io.druid.query.DruidMetrics;
import io.druid.server.DruidNode;
import io.druid.server.StatusResource;
Expand Down Expand Up @@ -145,6 +147,15 @@ public JacksonJsonProvider getJacksonJsonProvider(@Json ObjectMapper objectMappe
return provider;
}

@Provides
@Singleton
public JacksonSmileProvider getJacksonSmileProvider(@Smile ObjectMapper objectMapper)
{
final JacksonSmileProvider provider = new JacksonSmileProvider();
provider.setMapper(objectMapper);
return provider;
}

static Server makeJettyServer(DruidNode node, ServerConfig config)
{
final QueuedThreadPool threadPool = new QueuedThreadPool();
Expand Down

0 comments on commit 6332bd7

Please sign in to comment.