-
Notifications
You must be signed in to change notification settings - Fork 3.8k
build v9 directly #2138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build v9 directly #2138
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -51,6 +51,7 @@ | |
| import io.druid.initialization.Initialization; | ||
| import io.druid.segment.IndexIO; | ||
| import io.druid.segment.IndexMerger; | ||
| import io.druid.segment.IndexMergerV9; | ||
| import io.druid.segment.IndexSpec; | ||
| import io.druid.segment.indexing.granularity.GranularitySpec; | ||
| import io.druid.server.DruidNode; | ||
|
|
@@ -89,6 +90,7 @@ public class HadoopDruidIndexerConfig | |
| public static final ObjectMapper JSON_MAPPER; | ||
| public static final IndexIO INDEX_IO; | ||
| public static final IndexMerger INDEX_MERGER; | ||
| public static final IndexMergerV9 INDEX_MERGER_V9; | ||
|
|
||
| private static final String DEFAULT_WORKING_PATH = "/tmp/druid-indexing"; | ||
|
|
||
|
|
@@ -112,6 +114,7 @@ public void configure(Binder binder) | |
| JSON_MAPPER = injector.getInstance(ObjectMapper.class); | ||
| INDEX_IO = injector.getInstance(IndexIO.class); | ||
| INDEX_MERGER = injector.getInstance(IndexMerger.class); | ||
| INDEX_MERGER_V9 = injector.getInstance(IndexMergerV9.class); | ||
| } | ||
|
|
||
| public static enum IndexJobCounters | ||
|
|
@@ -351,6 +354,11 @@ public HadoopyShardSpec getShardSpec(Bucket bucket) | |
| return schema.getTuningConfig().getShardSpecs().get(bucket.time).get(bucket.partitionNum); | ||
| } | ||
|
|
||
| public boolean isBuildV9Directly() | ||
| { | ||
| return schema.getTuningConfig().getBuildV9Directly(); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this will throw an NPE if getBuildV9Directly returns null |
||
| } | ||
|
|
||
| /** | ||
| * Job instance should have Configuration set (by calling {@link #addJobProperties(Job)} | ||
| * or via injected system properties) before this method is called. The {@link PathSpec} may | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -42,6 +42,7 @@ public class HadoopTuningConfig implements TuningConfig | |
| private static final IndexSpec DEFAULT_INDEX_SPEC = new IndexSpec(); | ||
| private static final int DEFAULT_ROW_FLUSH_BOUNDARY = 80000; | ||
| private static final boolean DEFAULT_USE_COMBINER = false; | ||
| private static final Boolean DEFAULT_BUILD_V9_DIRECTLY = Boolean.FALSE; | ||
|
|
||
| public static HadoopTuningConfig makeDefaultTuningConfig() | ||
| { | ||
|
|
@@ -59,7 +60,8 @@ public static HadoopTuningConfig makeDefaultTuningConfig() | |
| null, | ||
| false, | ||
| false, | ||
| null | ||
| null, | ||
| DEFAULT_BUILD_V9_DIRECTLY | ||
| ); | ||
| } | ||
|
|
||
|
|
@@ -76,6 +78,7 @@ public static HadoopTuningConfig makeDefaultTuningConfig() | |
| private final Map<String, String> jobProperties; | ||
| private final boolean combineText; | ||
| private final boolean useCombiner; | ||
| private final Boolean buildV9Directly; | ||
|
|
||
| @JsonCreator | ||
| public HadoopTuningConfig( | ||
|
|
@@ -93,7 +96,8 @@ public HadoopTuningConfig( | |
| final @JsonProperty("combineText") boolean combineText, | ||
| final @JsonProperty("useCombiner") Boolean useCombiner, | ||
| // See https://github.com/druid-io/druid/pull/1922 | ||
| final @JsonProperty("rowFlushBoundary") Integer maxRowsInMemoryCOMPAT | ||
| final @JsonProperty("rowFlushBoundary") Integer maxRowsInMemoryCOMPAT, | ||
| final @JsonProperty("buildV9Directly") Boolean buildV9Directly | ||
| ) | ||
| { | ||
| this.workingPath = workingPath; | ||
|
|
@@ -111,6 +115,7 @@ public HadoopTuningConfig( | |
| : ImmutableMap.copyOf(jobProperties)); | ||
| this.combineText = combineText; | ||
| this.useCombiner = useCombiner == null ? DEFAULT_USE_COMBINER : useCombiner.booleanValue(); | ||
| this.buildV9Directly = buildV9Directly == null ? DEFAULT_BUILD_V9_DIRECTLY : buildV9Directly; | ||
| } | ||
|
|
||
| @JsonProperty | ||
|
|
@@ -191,6 +196,11 @@ public boolean getUseCombiner() | |
| return useCombiner; | ||
| } | ||
|
|
||
| @JsonProperty | ||
| public Boolean getBuildV9Directly() { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. since buildV9Directly is never null, this should probably be
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and also renamed to |
||
| return buildV9Directly; | ||
| } | ||
|
|
||
| public HadoopTuningConfig withWorkingPath(String path) | ||
| { | ||
| return new HadoopTuningConfig( | ||
|
|
@@ -207,7 +217,8 @@ public HadoopTuningConfig withWorkingPath(String path) | |
| jobProperties, | ||
| combineText, | ||
| useCombiner, | ||
| null | ||
| null, | ||
| buildV9Directly | ||
| ); | ||
| } | ||
|
|
||
|
|
@@ -227,7 +238,8 @@ public HadoopTuningConfig withVersion(String ver) | |
| jobProperties, | ||
| combineText, | ||
| useCombiner, | ||
| null | ||
| null, | ||
| buildV9Directly | ||
| ); | ||
| } | ||
|
|
||
|
|
@@ -247,7 +259,8 @@ public HadoopTuningConfig withShardSpecs(Map<DateTime, List<HadoopyShardSpec>> s | |
| jobProperties, | ||
| combineText, | ||
| useCombiner, | ||
| null | ||
| null, | ||
| buildV9Directly | ||
| ); | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -264,6 +264,7 @@ public DeterminePartitionsJobTest( | |
| null, | ||
| false, | ||
| false, | ||
| null, | ||
| null | ||
| ) | ||
| ) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -207,6 +207,7 @@ public void testHashedBucketSelection() | |
| null, | ||
| false, | ||
| false, | ||
| null, | ||
| null | ||
| ) | ||
| ); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -53,6 +53,7 @@ public void testSerde() throws Exception | |
| null, | ||
| true, | ||
| true, | ||
| null, | ||
| null | ||
| ); | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -115,6 +115,7 @@ public void setup() throws Exception | |
| ), | ||
| false, | ||
| false, | ||
| null, | ||
| null | ||
| ) | ||
| ) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -201,6 +201,7 @@ public InputStream openStream() throws IOException | |
| null, | ||
| false, | ||
| false, | ||
| null, | ||
| null | ||
| ) | ||
| ) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since we are changing the behavior of this method, can we please add a comment on the interface about how the method is supposed to be used?