You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by fj...@apache.org on 2019/05/25 06:15:46 UTC
[incubator-druid] branch master updated: remove unused ObjectMapper
from DatasourcePathSpec (#7754)
This is an automated email from the ASF dual-hosted git repository.
fjy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-druid.git
The following commit(s) were added to refs/heads/master by this push:
new 2b7bb06 remove unused ObjectMapper from DatasourcePathSpec (#7754)
2b7bb06 is described below
commit 2b7bb064b502c3ca9fe6896f37a899aaa520e1e6
Author: Himanshu <g....@gmail.com>
AuthorDate: Fri May 24 23:15:40 2019 -0700
remove unused ObjectMapper from DatasourcePathSpec (#7754)
---
.../org/apache/druid/indexer/path/DatasourcePathSpec.java | 5 -----
...pIngestionSpecUpdateDatasourcePathSpecSegmentsTest.java | 6 ------
.../apache/druid/indexer/path/DatasourcePathSpecTest.java | 14 --------------
3 files changed, 25 deletions(-)
diff --git a/indexing-hadoop/src/main/java/org/apache/druid/indexer/path/DatasourcePathSpec.java b/indexing-hadoop/src/main/java/org/apache/druid/indexer/path/DatasourcePathSpec.java
index 424d5e7..c56dfae 100644
--- a/indexing-hadoop/src/main/java/org/apache/druid/indexer/path/DatasourcePathSpec.java
+++ b/indexing-hadoop/src/main/java/org/apache/druid/indexer/path/DatasourcePathSpec.java
@@ -19,10 +19,8 @@
package org.apache.druid.indexer.path;
-import com.fasterxml.jackson.annotation.JacksonInject;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.base.Function;
import com.google.common.base.Preconditions;
import com.google.common.collect.Iterables;
@@ -51,7 +49,6 @@ public class DatasourcePathSpec implements PathSpec
public static final String TYPE = "dataSource";
- private final ObjectMapper mapper;
private final DatasourceIngestionSpec ingestionSpec;
private final long maxSplitSize;
private final List<WindowedDataSegment> segments;
@@ -67,14 +64,12 @@ public class DatasourcePathSpec implements PathSpec
@JsonCreator
public DatasourcePathSpec(
- @JacksonInject ObjectMapper mapper,
@JsonProperty("segments") List<WindowedDataSegment> segments,
@JsonProperty("ingestionSpec") DatasourceIngestionSpec spec,
@JsonProperty("maxSplitSize") Long maxSplitSize,
@JsonProperty(USE_NEW_AGGS_KEY) boolean useNewAggs
)
{
- this.mapper = Preconditions.checkNotNull(mapper, "null mapper");
this.segments = segments;
this.ingestionSpec = Preconditions.checkNotNull(spec, "null ingestionSpec");
diff --git a/indexing-hadoop/src/test/java/org/apache/druid/indexer/HadoopIngestionSpecUpdateDatasourcePathSpecSegmentsTest.java b/indexing-hadoop/src/test/java/org/apache/druid/indexer/HadoopIngestionSpecUpdateDatasourcePathSpecSegmentsTest.java
index 09d5b66..c915a4d 100644
--- a/indexing-hadoop/src/test/java/org/apache/druid/indexer/HadoopIngestionSpecUpdateDatasourcePathSpecSegmentsTest.java
+++ b/indexing-hadoop/src/test/java/org/apache/druid/indexer/HadoopIngestionSpecUpdateDatasourcePathSpecSegmentsTest.java
@@ -111,7 +111,6 @@ public class HadoopIngestionSpecUpdateDatasourcePathSpecSegmentsTest
public void testUpdateSegmentListIfDatasourcePathSpecIsUsedWithJustDatasourcePathSpec() throws Exception
{
PathSpec pathSpec = new DatasourcePathSpec(
- jsonMapper,
null,
new DatasourceIngestionSpec(testDatasource, testDatasourceInterval, null, null, null, null, null, false, null),
null,
@@ -131,7 +130,6 @@ public class HadoopIngestionSpecUpdateDatasourcePathSpecSegmentsTest
public void testUpdateSegmentListIfDatasourcePathSpecWithMatchingUserSegments() throws Exception
{
PathSpec pathSpec = new DatasourcePathSpec(
- jsonMapper,
null,
new DatasourceIngestionSpec(
testDatasource,
@@ -161,7 +159,6 @@ public class HadoopIngestionSpecUpdateDatasourcePathSpecSegmentsTest
public void testUpdateSegmentListThrowsExceptionWithUserSegmentsMismatch() throws Exception
{
PathSpec pathSpec = new DatasourcePathSpec(
- jsonMapper,
null,
new DatasourceIngestionSpec(
testDatasource,
@@ -188,7 +185,6 @@ public class HadoopIngestionSpecUpdateDatasourcePathSpecSegmentsTest
throws Exception
{
PathSpec pathSpec = new DatasourcePathSpec(
- jsonMapper,
null,
new DatasourceIngestionSpec(
testDatasource,
@@ -221,7 +217,6 @@ public class HadoopIngestionSpecUpdateDatasourcePathSpecSegmentsTest
ImmutableList.of(
new StaticPathSpec("/xyz", null),
new DatasourcePathSpec(
- jsonMapper,
null,
new DatasourceIngestionSpec(
testDatasource,
@@ -238,7 +233,6 @@ public class HadoopIngestionSpecUpdateDatasourcePathSpecSegmentsTest
false
),
new DatasourcePathSpec(
- jsonMapper,
null,
new DatasourceIngestionSpec(
testDatasource2,
diff --git a/indexing-hadoop/src/test/java/org/apache/druid/indexer/path/DatasourcePathSpecTest.java b/indexing-hadoop/src/test/java/org/apache/druid/indexer/path/DatasourcePathSpecTest.java
index a229d8b..a6535a4 100644
--- a/indexing-hadoop/src/test/java/org/apache/druid/indexer/path/DatasourcePathSpecTest.java
+++ b/indexing-hadoop/src/test/java/org/apache/druid/indexer/path/DatasourcePathSpecTest.java
@@ -41,13 +41,11 @@ import org.apache.druid.indexer.hadoop.DatasourceIngestionSpec;
import org.apache.druid.indexer.hadoop.DatasourceInputFormat;
import org.apache.druid.indexer.hadoop.WindowedDataSegment;
import org.apache.druid.initialization.Initialization;
-import org.apache.druid.jackson.DefaultObjectMapper;
import org.apache.druid.java.util.common.ISE;
import org.apache.druid.java.util.common.Intervals;
import org.apache.druid.java.util.common.granularity.Granularities;
import org.apache.druid.query.aggregation.AggregatorFactory;
import org.apache.druid.query.aggregation.LongSumAggregatorFactory;
-import org.apache.druid.segment.TestHelper;
import org.apache.druid.segment.indexing.DataSchema;
import org.apache.druid.segment.indexing.granularity.UniformGranularitySpec;
import org.apache.druid.server.DruidNode;
@@ -182,7 +180,6 @@ public class DatasourcePathSpecTest
ObjectMapper jsonMapper = injector.getInstance(ObjectMapper.class);
DatasourcePathSpec expected = new DatasourcePathSpec(
- jsonMapper,
null,
ingestionSpec1,
Long.valueOf(10),
@@ -192,7 +189,6 @@ public class DatasourcePathSpecTest
Assert.assertEquals(expected, actual);
expected = new DatasourcePathSpec(
- jsonMapper,
null,
ingestionSpec1,
null,
@@ -202,7 +198,6 @@ public class DatasourcePathSpecTest
Assert.assertEquals(expected, actual);
expected = new DatasourcePathSpec(
- jsonMapper,
segments1,
ingestionSpec1,
null,
@@ -212,7 +207,6 @@ public class DatasourcePathSpecTest
Assert.assertEquals(expected, actual);
expected = new DatasourcePathSpec(
- jsonMapper,
segments1,
ingestionSpec1,
null,
@@ -227,10 +221,7 @@ public class DatasourcePathSpecTest
{
HadoopDruidIndexerConfig hadoopIndexerConfig = makeHadoopDruidIndexerConfig();
- ObjectMapper mapper = TestHelper.makeJsonMapper();
-
DatasourcePathSpec pathSpec1 = new DatasourcePathSpec(
- mapper,
segments1,
ingestionSpec1,
null,
@@ -238,7 +229,6 @@ public class DatasourcePathSpecTest
);
DatasourcePathSpec pathSpec2 = new DatasourcePathSpec(
- mapper,
segments2,
ingestionSpec2,
null,
@@ -281,10 +271,7 @@ public class DatasourcePathSpecTest
{
HadoopDruidIndexerConfig hadoopIndexerConfig = makeHadoopDruidIndexerConfig();
- ObjectMapper mapper = new DefaultObjectMapper();
-
DatasourcePathSpec pathSpec = new DatasourcePathSpec(
- mapper,
null,
ingestionSpec1,
null,
@@ -306,7 +293,6 @@ public class DatasourcePathSpecTest
//now with ignoreWhenNoSegments flag set
pathSpec = new DatasourcePathSpec(
- mapper,
null,
ingestionSpec1.withIgnoreWhenNoSegments(true),
null,
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org