You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tez.apache.org by ss...@apache.org on 2014/08/19 02:02:12 UTC
[6/6] git commit: TEZ-1417. Rename *Configurer to
ConfigBuilder/Config. (sseth)
TEZ-1417. Rename *Configurer to ConfigBuilder/Config. (sseth)
Project: http://git-wip-us.apache.org/repos/asf/tez/repo
Commit: http://git-wip-us.apache.org/repos/asf/tez/commit/b526ed5c
Tree: http://git-wip-us.apache.org/repos/asf/tez/tree/b526ed5c
Diff: http://git-wip-us.apache.org/repos/asf/tez/diff/b526ed5c
Branch: refs/heads/master
Commit: b526ed5c1f59c83752c50ebf65d8c0d7668412a5
Parents: 37ac50a
Author: Siddharth Seth <ss...@apache.org>
Authored: Mon Aug 18 17:01:41 2014 -0700
Committer: Siddharth Seth <ss...@apache.org>
Committed: Mon Aug 18 17:01:41 2014 -0700
----------------------------------------------------------------------
CHANGES.txt | 1 +
.../org/apache/tez/dag/api/PreWarmVertex.java | 20 +-
.../apache/tez/dag/app/dag/impl/VertexImpl.java | 3 +-
.../apache/tez/examples/IntersectDataGen.java | 12 +-
.../apache/tez/examples/IntersectExample.java | 18 +-
.../apache/tez/examples/IntersectValidate.java | 12 +-
.../apache/tez/examples/OrderedWordCount.java | 14 +-
.../tez/examples/SimpleSessionExample.java | 2 +-
.../java/org/apache/tez/examples/WordCount.java | 14 +-
.../split/TezMapReduceSplitsGrouper.java | 22 +-
.../apache/tez/mapreduce/client/YARNRunner.java | 8 +-
.../tez/mapreduce/hadoop/MRInputHelpers.java | 2 +-
.../org/apache/tez/mapreduce/input/MRInput.java | 50 +-
.../tez/mapreduce/input/MRInputLegacy.java | 19 +-
.../apache/tez/mapreduce/output/MROutput.java | 38 +-
.../tez/mapreduce/output/MROutputLegacy.java | 18 +-
.../hadoop/mapred/split/TestGroupedSplits.java | 2 +-
.../vertexmanager/ShuffleVertexManager.java | 20 +-
.../TezBytesWritableSerialization.java | 4 +-
.../runtime/library/conf/BaseConfigBuilder.java | 62 +++
.../runtime/library/conf/BaseConfigurer.java | 62 ---
.../HadoopKeyValuesBasedBaseEdgeConfig.java | 73 +++
.../HadoopKeyValuesBasedBaseEdgeConfigurer.java | 73 ---
.../conf/OrderedGroupedKVInputConfig.java | 515 +++++++++++++++++++
.../conf/OrderedGroupedKVInputConfigurer.java | 515 -------------------
.../conf/OrderedPartitionedKVEdgeConfig.java | 293 +++++++++++
.../OrderedPartitionedKVEdgeConfigurer.java | 292 -----------
.../conf/OrderedPartitionedKVOutputConfig.java | 441 ++++++++++++++++
.../OrderedPartitionedKVOutputConfigurer.java | 441 ----------------
.../library/conf/UnorderedKVEdgeConfig.java | 260 ++++++++++
.../library/conf/UnorderedKVEdgeConfigurer.java | 260 ----------
.../library/conf/UnorderedKVInputConfig.java | 358 +++++++++++++
.../conf/UnorderedKVInputConfigurer.java | 358 -------------
.../library/conf/UnorderedKVOutputConfig.java | 283 ++++++++++
.../conf/UnorderedKVOutputConfigurer.java | 283 ----------
.../conf/UnorderedPartitionedKVEdgeConfig.java | 265 ++++++++++
.../UnorderedPartitionedKVEdgeConfigurer.java | 264 ----------
.../UnorderedPartitionedKVOutputConfig.java | 327 ++++++++++++
.../UnorderedPartitionedKVOutputConfigurer.java | 327 ------------
.../vertexmanager/TestShuffleVertexManager.java | 6 +-
.../conf/TestOnFileSortedOutputConfigurer.java | 190 -------
.../TestOnFileUnorderedKVOutputConfigurer.java | 129 -----
...eUnorderedPartitionedKVOutputConfigurer.java | 177 -------
.../TestOrderedGroupedMergedKVInputConfig.java | 160 ++++++
.../TestOrderedPartitionedKVEdgeConfig.java | 297 +++++++++++
.../TestOrderedPartitionedKVEdgeConfigurer.java | 292 -----------
.../TestOrderedPartitionedKVOutputConfig.java | 191 +++++++
.../conf/TestShuffledMergedInputConfigurer.java | 160 ------
.../TestShuffledUnorderedKVInputConfigurer.java | 131 -----
.../library/conf/TestUnorderedKVEdgeConfig.java | 173 +++++++
.../conf/TestUnorderedKVInputConfig.java | 131 +++++
.../conf/TestUnorderedKVOutputConfig.java | 129 +++++
.../TestUnorderedPartitionedKVEdgeConfig.java | 188 +++++++
...estUnorderedPartitionedKVEdgeConfigurer.java | 188 -------
.../TestUnorderedPartitionedKVOutputConfig.java | 177 +++++++
...tUnorderedUnpartitionedKVEdgeConfigurer.java | 173 -------
.../examples/BroadcastAndOneToOneExample.java | 4 +-
.../mapreduce/examples/FilterLinesByWord.java | 8 +-
.../examples/FilterLinesByWordOneToOne.java | 8 +-
.../tez/mapreduce/examples/MRRSleepJob.java | 14 +-
.../examples/TestOrderedWordCount.java | 12 +-
.../tez/mapreduce/examples/UnionExample.java | 22 +-
.../apache/tez/mapreduce/TestMRRJobsDAGApi.java | 8 +-
63 files changed, 4505 insertions(+), 4494 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tez/blob/b526ed5c/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index f3f90ad..9e884aa 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -72,6 +72,7 @@ INCOMPATIBLE CHANGES
TEZ-1426. Create configuration helpers for ShuffleVertexManager and
TezGrouping code
TEZ-1390. Replace byte[] with ByteBuffer as the type of user payload in the API
+ TEZ-1417. Rename Configurer* to Config/ConfigBuilder
Release 0.4.0-incubating: 2014-04-05
http://git-wip-us.apache.org/repos/asf/tez/blob/b526ed5c/tez-api/src/main/java/org/apache/tez/dag/api/PreWarmVertex.java
----------------------------------------------------------------------
diff --git a/tez-api/src/main/java/org/apache/tez/dag/api/PreWarmVertex.java b/tez-api/src/main/java/org/apache/tez/dag/api/PreWarmVertex.java
index 69dc5d8..8d2f0d5 100644
--- a/tez-api/src/main/java/org/apache/tez/dag/api/PreWarmVertex.java
+++ b/tez-api/src/main/java/org/apache/tez/dag/api/PreWarmVertex.java
@@ -96,13 +96,13 @@ public class PreWarmVertex extends Vertex {
}
/**
- * Create a configurer for the @link {@link PreWarmVertex}. This may be used to construct the
+ * Create a config builder for the @link {@link PreWarmVertex}. This may be used to construct the
* pre-warm vertex more flexibly.
* @param conf
* @return
*/
- public static PreWarmVertexConfigurer createConfigurer(Configuration conf) {
- return new PreWarmVertexConfigurer(conf);
+ public static PreWarmVertexConfigBuilder createConfigBuilder(Configuration conf) {
+ return new PreWarmVertexConfigBuilder(conf);
}
/**
@@ -110,38 +110,38 @@ public class PreWarmVertex extends Vertex {
* PreWarmProcessor and sets up the prewarm container number equal to
* {@link TezConfiguration#TEZ_AM_SESSION_MIN_HELD_CONTAINERS}
*/
- public static class PreWarmVertexConfigurer {
+ public static class PreWarmVertexConfigBuilder {
String name;
int parallelism;
ProcessorDescriptor proc;
Resource resource;
Configuration conf;
- PreWarmVertexConfigurer(Configuration conf) {
+ PreWarmVertexConfigBuilder(Configuration conf) {
this.conf = conf;
}
- public PreWarmVertexConfigurer setName(String name) {
+ public PreWarmVertexConfigBuilder setName(String name) {
this.name = name;
return this;
}
- public PreWarmVertexConfigurer setProcessorDescriptor(ProcessorDescriptor proc) {
+ public PreWarmVertexConfigBuilder setProcessorDescriptor(ProcessorDescriptor proc) {
this.proc = proc;
return this;
}
- public PreWarmVertexConfigurer setResource(Resource resource) {
+ public PreWarmVertexConfigBuilder setResource(Resource resource) {
this.resource = resource;
return this;
}
- public PreWarmVertexConfigurer setParallelism(int parallelism) {
+ public PreWarmVertexConfigBuilder setParallelism(int parallelism) {
this.parallelism = parallelism;
return this;
}
- public PreWarmVertex create() {
+ public PreWarmVertex build() {
if (name == null) {
name = "_PreWarm_";
}
http://git-wip-us.apache.org/repos/asf/tez/blob/b526ed5c/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/VertexImpl.java
----------------------------------------------------------------------
diff --git a/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/VertexImpl.java b/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/VertexImpl.java
index 6883dee..6f77d98 100644
--- a/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/VertexImpl.java
+++ b/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/VertexImpl.java
@@ -55,7 +55,6 @@ import org.apache.hadoop.yarn.state.StateMachine;
import org.apache.hadoop.yarn.state.StateMachineFactory;
import org.apache.hadoop.yarn.util.Clock;
import org.apache.tez.common.ReflectionUtils;
-import org.apache.tez.common.TezUtils;
import org.apache.tez.common.counters.TezCounters;
import org.apache.tez.dag.api.DagTypeConverters;
import org.apache.tez.dag.api.EdgeManagerPluginDescriptor;
@@ -1915,7 +1914,7 @@ public class VertexImpl implements org.apache.tez.dag.app.dag.Vertex,
LOG.info("Setting vertexManager to ShuffleVertexManager for "
+ logIdentifier);
// shuffle vertex manager needs a conf payload
- vertexManager = new VertexManager(ShuffleVertexManager.createConfigurer(conf).build(),
+ vertexManager = new VertexManager(ShuffleVertexManager.createConfigBuilder(conf).build(),
this, appContext);
} else {
// schedule all tasks upon vertex start. Default behavior.
http://git-wip-us.apache.org/repos/asf/tez/blob/b526ed5c/tez-examples/src/main/java/org/apache/tez/examples/IntersectDataGen.java
----------------------------------------------------------------------
diff --git a/tez-examples/src/main/java/org/apache/tez/examples/IntersectDataGen.java b/tez-examples/src/main/java/org/apache/tez/examples/IntersectDataGen.java
index 288869b..ec51cf1 100644
--- a/tez-examples/src/main/java/org/apache/tez/examples/IntersectDataGen.java
+++ b/tez-examples/src/main/java/org/apache/tez/examples/IntersectDataGen.java
@@ -205,14 +205,14 @@ public class IntersectDataGen extends Configured implements Tool {
new UserPayload(ByteBuffer.wrap(GenDataProcessor.createConfiguration(largeOutSizePerTask,
smallOutSizePerTask)))), numTasks);
genDataVertex.addDataSink(STREAM_OUTPUT_NAME,
- MROutput.createConfigurer(new Configuration(tezConf),
- TextOutputFormat.class, largeOutPath.toUri().toString()).create());
+ MROutput.createConfigBuilder(new Configuration(tezConf),
+ TextOutputFormat.class, largeOutPath.toUri().toString()).build());
genDataVertex.addDataSink(HASH_OUTPUT_NAME,
- MROutput.createConfigurer(new Configuration(tezConf),
- TextOutputFormat.class, smallOutPath.toUri().toString()).create());
+ MROutput.createConfigBuilder(new Configuration(tezConf),
+ TextOutputFormat.class, smallOutPath.toUri().toString()).build());
genDataVertex.addDataSink(EXPECTED_OUTPUT_NAME,
- MROutput.createConfigurer(new Configuration(tezConf),
- TextOutputFormat.class, expectedOutputPath.toUri().toString()).create());
+ MROutput.createConfigBuilder(new Configuration(tezConf),
+ TextOutputFormat.class, expectedOutputPath.toUri().toString()).build());
dag.addVertex(genDataVertex);
http://git-wip-us.apache.org/repos/asf/tez/blob/b526ed5c/tez-examples/src/main/java/org/apache/tez/examples/IntersectExample.java
----------------------------------------------------------------------
diff --git a/tez-examples/src/main/java/org/apache/tez/examples/IntersectExample.java b/tez-examples/src/main/java/org/apache/tez/examples/IntersectExample.java
index 2f97b8f..90a232a 100644
--- a/tez-examples/src/main/java/org/apache/tez/examples/IntersectExample.java
+++ b/tez-examples/src/main/java/org/apache/tez/examples/IntersectExample.java
@@ -55,7 +55,7 @@ import org.apache.tez.runtime.api.Reader;
import org.apache.tez.runtime.api.ProcessorContext;
import org.apache.tez.runtime.library.api.KeyValueReader;
import org.apache.tez.runtime.library.api.KeyValueWriter;
-import org.apache.tez.runtime.library.conf.UnorderedPartitionedKVEdgeConfigurer;
+import org.apache.tez.runtime.library.conf.UnorderedPartitionedKVEdgeConfig;
import org.apache.tez.runtime.library.partitioner.HashPartitioner;
import org.apache.tez.runtime.library.processor.SimpleProcessor;
@@ -177,8 +177,8 @@ public class IntersectExample extends Configured implements Tool {
// This should only be setting selective keys from the underlying conf. Fix after there's a
// better mechanism to configure the IOs.
- UnorderedPartitionedKVEdgeConfigurer edgeConf =
- UnorderedPartitionedKVEdgeConfigurer
+ UnorderedPartitionedKVEdgeConfig edgeConf =
+ UnorderedPartitionedKVEdgeConfig
.newBuilder(Text.class.getName(), NullWritable.class.getName(),
HashPartitioner.class.getName()).build();
@@ -187,20 +187,20 @@ public class IntersectExample extends Configured implements Tool {
ForwardingProcessor.class.getName())).addDataSource(
"streamfile",
MRInput
- .createConfigurer(new Configuration(tezConf), TextInputFormat.class,
- streamPath.toUri().toString()).groupSplits(false).create());
+ .createConfigBuilder(new Configuration(tezConf), TextInputFormat.class,
+ streamPath.toUri().toString()).groupSplits(false).build());
Vertex hashFileVertex = new Vertex("partitioner2", new ProcessorDescriptor(
ForwardingProcessor.class.getName())).addDataSource(
"hashfile",
MRInput
- .createConfigurer(new Configuration(tezConf), TextInputFormat.class,
- hashPath.toUri().toString()).groupSplits(false).create());
+ .createConfigBuilder(new Configuration(tezConf), TextInputFormat.class,
+ hashPath.toUri().toString()).groupSplits(false).build());
Vertex intersectVertex = new Vertex("intersect", new ProcessorDescriptor(
IntersectProcessor.class.getName()), numPartitions).addDataSink("finalOutput",
- MROutput.createConfigurer(new Configuration(tezConf),
- TextOutputFormat.class, outPath.toUri().toString()).create());
+ MROutput.createConfigBuilder(new Configuration(tezConf),
+ TextOutputFormat.class, outPath.toUri().toString()).build());
Edge e1 = new Edge(streamFileVertex, intersectVertex, edgeConf.createDefaultEdgeProperty());
http://git-wip-us.apache.org/repos/asf/tez/blob/b526ed5c/tez-examples/src/main/java/org/apache/tez/examples/IntersectValidate.java
----------------------------------------------------------------------
diff --git a/tez-examples/src/main/java/org/apache/tez/examples/IntersectValidate.java b/tez-examples/src/main/java/org/apache/tez/examples/IntersectValidate.java
index 6ee291b..d86fd77 100644
--- a/tez-examples/src/main/java/org/apache/tez/examples/IntersectValidate.java
+++ b/tez-examples/src/main/java/org/apache/tez/examples/IntersectValidate.java
@@ -49,7 +49,7 @@ import org.apache.tez.runtime.api.LogicalInput;
import org.apache.tez.runtime.api.Reader;
import org.apache.tez.runtime.api.ProcessorContext;
import org.apache.tez.runtime.library.api.KeyValuesReader;
-import org.apache.tez.runtime.library.conf.OrderedPartitionedKVEdgeConfigurer;
+import org.apache.tez.runtime.library.conf.OrderedPartitionedKVEdgeConfig;
import org.apache.tez.runtime.library.partitioner.HashPartitioner;
import org.apache.tez.runtime.library.processor.SimpleProcessor;
@@ -184,21 +184,21 @@ public class IntersectValidate extends Configured implements Tool {
// Configuration for intermediate output - shared by Vertex1 and Vertex2
// This should only be setting selective keys from the underlying conf. Fix after there's a
// better mechanism to configure the IOs.
- OrderedPartitionedKVEdgeConfigurer edgeConf = OrderedPartitionedKVEdgeConfigurer
+ OrderedPartitionedKVEdgeConfig edgeConf = OrderedPartitionedKVEdgeConfig
.newBuilder(Text.class.getName(), NullWritable.class.getName(),
HashPartitioner.class.getName()).build();
Vertex lhsVertex = new Vertex(LHS_INPUT_NAME, new ProcessorDescriptor(
ForwardingProcessor.class.getName())).addDataSource("lhs",
MRInput
- .createConfigurer(new Configuration(tezConf), TextInputFormat.class,
- lhs.toUri().toString()).groupSplits(false).create());
+ .createConfigBuilder(new Configuration(tezConf), TextInputFormat.class,
+ lhs.toUri().toString()).groupSplits(false).build());
Vertex rhsVertex = new Vertex(RHS_INPUT_NAME, new ProcessorDescriptor(
ForwardingProcessor.class.getName())).addDataSource("rhs",
MRInput
- .createConfigurer(new Configuration(tezConf), TextInputFormat.class,
- rhs.toUri().toString()).groupSplits(false).create());
+ .createConfigBuilder(new Configuration(tezConf), TextInputFormat.class,
+ rhs.toUri().toString()).groupSplits(false).build());
Vertex intersectValidateVertex = new Vertex("intersectvalidate", new ProcessorDescriptor(
IntersectValidateProcessor.class.getName()), numPartitions);
http://git-wip-us.apache.org/repos/asf/tez/blob/b526ed5c/tez-examples/src/main/java/org/apache/tez/examples/OrderedWordCount.java
----------------------------------------------------------------------
diff --git a/tez-examples/src/main/java/org/apache/tez/examples/OrderedWordCount.java b/tez-examples/src/main/java/org/apache/tez/examples/OrderedWordCount.java
index 8ba8179..0bba651 100644
--- a/tez-examples/src/main/java/org/apache/tez/examples/OrderedWordCount.java
+++ b/tez-examples/src/main/java/org/apache/tez/examples/OrderedWordCount.java
@@ -46,7 +46,7 @@ import org.apache.tez.mapreduce.processor.SimpleMRProcessor;
import org.apache.tez.runtime.api.ProcessorContext;
import org.apache.tez.runtime.library.api.KeyValueWriter;
import org.apache.tez.runtime.library.api.KeyValuesReader;
-import org.apache.tez.runtime.library.conf.OrderedPartitionedKVEdgeConfigurer;
+import org.apache.tez.runtime.library.conf.OrderedPartitionedKVEdgeConfig;
import org.apache.tez.runtime.library.partitioner.HashPartitioner;
import org.apache.tez.runtime.library.processor.SimpleProcessor;
@@ -115,18 +115,18 @@ public class OrderedWordCount extends Configured implements Tool {
public static DAG createDAG(TezConfiguration tezConf, String inputPath, String outputPath,
int numPartitions, String dagName) throws IOException {
- DataSourceDescriptor dataSource = MRInput.createConfigurer(new Configuration(tezConf),
- TextInputFormat.class, inputPath).create();
+ DataSourceDescriptor dataSource = MRInput.createConfigBuilder(new Configuration(tezConf),
+ TextInputFormat.class, inputPath).build();
- DataSinkDescriptor dataSink = MROutput.createConfigurer(new Configuration(tezConf),
- TextOutputFormat.class, outputPath).create();
+ DataSinkDescriptor dataSink = MROutput.createConfigBuilder(new Configuration(tezConf),
+ TextOutputFormat.class, outputPath).build();
Vertex tokenizerVertex = new Vertex("Tokenizer", new ProcessorDescriptor(
TokenProcessor.class.getName()));
tokenizerVertex.addDataSource("MRInput", dataSource);
// Use Text key and IntWritable value to bring counts for each word in the same partition
- OrderedPartitionedKVEdgeConfigurer summationEdgeConf = OrderedPartitionedKVEdgeConfigurer
+ OrderedPartitionedKVEdgeConfig summationEdgeConf = OrderedPartitionedKVEdgeConfig
.newBuilder(Text.class.getName(), IntWritable.class.getName(),
HashPartitioner.class.getName()).build();
@@ -137,7 +137,7 @@ public class OrderedWordCount extends Configured implements Tool {
// Use IntWritable key and Text value to bring all words with the same count in the same
// partition. The data will be ordered by count and words grouped by count.
- OrderedPartitionedKVEdgeConfigurer sorterEdgeConf = OrderedPartitionedKVEdgeConfigurer
+ OrderedPartitionedKVEdgeConfig sorterEdgeConf = OrderedPartitionedKVEdgeConfig
.newBuilder(IntWritable.class.getName(), Text.class.getName(),
HashPartitioner.class.getName()).build();
http://git-wip-us.apache.org/repos/asf/tez/blob/b526ed5c/tez-examples/src/main/java/org/apache/tez/examples/SimpleSessionExample.java
----------------------------------------------------------------------
diff --git a/tez-examples/src/main/java/org/apache/tez/examples/SimpleSessionExample.java b/tez-examples/src/main/java/org/apache/tez/examples/SimpleSessionExample.java
index 81addcf..f4ed5b3 100644
--- a/tez-examples/src/main/java/org/apache/tez/examples/SimpleSessionExample.java
+++ b/tez-examples/src/main/java/org/apache/tez/examples/SimpleSessionExample.java
@@ -76,7 +76,7 @@ public class SimpleSessionExample extends Configured implements Tool {
// specified using other API's. We know that the OrderedWordCount dag uses default files and
// resources. Otherwise we would have to specify matching parameters in the preWarm API too.
tezConf.setInt(TezConfiguration.TEZ_AM_SESSION_MIN_HELD_CONTAINERS, numPartitions);
- tezClient.preWarm(PreWarmVertex.createConfigurer(tezConf).create());
+ tezClient.preWarm(PreWarmVertex.createConfigBuilder(tezConf).build());
}
// the remaining code is the same as submitting any DAG.
http://git-wip-us.apache.org/repos/asf/tez/blob/b526ed5c/tez-examples/src/main/java/org/apache/tez/examples/WordCount.java
----------------------------------------------------------------------
diff --git a/tez-examples/src/main/java/org/apache/tez/examples/WordCount.java b/tez-examples/src/main/java/org/apache/tez/examples/WordCount.java
index 6e49dbc..ddf0953 100644
--- a/tez-examples/src/main/java/org/apache/tez/examples/WordCount.java
+++ b/tez-examples/src/main/java/org/apache/tez/examples/WordCount.java
@@ -46,7 +46,7 @@ import org.apache.tez.runtime.api.ProcessorContext;
import org.apache.tez.runtime.library.api.KeyValueReader;
import org.apache.tez.runtime.library.api.KeyValueWriter;
import org.apache.tez.runtime.library.api.KeyValuesReader;
-import org.apache.tez.runtime.library.conf.OrderedPartitionedKVEdgeConfigurer;
+import org.apache.tez.runtime.library.conf.OrderedPartitionedKVEdgeConfig;
import com.google.common.base.Preconditions;
@@ -139,13 +139,13 @@ public class WordCount extends Configured implements Tool {
// Create the descriptor that describes the input data to Tez. Using MRInput to read text
// data from the given input path. The TextInputFormat is used to read the text data.
- DataSourceDescriptor dataSource = MRInput.createConfigurer(new Configuration(tezConf),
- TextInputFormat.class, inputPath).create();
+ DataSourceDescriptor dataSource = MRInput.createConfigBuilder(new Configuration(tezConf),
+ TextInputFormat.class, inputPath).build();
// Create a descriptor that describes the output data to Tez. Using MROoutput to write text
// data to the given output path. The TextOutputFormat is used to write the text data.
- DataSinkDescriptor dataSink = MROutput.createConfigurer(new Configuration(tezConf),
- TextOutputFormat.class, outputPath).create();
+ DataSinkDescriptor dataSink = MROutput.createConfigBuilder(new Configuration(tezConf),
+ TextOutputFormat.class, outputPath).build();
// Create a vertex that reads the data from the data source and tokenizes it using the
// TokenProcessor. The number of tasks that will do the work for this vertex will be decided
@@ -158,13 +158,13 @@ public class WordCount extends Configured implements Tool {
// parallel the tokenized data will be partitioned by word such that a given word goes to the
// same partition. The counts for the words should be grouped together per word. To achieve this
// we can use an edge that contains an input/output pair that handles partitioning and grouping
- // of key value data. We use the helper OrderedPartitionedKVEdgeConfigurer to create such an
+ // of key value data. We use the helper OrderedPartitionedKVEdgeConfig to create such an
// edge. Internally, it sets up matching Tez inputs and outputs that can perform this logic.
// We specify the key, value and partitioner type. Here the key type is Text (for word), the
// value type is IntWritable (for count) and we using a hash based partitioner. This is a helper
// object. The edge can be configured by configuring the input, output etc individually without
// using this helper.
- OrderedPartitionedKVEdgeConfigurer edgeConf = OrderedPartitionedKVEdgeConfigurer
+ OrderedPartitionedKVEdgeConfig edgeConf = OrderedPartitionedKVEdgeConfig
.newBuilder(Text.class.getName(), IntWritable.class.getName(),
HashPartitioner.class.getName()).build();
http://git-wip-us.apache.org/repos/asf/tez/blob/b526ed5c/tez-mapreduce/src/main/java/org/apache/hadoop/mapreduce/split/TezMapReduceSplitsGrouper.java
----------------------------------------------------------------------
diff --git a/tez-mapreduce/src/main/java/org/apache/hadoop/mapreduce/split/TezMapReduceSplitsGrouper.java b/tez-mapreduce/src/main/java/org/apache/hadoop/mapreduce/split/TezMapReduceSplitsGrouper.java
index fc8eae8..2943d30 100644
--- a/tez-mapreduce/src/main/java/org/apache/hadoop/mapreduce/split/TezMapReduceSplitsGrouper.java
+++ b/tez-mapreduce/src/main/java/org/apache/hadoop/mapreduce/split/TezMapReduceSplitsGrouper.java
@@ -484,46 +484,46 @@ public class TezMapReduceSplitsGrouper {
* then pass in a {@link Configuration} that is initialized from a
* config file. The parameters that are not overridden in code will
* be derived from the Configuration object.
- * @return {@link TezMRSplitsGrouperConfigurer}
+ * @return {@link org.apache.hadoop.mapreduce.split.TezMapReduceSplitsGrouper.TezMRSplitsGrouperConfigBuilder}
*/
- public static TezMRSplitsGrouperConfigurer createConfigurer(Configuration conf) {
- return new TezMRSplitsGrouperConfigurer(conf);
+ public static TezMRSplitsGrouperConfigBuilder createConfigBuilder(Configuration conf) {
+ return new TezMRSplitsGrouperConfigBuilder(conf);
}
- public static final class TezMRSplitsGrouperConfigurer {
+ public static final class TezMRSplitsGrouperConfigBuilder {
private final Configuration conf;
/**
* This configuration will be modified in place
*/
- private TezMRSplitsGrouperConfigurer(Configuration conf) {
+ private TezMRSplitsGrouperConfigBuilder(Configuration conf) {
if (conf == null) {
conf = new Configuration(false);
}
this.conf = conf;
}
- public TezMRSplitsGrouperConfigurer setGroupSplitCount(int count) {
+ public TezMRSplitsGrouperConfigBuilder setGroupSplitCount(int count) {
this.conf.setInt(TEZ_GROUPING_SPLIT_COUNT, count);
return this;
}
- public TezMRSplitsGrouperConfigurer setGroupSplitByCount(boolean enabled) {
+ public TezMRSplitsGrouperConfigBuilder setGroupSplitByCount(boolean enabled) {
this.conf.setBoolean(TEZ_GROUPING_SPLIT_BY_COUNT, enabled);
return this;
}
- public TezMRSplitsGrouperConfigurer setGroupSplitByLength(boolean enabled) {
+ public TezMRSplitsGrouperConfigBuilder setGroupSplitByLength(boolean enabled) {
this.conf.setBoolean(TEZ_GROUPING_SPLIT_BY_LENGTH, enabled);
return this;
}
- public TezMRSplitsGrouperConfigurer setGroupSplitWaves(float multiplier) {
+ public TezMRSplitsGrouperConfigBuilder setGroupSplitWaves(float multiplier) {
this.conf.setFloat(TEZ_GROUPING_SPLIT_WAVES, multiplier);
return this;
}
- public TezMRSplitsGrouperConfigurer setGroupingRackSplitSizeReduction(float rackSplitSizeReduction) {
+ public TezMRSplitsGrouperConfigBuilder setGroupingRackSplitSizeReduction(float rackSplitSizeReduction) {
this.conf.setFloat(TEZ_GROUPING_RACK_SPLIT_SIZE_REDUCTION, rackSplitSizeReduction);
return this;
}
@@ -531,7 +531,7 @@ public class TezMapReduceSplitsGrouper {
/**
* upper and lower bounds for the splits
*/
- public TezMRSplitsGrouperConfigurer setGroupingSplitSize(long lowerBound, long upperBound) {
+ public TezMRSplitsGrouperConfigBuilder setGroupingSplitSize(long lowerBound, long upperBound) {
this.conf.setLong(TEZ_GROUPING_SPLIT_MIN_SIZE, lowerBound);
this.conf.setLong(TEZ_GROUPING_SPLIT_MAX_SIZE, upperBound);
return this;
http://git-wip-us.apache.org/repos/asf/tez/blob/b526ed5c/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/client/YARNRunner.java
----------------------------------------------------------------------
diff --git a/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/client/YARNRunner.java b/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/client/YARNRunner.java
index 8cd0cd0..a83b500 100644
--- a/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/client/YARNRunner.java
+++ b/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/client/YARNRunner.java
@@ -115,7 +115,7 @@ import org.apache.tez.mapreduce.processor.map.MapProcessor;
import org.apache.tez.mapreduce.processor.reduce.ReduceProcessor;
import org.apache.tez.mapreduce.protos.MRRuntimeProtos;
import org.apache.tez.runtime.library.api.TezRuntimeConfiguration;
-import org.apache.tez.runtime.library.conf.OrderedPartitionedKVEdgeConfigurer;
+import org.apache.tez.runtime.library.conf.OrderedPartitionedKVEdgeConfig;
import com.google.common.annotations.VisibleForTesting;
@@ -448,7 +448,7 @@ public class YARNRunner implements ClientProtocol {
.setTaskLaunchCmdOpts(taskJavaOpts);
if (!isMap) {
- vertex.setVertexManagerPlugin((ShuffleVertexManager.createConfigurer(stageConf).build()));
+ vertex.setVertexManagerPlugin((ShuffleVertexManager.createConfigBuilder(stageConf).build()));
}
if (LOG.isDebugEnabled()) {
@@ -498,8 +498,8 @@ public class YARNRunner implements ClientProtocol {
partitionerConf.put(entry.getKey(), entry.getValue());
}
}
- OrderedPartitionedKVEdgeConfigurer edgeConf =
- OrderedPartitionedKVEdgeConfigurer.newBuilder(stageConfs[i - 1].get(
+ OrderedPartitionedKVEdgeConfig edgeConf =
+ OrderedPartitionedKVEdgeConfig.newBuilder(stageConfs[i - 1].get(
TezRuntimeConfiguration.TEZ_RUNTIME_KEY_CLASS),
stageConfs[i - 1].get(TezRuntimeConfiguration.TEZ_RUNTIME_VALUE_CLASS),
MRPartitioner.class.getName(), partitionerConf)
http://git-wip-us.apache.org/repos/asf/tez/blob/b526ed5c/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/hadoop/MRInputHelpers.java
----------------------------------------------------------------------
diff --git a/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/hadoop/MRInputHelpers.java b/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/hadoop/MRInputHelpers.java
index 22b6933..bff94e5 100644
--- a/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/hadoop/MRInputHelpers.java
+++ b/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/hadoop/MRInputHelpers.java
@@ -85,7 +85,7 @@ public class MRInputHelpers {
* <p/>
* Usage of this technique for handling splits is not advised. Instead, splits should be either
* generated in the AM, or generated in the client and distributed via the AM. See {@link
- * org.apache.tez.mapreduce.input.MRInput.MRInputConfigurer}
+ * org.apache.tez.mapreduce.input.MRInput.MRInputConfigBuilder}
* <p/>
* Note: Attempting to use this method to add multiple Inputs to a Vertex is not supported.
*
http://git-wip-us.apache.org/repos/asf/tez/blob/b526ed5c/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/input/MRInput.java
----------------------------------------------------------------------
diff --git a/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/input/MRInput.java b/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/input/MRInput.java
index 8c8fbb6..cdcaba0 100644
--- a/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/input/MRInput.java
+++ b/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/input/MRInput.java
@@ -84,7 +84,7 @@ public class MRInput extends MRInputBase {
* Helper class to configure {@link MRInput}
*
*/
- public static class MRInputConfigurer {
+ public static class MRInputConfigBuilder {
final Configuration conf;
final Class<?> inputFormat;
final boolean inputFormatProvided;
@@ -96,7 +96,7 @@ public class MRInput extends MRInputBase {
String inputPaths = null;
InputInitializerDescriptor customInitializerDescriptor = null;
- private MRInputConfigurer(Configuration conf, Class<?> inputFormat) {
+ private MRInputConfigBuilder(Configuration conf, Class<?> inputFormat) {
this.conf = conf;
if (inputFormat != null) {
inputFormatProvided = true;
@@ -123,18 +123,18 @@ public class MRInput extends MRInputBase {
}
}
- MRInputConfigurer setInputClassName(String className) {
+ MRInputConfigBuilder setInputClassName(String className) {
this.inputClassName = className;
return this;
}
- private MRInputConfigurer setInputPaths(String inputPaths) {
+ private MRInputConfigBuilder setInputPaths(String inputPaths) {
if (!(org.apache.hadoop.mapred.FileInputFormat.class.isAssignableFrom(inputFormat) ||
FileInputFormat.class.isAssignableFrom(inputFormat))) {
throw new TezUncheckedException("When setting inputPaths the inputFormat must be " +
"assignable from either org.apache.hadoop.mapred.FileInputFormat or " +
"org.apache.hadoop.mapreduce.lib.input.FileInputFormat. " +
- "Otherwise use the non-path configurer." +
+ "Otherwise use the non-path configBuilder." +
" Given: " + inputFormat.getName());
}
conf.set(FileInputFormat.INPUT_DIR, inputPaths);
@@ -154,9 +154,9 @@ public class MRInput extends MRInputBase {
/**
* Set whether splits should be grouped (default true)
* @param value whether to group splits in the AM or not
- * @return {@link MRInputConfigurer}
+ * @return {@link org.apache.tez.mapreduce.input.MRInput.MRInputConfigBuilder}
*/
- public MRInputConfigurer groupSplits(boolean value) {
+ public MRInputConfigBuilder groupSplits(boolean value) {
groupSplitsInAM = value;
return this;
}
@@ -164,9 +164,9 @@ public class MRInput extends MRInputBase {
/**
* Set whether splits should be generated in the Tez App Master (default true)
* @param value whether to generate splits in the AM or not
- * @return {@link MRInputConfigurer}
+ * @return {@link org.apache.tez.mapreduce.input.MRInput.MRInputConfigBuilder}
*/
- public MRInputConfigurer generateSplitsInAM(boolean value) {
+ public MRInputConfigBuilder generateSplitsInAM(boolean value) {
generateSplitsInAM = value;
return this;
}
@@ -176,16 +176,16 @@ public class MRInput extends MRInputBase {
* Use the method to turn this off when not using a {@link FileSystem}
* or when {@link Credentials} are not supported
* @param value whether to get credentials or not. (true by default)
- * @return {@link MRInputConfigurer}
+ * @return {@link org.apache.tez.mapreduce.input.MRInput.MRInputConfigBuilder}
*/
- public MRInputConfigurer getCredentialsForSourceFileSystem(boolean value) {
+ public MRInputConfigBuilder getCredentialsForSourceFileSystem(boolean value) {
getCredentialsForSourceFilesystem = value;
return this;
}
/**
* This method is intended to be used in case a custom {@link org.apache.tez.runtime.api.InputInitializer}
- * is being used along with MRInput. If a custom descriptor is used, the configurer will not be
+ * is being used along with MRInput. If a custom descriptor is used, the config builder will not be
* able to setup location hints, parallelism, etc, and configuring the {@link
* org.apache.tez.dag.api.Vertex} on which this Input is used is the responsibility of the user.
*
@@ -193,9 +193,9 @@ public class MRInput extends MRInputBase {
* Whether grouping is enabled or not can be controlled via {@link #groupSplitsInAM} method.
*
* @param customInitializerDescriptor the initializer descriptor
- * @return {@link MRInputConfigurer}
+ * @return {@link org.apache.tez.mapreduce.input.MRInput.MRInputConfigBuilder}
*/
- public MRInputConfigurer setCustomInitializerDescriptor(
+ public MRInputConfigBuilder setCustomInitializerDescriptor(
InputInitializerDescriptor customInitializerDescriptor) {
this.customInitializerDescriptor = customInitializerDescriptor;
return this;
@@ -206,7 +206,7 @@ public class MRInput extends MRInputBase {
*
* @return {@link DataSourceDescriptor}
*/
- public DataSourceDescriptor create() {
+ public DataSourceDescriptor build() {
if (org.apache.hadoop.mapred.FileInputFormat.class.isAssignableFrom(inputFormat) ||
FileInputFormat.class.isAssignableFrom(inputFormat)) {
if (inputPaths == null) {
@@ -323,7 +323,7 @@ public class MRInput extends MRInputBase {
}
/**
- * Create an {@link MRInputConfigurer} </p>
+ * Create an {@link org.apache.tez.mapreduce.input.MRInput.MRInputConfigBuilder} </p>
* The preferred usage model is to provide all of the parameters, and use methods to configure
* the Input.
* <p/>
@@ -335,14 +335,15 @@ public class MRInput extends MRInputBase {
* @param inputFormat InputFormat derived class. This can be null. If the InputFormat specified
* is
* null, the provided configuration should be complete.
- * @return {@link MRInputConfigurer}
+ * @return {@link org.apache.tez.mapreduce.input.MRInput.MRInputConfigBuilder}
*/
- public static MRInputConfigurer createConfigurer(Configuration conf, @Nullable Class<?> inputFormat) {
- return new MRInputConfigurer(conf, inputFormat);
+ public static MRInputConfigBuilder createConfigBuilder(Configuration conf,
+ @Nullable Class<?> inputFormat) {
+ return new MRInputConfigBuilder(conf, inputFormat);
}
/**
- * Create an {@link MRInputConfigurer} for {@link org.apache.hadoop.mapreduce.lib.input.FileInputFormat}
+ * Create an {@link org.apache.tez.mapreduce.input.MRInput.MRInputConfigBuilder} for {@link org.apache.hadoop.mapreduce.lib.input.FileInputFormat}
* or {@link org.apache.hadoop.mapred.FileInputFormat} format based InputFormats.
* <p/>
* The preferred usage model is to provide all of the parameters, and use methods to configure
@@ -357,11 +358,12 @@ public class MRInput extends MRInputBase {
* is
* null, the provided configuration should be complete.
* @param inputPaths Comma separated input paths
- * @return {@link MRInputConfigurer}
+ * @return {@link org.apache.tez.mapreduce.input.MRInput.MRInputConfigBuilder}
*/
- public static MRInputConfigurer createConfigurer(Configuration conf, @Nullable Class<?> inputFormat,
- @Nullable String inputPaths) {
- MRInputConfigurer configurer = new MRInputConfigurer(conf, inputFormat);
+ public static MRInputConfigBuilder createConfigBuilder(Configuration conf,
+ @Nullable Class<?> inputFormat,
+ @Nullable String inputPaths) {
+ MRInputConfigBuilder configurer = new MRInputConfigBuilder(conf, inputFormat);
if (inputPaths != null) {
return configurer.setInputPaths(inputPaths);
}
http://git-wip-us.apache.org/repos/asf/tez/blob/b526ed5c/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/input/MRInputLegacy.java
----------------------------------------------------------------------
diff --git a/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/input/MRInputLegacy.java b/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/input/MRInputLegacy.java
index 6915dde..8b69ad7 100644
--- a/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/input/MRInputLegacy.java
+++ b/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/input/MRInputLegacy.java
@@ -30,7 +30,6 @@ import org.apache.hadoop.classification.InterfaceStability.Unstable;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.mapred.InputSplit;
import org.apache.hadoop.mapred.RecordReader;
-import org.apache.tez.mapreduce.input.MRInput.MRInputConfigurer;
import org.apache.tez.runtime.api.InputContext;
import org.apache.tez.runtime.api.events.InputDataInformationEvent;
@@ -46,25 +45,25 @@ public class MRInputLegacy extends MRInput {
/**
- * Create an {@link MRInputConfigurer}
+ * Create an {@link org.apache.tez.mapreduce.input.MRInput.MRInputConfigBuilder}
* @param conf Configuration for the {@link MRInputLegacy}
* @param inputFormat InputFormat derived class
- * @return {@link MRInputConfigurer}
+ * @return {@link org.apache.tez.mapreduce.input.MRInput.MRInputConfigBuilder}
*/
- public static MRInputConfigurer createConfigurer(Configuration conf, Class<?> inputFormat) {
- return MRInput.createConfigurer(conf, inputFormat).setInputClassName(MRInputLegacy.class.getName());
+ public static MRInputConfigBuilder createConfigBuilder(Configuration conf, Class<?> inputFormat) {
+ return MRInput.createConfigBuilder(conf, inputFormat).setInputClassName(MRInputLegacy.class.getName());
}
/**
- * Create an {@link MRInputConfigurer} for a FileInputFormat
+ * Create an {@link org.apache.tez.mapreduce.input.MRInput.MRInputConfigBuilder} for a FileInputFormat
* @param conf Configuration for the {@link MRInputLegacy}
* @param inputFormat FileInputFormat derived class
* @param inputPaths Comma separated input paths
- * @return {@link MRInputConfigurer}
+ * @return {@link org.apache.tez.mapreduce.input.MRInput.MRInputConfigBuilder}
*/
- public static MRInputConfigurer createConfigurer(Configuration conf, Class<?> inputFormat,
- String inputPaths) {
- return MRInput.createConfigurer(conf, inputFormat, inputPaths).setInputClassName(
+ public static MRInputConfigBuilder createConfigBuilder(Configuration conf, Class<?> inputFormat,
+ String inputPaths) {
+ return MRInput.createConfigBuilder(conf, inputFormat, inputPaths).setInputClassName(
MRInputLegacy.class.getName());
}
http://git-wip-us.apache.org/repos/asf/tez/blob/b526ed5c/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/output/MROutput.java
----------------------------------------------------------------------
diff --git a/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/output/MROutput.java b/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/output/MROutput.java
index d51a8cc..a745a7f 100644
--- a/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/output/MROutput.java
+++ b/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/output/MROutput.java
@@ -82,7 +82,7 @@ public class MROutput extends AbstractLogicalOutput {
* Helper class to configure {@link MROutput}
*
*/
- public static class MROutputConfigurer {
+ public static class MROutputConfigBuilder {
final Configuration conf;
final Class<?> outputFormat;
final boolean outputFormatProvided;
@@ -92,7 +92,7 @@ public class MROutput extends AbstractLogicalOutput {
String outputPath;
boolean doCommit = true;
- private MROutputConfigurer(Configuration conf, Class<?> outputFormat) {
+ private MROutputConfigBuilder(Configuration conf, Class<?> outputFormat) {
this.conf = conf;
if (outputFormat != null) {
outputFormatProvided = true;
@@ -119,13 +119,13 @@ public class MROutput extends AbstractLogicalOutput {
}
}
- private MROutputConfigurer setOutputPath(String outputPath) {
+ private MROutputConfigBuilder setOutputPath(String outputPath) {
if (!(org.apache.hadoop.mapreduce.lib.output.FileOutputFormat.class.isAssignableFrom(outputFormat) ||
FileOutputFormat.class.isAssignableFrom(outputFormat))) {
throw new TezUncheckedException("When setting outputPath the outputFormat must " +
"be assignable from either org.apache.hadoop.mapred.FileOutputFormat or " +
"org.apache.hadoop.mapreduce.lib.output.FileOutputFormat. " +
- "Otherwise use the non-path configurer." +
+ "Otherwise use the non-path config builder." +
" Given: " + outputFormat.getName());
}
conf.set(org.apache.hadoop.mapreduce.lib.output.FileOutputFormat.OUTDIR, outputPath);
@@ -146,7 +146,7 @@ public class MROutput extends AbstractLogicalOutput {
* Create the {@link DataSinkDescriptor}
* @return {@link DataSinkDescriptor}
*/
- public DataSinkDescriptor create() {
+ public DataSinkDescriptor build() {
if (org.apache.hadoop.mapreduce.lib.output.FileOutputFormat.class
.isAssignableFrom(outputFormat) ||
FileOutputFormat.class.isAssignableFrom(outputFormat)) {
@@ -183,9 +183,9 @@ public class MROutput extends AbstractLogicalOutput {
* Use the method to turn this off when not using a {@link FileSystem}
* or when {@link Credentials} are not supported
* @param value whether to get credentials or not. (true by default)
- * @return {@link MROutputConfigurer}
+ * @return {@link org.apache.tez.mapreduce.output.MROutput.MROutputConfigBuilder}
*/
- public MROutputConfigurer getCredentialsForSinkFileSystem(boolean value) {
+ public MROutputConfigBuilder getCredentialsForSinkFileSystem(boolean value) {
getCredentialsForSinkFilesystem = value;
return this;
}
@@ -195,12 +195,12 @@ public class MROutput extends AbstractLogicalOutput {
* If the value is set to false then no {@link org.apache.tez.runtime.api.OutputCommitter} will
* be specified for the output
*/
- public MROutputConfigurer setDoCommit(boolean value) {
+ public MROutputConfigBuilder setDoCommit(boolean value) {
doCommit = value;
return this;
}
- MROutputConfigurer setOutputClassName(String outputClassName) {
+ MROutputConfigBuilder setOutputClassName(String outputClassName) {
this.outputClassName = outputClassName;
return this;
}
@@ -227,7 +227,7 @@ public class MROutput extends AbstractLogicalOutput {
}
/**
- * Create an {@link MROutputConfigurer} </p>
+ * Create an {@link org.apache.tez.mapreduce.output.MROutput.MROutputConfigBuilder} </p>
* <p/>
* The preferred usage model is to provide all of the parameters, and use methods to configure
* the Output.
@@ -239,14 +239,15 @@ public class MROutput extends AbstractLogicalOutput {
* modified in place
* @param outputFormat OutputFormat derived class. If the OutputFormat specified is
* null, the provided configuration should be complete.
- * @return {@link MROutputConfigurer}
+ * @return {@link org.apache.tez.mapreduce.output.MROutput.MROutputConfigBuilder}
*/
- public static MROutputConfigurer createConfigurer(Configuration conf, @Nullable Class<?> outputFormat) {
- return new MROutputConfigurer(conf, outputFormat);
+ public static MROutputConfigBuilder createConfigBuilder(Configuration conf,
+ @Nullable Class<?> outputFormat) {
+ return new MROutputConfigBuilder(conf, outputFormat);
}
/**
- * Create an {@link MROutputConfigurer} for a {@link org.apache.hadoop.mapreduce.lib.output.FileOutputFormat}
+ * Create an {@link org.apache.tez.mapreduce.output.MROutput.MROutputConfigBuilder} for a {@link org.apache.hadoop.mapreduce.lib.output.FileOutputFormat}
* or {@link org.apache.hadoop.mapred.FileOutputFormat} based OutputFormats.
* <p/>
* The preferred usage model is to provide all of the parameters, and use methods to configure the
@@ -260,11 +261,12 @@ public class MROutput extends AbstractLogicalOutput {
* @param outputFormat FileInputFormat derived class. If the InputFormat specified is
* null, the provided configuration should be complete.
* @param outputPath Output path. This can be null if already setup in the configuration
- * @return {@link MROutputConfigurer}
+ * @return {@link org.apache.tez.mapreduce.output.MROutput.MROutputConfigBuilder}
*/
- public static MROutputConfigurer createConfigurer(Configuration conf, @Nullable Class<?> outputFormat,
- @Nullable String outputPath) {
- MROutputConfigurer configurer = new MROutputConfigurer(conf, outputFormat);
+ public static MROutputConfigBuilder createConfigBuilder(Configuration conf,
+ @Nullable Class<?> outputFormat,
+ @Nullable String outputPath) {
+ MROutputConfigBuilder configurer = new MROutputConfigBuilder(conf, outputFormat);
if (outputPath != null) {
configurer.setOutputPath(outputPath);
}
http://git-wip-us.apache.org/repos/asf/tez/blob/b526ed5c/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/output/MROutputLegacy.java
----------------------------------------------------------------------
diff --git a/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/output/MROutputLegacy.java b/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/output/MROutputLegacy.java
index 768680e..cac13d9 100644
--- a/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/output/MROutputLegacy.java
+++ b/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/output/MROutputLegacy.java
@@ -27,28 +27,28 @@ import org.apache.tez.runtime.api.OutputContext;
public class MROutputLegacy extends MROutput {
/**
- * Create an {@link MROutputConfigurer}
+ * Create an {@link org.apache.tez.mapreduce.output.MROutput.MROutputConfigBuilder}
*
* @param conf Configuration for the {@link MROutput}
* @param outputFormat OutputFormat derived class
- * @return {@link MROutputConfigurer}
+ * @return {@link org.apache.tez.mapreduce.output.MROutput.MROutputConfigBuilder}
*/
- public static MROutputConfigurer createConfigurer(Configuration conf, Class<?> outputFormat) {
- return MROutput.createConfigurer(conf, outputFormat)
+ public static MROutputConfigBuilder createConfigBuilder(Configuration conf, Class<?> outputFormat) {
+ return MROutput.createConfigBuilder(conf, outputFormat)
.setOutputClassName(MROutputLegacy.class.getName());
}
/**
- * Create an {@link MROutputConfigurer} for a FileOutputFormat
+ * Create an {@link org.apache.tez.mapreduce.output.MROutput.MROutputConfigBuilder} for a FileOutputFormat
*
* @param conf Configuration for the {@link MROutput}
* @param outputFormat FileInputFormat derived class
* @param outputPath Output path
- * @return {@link MROutputConfigurer}
+ * @return {@link org.apache.tez.mapreduce.output.MROutput.MROutputConfigBuilder}
*/
- public static MROutputConfigurer createConfigurer(Configuration conf, Class<?> outputFormat,
- String outputPath) {
- return MROutput.createConfigurer(conf, outputFormat, outputPath)
+ public static MROutputConfigBuilder createConfigBuilder(Configuration conf, Class<?> outputFormat,
+ String outputPath) {
+ return MROutput.createConfigBuilder(conf, outputFormat, outputPath)
.setOutputClassName(MROutputLegacy.class.getName());
}
http://git-wip-us.apache.org/repos/asf/tez/blob/b526ed5c/tez-mapreduce/src/test/java/org/apache/hadoop/mapred/split/TestGroupedSplits.java
----------------------------------------------------------------------
diff --git a/tez-mapreduce/src/test/java/org/apache/hadoop/mapred/split/TestGroupedSplits.java b/tez-mapreduce/src/test/java/org/apache/hadoop/mapred/split/TestGroupedSplits.java
index 6624f4e..355d1ea 100644
--- a/tez-mapreduce/src/test/java/org/apache/hadoop/mapred/split/TestGroupedSplits.java
+++ b/tez-mapreduce/src/test/java/org/apache/hadoop/mapred/split/TestGroupedSplits.java
@@ -299,7 +299,7 @@ public class TestGroupedSplits {
format.setConf(job);
format.setInputFormat(mockWrappedFormat);
- job = (JobConf) TezMapReduceSplitsGrouper.createConfigurer(job)
+ job = (JobConf) TezMapReduceSplitsGrouper.createConfigBuilder(job)
.setGroupingSplitSize(50*1000*1000l, 500*1000*1000l)
.build();
InputSplit mockSplit1 = mock(InputSplit.class);
http://git-wip-us.apache.org/repos/asf/tez/blob/b526ed5c/tez-runtime-library/src/main/java/org/apache/tez/dag/library/vertexmanager/ShuffleVertexManager.java
----------------------------------------------------------------------
diff --git a/tez-runtime-library/src/main/java/org/apache/tez/dag/library/vertexmanager/ShuffleVertexManager.java b/tez-runtime-library/src/main/java/org/apache/tez/dag/library/vertexmanager/ShuffleVertexManager.java
index afa832e..d98362c 100644
--- a/tez-runtime-library/src/main/java/org/apache/tez/dag/library/vertexmanager/ShuffleVertexManager.java
+++ b/tez-runtime-library/src/main/java/org/apache/tez/dag/library/vertexmanager/ShuffleVertexManager.java
@@ -611,19 +611,19 @@ public class ShuffleVertexManager extends VertexManagerPlugin {
* then pass in a {@link Configuration} that is initialized from a
* config file. The parameters that are not overridden in code will
* be derived from the Configuration object.
- * @return {@link ShuffleVertexManagerConfigurer}
+ * @return {@link org.apache.tez.dag.library.vertexmanager.ShuffleVertexManager.ShuffleVertexManagerConfigBuilder}
*/
- public static ShuffleVertexManagerConfigurer createConfigurer(@Nullable Configuration conf) {
- return new ShuffleVertexManagerConfigurer(conf);
+ public static ShuffleVertexManagerConfigBuilder createConfigBuilder(@Nullable Configuration conf) {
+ return new ShuffleVertexManagerConfigBuilder(conf);
}
/**
* Helper class to configure ShuffleVertexManager
*/
- public static final class ShuffleVertexManagerConfigurer {
+ public static final class ShuffleVertexManagerConfigBuilder {
private final Configuration conf;
- private ShuffleVertexManagerConfigurer(@Nullable Configuration conf) {
+ private ShuffleVertexManagerConfigBuilder(@Nullable Configuration conf) {
if (conf == null) {
this.conf = new Configuration(false);
} else {
@@ -631,28 +631,28 @@ public class ShuffleVertexManager extends VertexManagerPlugin {
}
}
- public ShuffleVertexManagerConfigurer setAutoReduceParallelism(boolean enabled) {
+ public ShuffleVertexManagerConfigBuilder setAutoReduceParallelism(boolean enabled) {
conf.setBoolean(ShuffleVertexManager.TEZ_SHUFFLE_VERTEX_MANAGER_ENABLE_AUTO_PARALLEL, enabled);
return this;
}
- public ShuffleVertexManagerConfigurer setSlowStartMinSrcCompletionFraction(float minFraction) {
+ public ShuffleVertexManagerConfigBuilder setSlowStartMinSrcCompletionFraction(float minFraction) {
conf.setFloat(ShuffleVertexManager.TEZ_SHUFFLE_VERTEX_MANAGER_MAX_SRC_FRACTION, minFraction);
return this;
}
- public ShuffleVertexManagerConfigurer setSlowStartMaxSrcCompletionFraction(float maxFraction) {
+ public ShuffleVertexManagerConfigBuilder setSlowStartMaxSrcCompletionFraction(float maxFraction) {
conf.setFloat(ShuffleVertexManager.TEZ_SHUFFLE_VERTEX_MANAGER_MAX_SRC_FRACTION, maxFraction);
return this;
}
- public ShuffleVertexManagerConfigurer setDesiredTaskInputSize(long desiredTaskInputSize) {
+ public ShuffleVertexManagerConfigBuilder setDesiredTaskInputSize(long desiredTaskInputSize) {
conf.setLong(ShuffleVertexManager.TEZ_SHUFFLE_VERTEX_MANAGER_DESIRED_TASK_INPUT_SIZE,
desiredTaskInputSize);
return this;
}
- public ShuffleVertexManagerConfigurer setMinTaskParallelism(int minTaskParallelism) {
+ public ShuffleVertexManagerConfigBuilder setMinTaskParallelism(int minTaskParallelism) {
conf.setInt(ShuffleVertexManager.TEZ_SHUFFLE_VERTEX_MANAGER_MIN_TASK_PARALLELISM,
minTaskParallelism);
return this;
http://git-wip-us.apache.org/repos/asf/tez/blob/b526ed5c/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/common/serializer/TezBytesWritableSerialization.java
----------------------------------------------------------------------
diff --git a/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/common/serializer/TezBytesWritableSerialization.java b/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/common/serializer/TezBytesWritableSerialization.java
index 8ce6794..aabab76 100644
--- a/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/common/serializer/TezBytesWritableSerialization.java
+++ b/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/common/serializer/TezBytesWritableSerialization.java
@@ -45,11 +45,11 @@ import java.io.OutputStream;
* spill, merge.
*
* Usage e.g:
- * OrderedPartitionedKVEdgeConfigurer edgeConf = OrderedPartitionedKVEdgeConfigurer
+ * OrderedPartitionedKVEdgeConfig edgeConf = OrderedPartitionedKVEdgeConfig
* .newBuilder(keyClass, valClass, MRPartitioner.class.getName(), partitionerConf)
* .setFromConfiguration(conf)
* .setKeySerializationClass(TezBytesWritableSerialization.class.getName(),
- * TezBytesComparator.class.getName()))
+ * TezBytesComparator.class.getName()).build())
* </pre>
*/
@Public
http://git-wip-us.apache.org/repos/asf/tez/blob/b526ed5c/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/conf/BaseConfigBuilder.java
----------------------------------------------------------------------
diff --git a/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/conf/BaseConfigBuilder.java b/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/conf/BaseConfigBuilder.java
new file mode 100644
index 0000000..c172804
--- /dev/null
+++ b/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/conf/BaseConfigBuilder.java
@@ -0,0 +1,62 @@
+/*
+ * *
+ * * Licensed to the Apache Software Foundation (ASF) under one
+ * * or more contributor license agreements. See the NOTICE file
+ * * distributed with this work for additional information
+ * * regarding copyright ownership. The ASF licenses this file
+ * * to you under the Apache License, Version 2.0 (the
+ * * "License"); you may not use this file except in compliance
+ * * with the License. You may obtain a copy of the License at
+ * *
+ * * http://www.apache.org/licenses/LICENSE-2.0
+ * *
+ * * Unless required by applicable law or agreed to in writing, software
+ * * distributed under the License is distributed on an "AS IS" BASIS,
+ * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * * See the License for the specific language governing permissions and
+ * * limitations under the License.
+ *
+ */
+
+package org.apache.tez.runtime.library.conf;
+
+import java.util.Map;
+
+import org.apache.hadoop.classification.InterfaceAudience;
+import org.apache.hadoop.conf.Configuration;
+
+@InterfaceAudience.Private
+interface BaseConfigBuilder<T> {
+ /**
+ * Used to set additional configuration parameters which are not set via API methods. This is
+ * primarily meant for rarely used configuration options such as IFile read-ahead, configuring
+ * the number of parallel files to merge etc.
+ *
+ * @param key the key to set
+ * @param value the corresponding value
+ * @return
+ */
+ public T setAdditionalConfiguration(String key, String value);
+
+ /**
+ * Used to set additional configuration parameters which are not set via API methods. This is
+ * primarily meant for rarely used configuration options such as IFile read-ahead, configuring
+ * the number of parallel files to merge etc. </p> Additionally keys set via this method are
+ * made available to the combiner.
+ *
+ * @param confMap map of configuration key-value pairs
+ * @return
+ */
+ public T setAdditionalConfiguration(Map<String, String> confMap);
+
+ /**
+ * Used to build out a configuration from an existing Hadoop {@link
+ * org.apache.hadoop.conf.Configuration}. This is a private API is present only for
+ * compatibility and ease of use for existing systems which rely heavily on Configuration.
+ *
+ * @param conf
+ * @return
+ */
+ @InterfaceAudience.LimitedPrivate({"hive, pig"})
+ public T setFromConfiguration(Configuration conf);
+}
http://git-wip-us.apache.org/repos/asf/tez/blob/b526ed5c/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/conf/BaseConfigurer.java
----------------------------------------------------------------------
diff --git a/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/conf/BaseConfigurer.java b/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/conf/BaseConfigurer.java
deleted file mode 100644
index c2bc69b..0000000
--- a/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/conf/BaseConfigurer.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * *
- * * Licensed to the Apache Software Foundation (ASF) under one
- * * or more contributor license agreements. See the NOTICE file
- * * distributed with this work for additional information
- * * regarding copyright ownership. The ASF licenses this file
- * * to you under the Apache License, Version 2.0 (the
- * * "License"); you may not use this file except in compliance
- * * with the License. You may obtain a copy of the License at
- * *
- * * http://www.apache.org/licenses/LICENSE-2.0
- * *
- * * Unless required by applicable law or agreed to in writing, software
- * * distributed under the License is distributed on an "AS IS" BASIS,
- * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * * See the License for the specific language governing permissions and
- * * limitations under the License.
- *
- */
-
-package org.apache.tez.runtime.library.conf;
-
-import java.util.Map;
-
-import org.apache.hadoop.classification.InterfaceAudience;
-import org.apache.hadoop.conf.Configuration;
-
-@InterfaceAudience.Private
-interface BaseConfigurer<T> {
- /**
- * Used to set additional configuration parameters which are not set via API methods. This is
- * primarily meant for rarely used configuration options such as IFile read-ahead, configuring
- * the number of parallel files to merge etc.
- *
- * @param key the key to set
- * @param value the corresponding value
- * @return
- */
- public T setAdditionalConfiguration(String key, String value);
-
- /**
- * Used to set additional configuration parameters which are not set via API methods. This is
- * primarily meant for rarely used configuration options such as IFile read-ahead, configuring
- * the number of parallel files to merge etc. </p> Additionally keys set via this method are
- * made available to the combiner.
- *
- * @param confMap map of configuration key-value pairs
- * @return
- */
- public T setAdditionalConfiguration(Map<String, String> confMap);
-
- /**
- * Used to build out a configuration from an existing Hadoop {@link
- * org.apache.hadoop.conf.Configuration}. This is a private API is present only for
- * compatibility and ease of use for existing systems which rely heavily on Configuration.
- *
- * @param conf
- * @return
- */
- @InterfaceAudience.LimitedPrivate({"hive, pig"})
- public T setFromConfiguration(Configuration conf);
-}
http://git-wip-us.apache.org/repos/asf/tez/blob/b526ed5c/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/conf/HadoopKeyValuesBasedBaseEdgeConfig.java
----------------------------------------------------------------------
diff --git a/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/conf/HadoopKeyValuesBasedBaseEdgeConfig.java b/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/conf/HadoopKeyValuesBasedBaseEdgeConfig.java
new file mode 100644
index 0000000..31eb686
--- /dev/null
+++ b/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/conf/HadoopKeyValuesBasedBaseEdgeConfig.java
@@ -0,0 +1,73 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.tez.runtime.library.conf;
+
+import javax.annotation.Nullable;
+
+import java.util.Map;
+
+import org.apache.hadoop.classification.InterfaceAudience;
+import org.apache.tez.dag.api.UserPayload;
+
+@InterfaceAudience.Private
+abstract class HadoopKeyValuesBasedBaseEdgeConfig {
+
+ /**
+ * Get the payload for the configured Output
+ * @return output configuration as a byte array
+ */
+ public abstract UserPayload getOutputPayload();
+
+ /**
+ * Get the output class name
+ * @return the output class name
+ */
+ public abstract String getOutputClassName();
+
+ /**
+ * Get the payload for the configured Input
+ * @return input configuration as a byte array
+ */
+ public abstract UserPayload getInputPayload();
+
+ /**
+ * Get the input class name
+ * @return the input class name
+ */
+ public abstract String getInputClassName();
+
+ public abstract static class Builder<T extends Builder<T>> implements BaseConfigBuilder<T> {
+
+ /**
+ * Enable compression for the specific Input / Output / Edge
+ *
+ * @param enabled whether to enable compression or not
+ * @param compressionCodec the codec to be used if compression is enabled. null implies using
+ * the default
+ * @param codecConf the codec configuration. This can be null, and is a {@link
+ * java.util.Map} of key-value pairs. The keys should be limited to
+ * the ones required by the comparator.
+ * @return instance of the current builder
+ */
+ public abstract T setCompression(boolean enabled, @Nullable String compressionCodec,
+ @Nullable Map<String, String> codecConf);
+
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/tez/blob/b526ed5c/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/conf/HadoopKeyValuesBasedBaseEdgeConfigurer.java
----------------------------------------------------------------------
diff --git a/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/conf/HadoopKeyValuesBasedBaseEdgeConfigurer.java b/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/conf/HadoopKeyValuesBasedBaseEdgeConfigurer.java
deleted file mode 100644
index 15be335..0000000
--- a/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/conf/HadoopKeyValuesBasedBaseEdgeConfigurer.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.tez.runtime.library.conf;
-
-import javax.annotation.Nullable;
-
-import java.util.Map;
-
-import org.apache.hadoop.classification.InterfaceAudience;
-import org.apache.tez.dag.api.UserPayload;
-
-@InterfaceAudience.Private
-abstract class HadoopKeyValuesBasedBaseEdgeConfigurer {
-
- /**
- * Get the payload for the configured Output
- * @return output configuration as a byte array
- */
- public abstract UserPayload getOutputPayload();
-
- /**
- * Get the output class name
- * @return the output class name
- */
- public abstract String getOutputClassName();
-
- /**
- * Get the payload for the configured Input
- * @return input configuration as a byte array
- */
- public abstract UserPayload getInputPayload();
-
- /**
- * Get the input class name
- * @return the input class name
- */
- public abstract String getInputClassName();
-
- public abstract static class Builder<T extends Builder<T>> implements BaseConfigurer<T> {
-
- /**
- * Enable compression for the specific Input / Output / Edge
- *
- * @param enabled whether to enable compression or not
- * @param compressionCodec the codec to be used if compression is enabled. null implies using
- * the default
- * @param codecConf the codec configuration. This can be null, and is a {@link
- * java.util.Map} of key-value pairs. The keys should be limited to
- * the ones required by the comparator.
- * @return instance of the current builder
- */
- public abstract T setCompression(boolean enabled, @Nullable String compressionCodec,
- @Nullable Map<String, String> codecConf);
-
- }
-
-}