mirror of https://github.com/apache/druid.git
update jackson to 2.6.1
This commit is contained in:
parent
ac4a856a17
commit
51f6a9a2c9
|
@ -30,7 +30,6 @@ import io.druid.timeline.partition.NoneShardSpec;
|
||||||
import io.druid.timeline.partition.ShardSpec;
|
import io.druid.timeline.partition.ShardSpec;
|
||||||
import org.joda.time.Interval;
|
import org.joda.time.Interval;
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
import org.junit.BeforeClass;
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
@ -40,7 +39,7 @@ import java.util.Map;
|
||||||
|
|
||||||
public class HadoopConverterTaskSerDeTest
|
public class HadoopConverterTaskSerDeTest
|
||||||
{
|
{
|
||||||
private static ObjectMapper objectMapper;
|
private static ObjectMapper objectMapper = new DefaultObjectMapper();
|
||||||
private static final String TASK_ID = "task id";
|
private static final String TASK_ID = "task id";
|
||||||
private static final String DATA_SOURCE = "datasource";
|
private static final String DATA_SOURCE = "datasource";
|
||||||
private static final Interval INTERVAL = Interval.parse("2010/2011");
|
private static final Interval INTERVAL = Interval.parse("2010/2011");
|
||||||
|
@ -69,17 +68,6 @@ public class HadoopConverterTaskSerDeTest
|
||||||
private static final String OUTPUT_PATH = "/dev/null";
|
private static final String OUTPUT_PATH = "/dev/null";
|
||||||
private static final String CLASSPATH_PREFIX = "something:where:I:need:stuff";
|
private static final String CLASSPATH_PREFIX = "something:where:I:need:stuff";
|
||||||
|
|
||||||
@BeforeClass
|
|
||||||
public static void setUpStatic()
|
|
||||||
{
|
|
||||||
objectMapper = new DefaultObjectMapper();
|
|
||||||
objectMapper.registerSubtypes(
|
|
||||||
HadoopConverterTask.class,
|
|
||||||
HadoopConverterTask.ConverterSubTask.class,
|
|
||||||
ShardSpec.class
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testSimpleConverterTaskSerDe() throws IOException
|
public void testSimpleConverterTaskSerDe() throws IOException
|
||||||
{
|
{
|
||||||
|
|
2
pom.xml
2
pom.xml
|
@ -70,7 +70,7 @@
|
||||||
<jetty.version>9.2.13.v20150730</jetty.version>
|
<jetty.version>9.2.13.v20150730</jetty.version>
|
||||||
<jersey.version>1.19</jersey.version>
|
<jersey.version>1.19</jersey.version>
|
||||||
<druid.api.version>0.3.11</druid.api.version>
|
<druid.api.version>0.3.11</druid.api.version>
|
||||||
<jackson.version>2.4.4</jackson.version>
|
<jackson.version>2.6.1</jackson.version>
|
||||||
<log4j.version>2.2</log4j.version>
|
<log4j.version>2.2</log4j.version>
|
||||||
<slf4j.version>1.7.10</slf4j.version>
|
<slf4j.version>1.7.10</slf4j.version>
|
||||||
<hadoop.compile.version>2.3.0</hadoop.compile.version>
|
<hadoop.compile.version>2.3.0</hadoop.compile.version>
|
||||||
|
|
|
@ -21,6 +21,7 @@ import com.fasterxml.jackson.core.JsonParser;
|
||||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
import com.fasterxml.jackson.core.JsonToken;
|
import com.fasterxml.jackson.core.JsonToken;
|
||||||
import com.fasterxml.jackson.databind.DeserializationContext;
|
import com.fasterxml.jackson.databind.DeserializationContext;
|
||||||
|
import com.fasterxml.jackson.databind.JsonDeserializer;
|
||||||
import com.fasterxml.jackson.databind.KeyDeserializer;
|
import com.fasterxml.jackson.databind.KeyDeserializer;
|
||||||
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
|
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
|
||||||
import com.fasterxml.jackson.databind.module.SimpleModule;
|
import com.fasterxml.jackson.databind.module.SimpleModule;
|
||||||
|
@ -39,6 +40,7 @@ import java.io.IOException;
|
||||||
*/
|
*/
|
||||||
class JodaStuff
|
class JodaStuff
|
||||||
{
|
{
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
static SimpleModule register(SimpleModule module)
|
static SimpleModule register(SimpleModule module)
|
||||||
{
|
{
|
||||||
module.addKeyDeserializer(DateTime.class, new DateTimeKeyDeserializer());
|
module.addKeyDeserializer(DateTime.class, new DateTimeKeyDeserializer());
|
||||||
|
@ -46,7 +48,8 @@ class JodaStuff
|
||||||
module.addSerializer(DateTime.class, ToStringSerializer.instance);
|
module.addSerializer(DateTime.class, ToStringSerializer.instance);
|
||||||
module.addDeserializer(Interval.class, new JodaStuff.IntervalDeserializer());
|
module.addDeserializer(Interval.class, new JodaStuff.IntervalDeserializer());
|
||||||
module.addSerializer(Interval.class, ToStringSerializer.instance);
|
module.addSerializer(Interval.class, ToStringSerializer.instance);
|
||||||
module.addDeserializer(Period.class, new PeriodDeserializer());
|
JsonDeserializer<?> periodDeserializer = new PeriodDeserializer(true);
|
||||||
|
module.addDeserializer(Period.class, (JsonDeserializer<Period>) periodDeserializer);
|
||||||
module.addSerializer(Period.class, ToStringSerializer.instance);
|
module.addSerializer(Period.class, ToStringSerializer.instance);
|
||||||
module.addDeserializer(Duration.class, new DurationDeserializer());
|
module.addDeserializer(Duration.class, new DurationDeserializer());
|
||||||
module.addSerializer(Duration.class, ToStringSerializer.instance);
|
module.addSerializer(Duration.class, ToStringSerializer.instance);
|
||||||
|
|
|
@ -33,7 +33,6 @@ import io.druid.jackson.DefaultObjectMapper;
|
||||||
import io.druid.query.extraction.LookupExtractionFn;
|
import io.druid.query.extraction.LookupExtractionFn;
|
||||||
import io.druid.query.extraction.MapLookupExtractor;
|
import io.druid.query.extraction.MapLookupExtractor;
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
import org.junit.BeforeClass;
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.junit.runners.Parameterized;
|
import org.junit.runners.Parameterized;
|
||||||
|
@ -81,12 +80,6 @@ public class LookupExtractionFnTest
|
||||||
this.injective = injective;
|
this.injective = injective;
|
||||||
}
|
}
|
||||||
|
|
||||||
@BeforeClass
|
|
||||||
public static void setUpStatic()
|
|
||||||
{
|
|
||||||
OBJECT_MAPPER.registerSubtypes(LookupExtractionFn.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testSimpleSerDe() throws IOException
|
public void testSimpleSerDe() throws IOException
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue