From 331441f8c25e53377acfa504e9e0e1ccb3e4b270 Mon Sep 17 00:00:00 2001 From: Stephen Salinas Date: Thu, 6 Dec 2018 09:53:27 -0500 Subject: [PATCH 1/2] Add guava/jdk8 modules to default SingularityClient object mapper --- SingularityClient/pom.xml | 5 +++++ .../hubspot/singularity/client/SingularityClientModule.java | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/SingularityClient/pom.xml b/SingularityClient/pom.xml index 65b38b7aa2..44f2f80810 100644 --- a/SingularityClient/pom.xml +++ b/SingularityClient/pom.xml @@ -22,6 +22,11 @@ jackson-databind + + com.fasterxml.jackson.datatype + jackson-datatype-jdk8 + + com.github.rholder guava-retrying diff --git a/SingularityClient/src/main/java/com/hubspot/singularity/client/SingularityClientModule.java b/SingularityClient/src/main/java/com/hubspot/singularity/client/SingularityClientModule.java index ae063f3296..82e84b6655 100644 --- a/SingularityClient/src/main/java/com/hubspot/singularity/client/SingularityClientModule.java +++ b/SingularityClient/src/main/java/com/hubspot/singularity/client/SingularityClientModule.java @@ -5,6 +5,8 @@ import org.apache.curator.framework.CuratorFramework; import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.datatype.guava.GuavaModule; +import com.fasterxml.jackson.datatype.jdk8.Jdk8Module; import com.google.common.base.Optional; import com.google.inject.AbstractModule; import com.google.inject.Binder; @@ -62,6 +64,8 @@ public SingularityClientModule(List hosts, HttpConfig httpConfig) { @Override protected void configure() { ObjectMapper objectMapper = JavaUtils.newObjectMapper(); + objectMapper.registerModule(new GuavaModule()); + objectMapper.registerModule(new Jdk8Module()); HttpClient httpClient = new NingHttpClient(httpConfig.or(HttpConfig.newBuilder().setObjectMapper(objectMapper).build())); bind(HttpClient.class).annotatedWith(Names.named(HTTP_CLIENT_NAME)).toInstance(httpClient); From 7a7b1e1138c900f57086bcf3ad26c9cd6ec386e8 Mon Sep 17 00:00:00 2001 From: Stephen Salinas Date: Thu, 6 Dec 2018 09:55:51 -0500 Subject: [PATCH 2/2] need guava dep --- SingularityClient/pom.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/SingularityClient/pom.xml b/SingularityClient/pom.xml index 44f2f80810..7e439073d0 100644 --- a/SingularityClient/pom.xml +++ b/SingularityClient/pom.xml @@ -22,6 +22,11 @@ jackson-databind + + com.fasterxml.jackson.datatype + jackson-datatype-guava + + com.fasterxml.jackson.datatype jackson-datatype-jdk8