From bc0c7dd65d846a1742c24b280be4b71792f981ed Mon Sep 17 00:00:00 2001 From: Gian Merlino Date: Tue, 11 Aug 2015 10:40:53 -0700 Subject: [PATCH] Avoid the Hadoop objectMapper in the local IndexTask. Fixes #1545. --- .../io/druid/indexing/common/task/IndexTask.java | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/indexing-service/src/main/java/io/druid/indexing/common/task/IndexTask.java b/indexing-service/src/main/java/io/druid/indexing/common/task/IndexTask.java index b5f846890d3..a2d96f36f99 100644 --- a/indexing-service/src/main/java/io/druid/indexing/common/task/IndexTask.java +++ b/indexing-service/src/main/java/io/druid/indexing/common/task/IndexTask.java @@ -39,7 +39,6 @@ import io.druid.data.input.FirehoseFactory; import io.druid.data.input.InputRow; import io.druid.data.input.Rows; import io.druid.granularity.QueryGranularity; -import io.druid.indexer.HadoopDruidIndexerConfig; import io.druid.indexing.common.TaskLock; import io.druid.indexing.common.TaskStatus; import io.druid.indexing.common.TaskToolbox; @@ -267,8 +266,7 @@ public class IndexTask extends AbstractFixedIntervalTask inputRow ); collector.add( - hashFunction.hashBytes(HadoopDruidIndexerConfig.jsonMapper.writeValueAsBytes(groupKey)) - .asBytes() + hashFunction.hashBytes(jsonMapper.writeValueAsBytes(groupKey)).asBytes() ); } } @@ -290,13 +288,7 @@ public class IndexTask extends AbstractFixedIntervalTask shardSpecs.add(new NoneShardSpec()); } else { for (int i = 0; i < numberOfShards; ++i) { - shardSpecs.add( - new HashBasedNumberedShardSpec( - i, - numberOfShards, - HadoopDruidIndexerConfig.jsonMapper - ) - ); + shardSpecs.add(new HashBasedNumberedShardSpec(i, numberOfShards, jsonMapper)); } }