From 3044bf55929d35fb87d995a3585599b7291d1bba Mon Sep 17 00:00:00 2001 From: Prajwal Tuladhar Date: Thu, 9 Apr 2015 13:22:21 -0400 Subject: [PATCH] use Job.getInstance() to fix deprecated warnings --- .../java/io/druid/indexer/DetermineHashedPartitionsJob.java | 4 +--- .../main/java/io/druid/indexer/DeterminePartitionsJob.java | 4 ++-- .../src/main/java/io/druid/indexer/IndexGeneratorJob.java | 2 +- indexing-hadoop/src/main/java/io/druid/indexer/JobHelper.java | 2 +- .../test/java/io/druid/indexer/path/StaticPathSpecTest.java | 2 +- 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/indexing-hadoop/src/main/java/io/druid/indexer/DetermineHashedPartitionsJob.java b/indexing-hadoop/src/main/java/io/druid/indexer/DetermineHashedPartitionsJob.java index 39683bbac5a..3233a1c44a1 100644 --- a/indexing-hadoop/src/main/java/io/druid/indexer/DetermineHashedPartitionsJob.java +++ b/indexing-hadoop/src/main/java/io/druid/indexer/DetermineHashedPartitionsJob.java @@ -46,8 +46,6 @@ import org.apache.hadoop.io.Writable; import org.apache.hadoop.mapreduce.Job; import org.apache.hadoop.mapreduce.Partitioner; import org.apache.hadoop.mapreduce.Reducer; -import org.apache.hadoop.mapreduce.lib.input.CombineTextInputFormat; -import org.apache.hadoop.mapreduce.lib.input.TextInputFormat; import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat; import org.apache.hadoop.mapreduce.lib.output.SequenceFileOutputFormat; import org.joda.time.DateTime; @@ -84,7 +82,7 @@ public class DetermineHashedPartitionsJob implements Jobby * in the final segment. */ long startTime = System.currentTimeMillis(); - final Job groupByJob = new Job( + final Job groupByJob = Job.getInstance( new Configuration(), String.format("%s-determine_partitions_hashed-%s", config.getDataSource(), config.getIntervals()) ); diff --git a/indexing-hadoop/src/main/java/io/druid/indexer/DeterminePartitionsJob.java b/indexing-hadoop/src/main/java/io/druid/indexer/DeterminePartitionsJob.java index ffbc5a446a8..14b9bf0c242 100644 --- a/indexing-hadoop/src/main/java/io/druid/indexer/DeterminePartitionsJob.java +++ b/indexing-hadoop/src/main/java/io/druid/indexer/DeterminePartitionsJob.java @@ -121,7 +121,7 @@ public class DeterminePartitionsJob implements Jobby } if (!config.getPartitionsSpec().isAssumeGrouped()) { - final Job groupByJob = new Job( + final Job groupByJob = Job.getInstance( new Configuration(), String.format("%s-determine_partitions_groupby-%s", config.getDataSource(), config.getIntervals()) ); @@ -157,7 +157,7 @@ public class DeterminePartitionsJob implements Jobby /* * Read grouped data and determine appropriate partitions. */ - final Job dimSelectionJob = new Job( + final Job dimSelectionJob = Job.getInstance( new Configuration(), String.format("%s-determine_partitions_dimselection-%s", config.getDataSource(), config.getIntervals()) ); diff --git a/indexing-hadoop/src/main/java/io/druid/indexer/IndexGeneratorJob.java b/indexing-hadoop/src/main/java/io/druid/indexer/IndexGeneratorJob.java index 033df56cdf5..e5b5f600e0b 100644 --- a/indexing-hadoop/src/main/java/io/druid/indexer/IndexGeneratorJob.java +++ b/indexing-hadoop/src/main/java/io/druid/indexer/IndexGeneratorJob.java @@ -152,7 +152,7 @@ public class IndexGeneratorJob implements Jobby public boolean run() { try { - Job job = new Job( + Job job = Job.getInstance( new Configuration(), String.format("%s-index-generator-%s", config.getDataSource(), config.getIntervals()) ); diff --git a/indexing-hadoop/src/main/java/io/druid/indexer/JobHelper.java b/indexing-hadoop/src/main/java/io/druid/indexer/JobHelper.java index 99d9a10c2c6..48e52971e7d 100644 --- a/indexing-hadoop/src/main/java/io/druid/indexer/JobHelper.java +++ b/indexing-hadoop/src/main/java/io/druid/indexer/JobHelper.java @@ -112,7 +112,7 @@ public class JobHelper { // config.addInputPaths() can have side-effects ( boo! :( ), so this stuff needs to be done before anything else try { - Job job = new Job( + Job job = Job.getInstance( new Configuration(), String.format("%s-determine_partitions-%s", config.getDataSource(), config.getIntervals()) ); diff --git a/indexing-hadoop/src/test/java/io/druid/indexer/path/StaticPathSpecTest.java b/indexing-hadoop/src/test/java/io/druid/indexer/path/StaticPathSpecTest.java index 96cb98b6c5a..c8bf9a8575a 100644 --- a/indexing-hadoop/src/test/java/io/druid/indexer/path/StaticPathSpecTest.java +++ b/indexing-hadoop/src/test/java/io/druid/indexer/path/StaticPathSpecTest.java @@ -60,7 +60,7 @@ public class StaticPathSpecTest StaticPathSpec pathSpec = (StaticPathSpec)jsonMapper.readValue(sb.toString(), PathSpec.class); Assert.assertEquals(inputFormat, pathSpec.getInputFormat()); - Job job = new Job(); + Job job = Job.getInstance(); pathSpec.addInputPaths(null, job); Assert.assertEquals( "file:" + path,