mirror of https://github.com/apache/druid.git
Add smile provider (#2951)
This commit is contained in:
parent
2288c78395
commit
6332bd70f4
|
@ -21,6 +21,7 @@ package io.druid.server.initialization.jetty;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider;
|
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.Iterables;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.google.common.primitives.Ints;
|
import com.google.common.primitives.Ints;
|
||||||
|
@ -50,6 +51,7 @@ import io.druid.guice.LazySingleton;
|
||||||
import io.druid.guice.annotations.JSR311Resource;
|
import io.druid.guice.annotations.JSR311Resource;
|
||||||
import io.druid.guice.annotations.Json;
|
import io.druid.guice.annotations.Json;
|
||||||
import io.druid.guice.annotations.Self;
|
import io.druid.guice.annotations.Self;
|
||||||
|
import io.druid.guice.annotations.Smile;
|
||||||
import io.druid.query.DruidMetrics;
|
import io.druid.query.DruidMetrics;
|
||||||
import io.druid.server.DruidNode;
|
import io.druid.server.DruidNode;
|
||||||
import io.druid.server.StatusResource;
|
import io.druid.server.StatusResource;
|
||||||
|
@ -145,6 +147,15 @@ public class JettyServerModule extends JerseyServletModule
|
||||||
return provider;
|
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)
|
static Server makeJettyServer(DruidNode node, ServerConfig config)
|
||||||
{
|
{
|
||||||
final QueuedThreadPool threadPool = new QueuedThreadPool();
|
final QueuedThreadPool threadPool = new QueuedThreadPool();
|
||||||
|
|
Loading…
Reference in New Issue