From 7297e82cb4ab1dff06da48acdb76e3d568f998f2 Mon Sep 17 00:00:00 2001 From: Chris Douglas Date: Thu, 30 Mar 2017 10:14:22 -0700 Subject: [PATCH] HADOOP-14250. Correct spelling of 'separate' and variants. Contributed by Doris Gu --- .../main/java/org/apache/hadoop/net/NodeBase.java | 2 +- .../java/org/apache/hadoop/util/StringUtils.java | 8 ++++---- .../apache/hadoop/fs/http/server/FSOperations.java | 2 +- .../hadoop/mapred/lib/FieldSelectionMapReduce.java | 2 +- .../hadoop/mapred/lib/KeyFieldBasedComparator.java | 2 +- .../org/apache/hadoop/mapreduce/MRJobConfig.java | 8 +++++++- .../lib/fieldsel/FieldSelectionHelper.java | 7 ++++++- .../lib/fieldsel/FieldSelectionMapper.java | 2 +- .../lib/fieldsel/FieldSelectionReducer.java | 2 +- .../lib/input/KeyValueLineRecordReader.java | 13 +++++++++---- .../mapreduce/lib/output/TextOutputFormat.java | 9 +++++++-- .../lib/partition/KeyFieldBasedComparator.java | 4 ++-- .../lib/partition/KeyFieldBasedPartitioner.java | 2 +- .../apache/hadoop/mapreduce/util/ConfigUtil.java | 8 ++++---- .../org/apache/hadoop/fs/slive/OperationOutput.java | 4 ++-- .../apache/hadoop/mapred/TestFieldSelection.java | 2 +- .../mapred/lib/TestKeyFieldBasedComparator.java | 4 ++-- .../lib/fieldsel/TestMRFieldSelection.java | 2 +- .../partition/TestMRKeyFieldBasedComparator.java | 4 ++-- .../apache/hadoop/yarn/conf/YarnConfiguration.java | 2 +- 20 files changed, 55 insertions(+), 34 deletions(-) diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/NodeBase.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/NodeBase.java index 7494adf74c..9da9ca2948 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/NodeBase.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/NodeBase.java @@ -45,7 +45,7 @@ public NodeBase() { /** Construct a node from its path * @param path - * a concatenation of this node's location, the path seperator, and its name + * a concatenation of this node's location, the path separator, and its name */ public NodeBase(String path) { path = normalize(path); diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/StringUtils.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/StringUtils.java index d2b572b707..e773806c65 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/StringUtils.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/StringUtils.java @@ -372,8 +372,8 @@ public static String getFormattedTimeWithDiff(String formattedFinishTime, /** * Returns an arraylist of strings. - * @param str the comma seperated string values - * @return the arraylist of the comma seperated string values + * @param str the comma separated string values + * @return the arraylist of the comma separated string values */ public static String[] getStrings(String str){ String delim = ","; @@ -384,7 +384,7 @@ public static String[] getStrings(String str){ * Returns an arraylist of strings. * @param str the string values * @param delim delimiter to separate the values - * @return the arraylist of the seperated string values + * @return the arraylist of the separated string values */ public static String[] getStrings(String str, String delim){ Collection values = getStringCollection(str, delim); @@ -396,7 +396,7 @@ public static String[] getStrings(String str, String delim){ /** * Returns a collection of strings. - * @param str comma seperated string values + * @param str comma separated string values * @return an ArrayList of string values */ public static Collection getStringCollection(String str){ diff --git a/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/fs/http/server/FSOperations.java b/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/fs/http/server/FSOperations.java index eec6981da0..5ff42a46d3 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/fs/http/server/FSOperations.java +++ b/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/fs/http/server/FSOperations.java @@ -358,7 +358,7 @@ public static class FSConcat implements FileSystemAccess.FileSystemExecutor { - public static final String KEY_VALUE_SEPERATOR = - "mapreduce.input.keyvaluelinerecordreader.key.value.separator"; - + public static final String KEY_VALUE_SEPARATOR = + "mapreduce.input.keyvaluelinerecordreader.key.value.separator"; + /** + * @deprecated Use {@link #KEY_VALUE_SEPARATOR} + */ + @Deprecated + public static final String KEY_VALUE_SEPERATOR = KEY_VALUE_SEPARATOR; + private final LineRecordReader lineRecordReader; private byte separator = (byte) '\t'; @@ -56,7 +61,7 @@ public KeyValueLineRecordReader(Configuration conf) throws IOException { lineRecordReader = new LineRecordReader(); - String sepStr = conf.get(KEY_VALUE_SEPERATOR, "\t"); + String sepStr = conf.get(KEY_VALUE_SEPARATOR, "\t"); this.separator = (byte) sepStr.charAt(0); } diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/lib/output/TextOutputFormat.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/lib/output/TextOutputFormat.java index 2e49f68eda..8b27223df0 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/lib/output/TextOutputFormat.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/lib/output/TextOutputFormat.java @@ -42,7 +42,12 @@ @InterfaceAudience.Public @InterfaceStability.Stable public class TextOutputFormat extends FileOutputFormat { - public static String SEPERATOR = "mapreduce.output.textoutputformat.separator"; + public static String SEPARATOR = "mapreduce.output.textoutputformat.separator"; + /** + * @deprecated Use {@link #SEPARATOR} + */ + @Deprecated + public static String SEPERATOR = SEPARATOR; protected static class LineRecordWriter extends RecordWriter { private static final byte[] NEWLINE = @@ -107,7 +112,7 @@ void close(TaskAttemptContext context) throws IOException { ) throws IOException, InterruptedException { Configuration conf = job.getConfiguration(); boolean isCompressed = getCompressOutput(job); - String keyValueSeparator= conf.get(SEPERATOR, "\t"); + String keyValueSeparator= conf.get(SEPARATOR, "\t"); CompressionCodec codec = null; String extension = ""; if (isCompressed) { diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/lib/partition/KeyFieldBasedComparator.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/lib/partition/KeyFieldBasedComparator.java index 4b4d0e9e08..416bc8c476 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/lib/partition/KeyFieldBasedComparator.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/lib/partition/KeyFieldBasedComparator.java @@ -46,7 +46,7 @@ * of the field); if omitted from pos2, it defaults to 0 (the end of the * field). opts are ordering options (any of 'nr' as described above). * We assume that the fields in the key are separated by - * {@link JobContext#MAP_OUTPUT_KEY_FIELD_SEPERATOR}. + * {@link JobContext#MAP_OUTPUT_KEY_FIELD_SEPARATOR}. */ @InterfaceAudience.Public @InterfaceStability.Stable @@ -62,7 +62,7 @@ public class KeyFieldBasedComparator extends WritableComparator public void setConf(Configuration conf) { this.conf = conf; String option = conf.get(COMPARATOR_OPTIONS); - String keyFieldSeparator = conf.get(MRJobConfig.MAP_OUTPUT_KEY_FIELD_SEPERATOR,"\t"); + String keyFieldSeparator = conf.get(MRJobConfig.MAP_OUTPUT_KEY_FIELD_SEPARATOR,"\t"); keyFieldHelper.setKeyFieldSeparator(keyFieldSeparator); keyFieldHelper.parseOption(option); } diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/lib/partition/KeyFieldBasedPartitioner.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/lib/partition/KeyFieldBasedPartitioner.java index 44cb624c5a..73f6a344ce 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/lib/partition/KeyFieldBasedPartitioner.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/lib/partition/KeyFieldBasedPartitioner.java @@ -65,7 +65,7 @@ public void setConf(Configuration conf) { this.conf = conf; keyFieldHelper = new KeyFieldHelper(); String keyFieldSeparator = - conf.get(MRJobConfig.MAP_OUTPUT_KEY_FIELD_SEPERATOR, "\t"); + conf.get(MRJobConfig.MAP_OUTPUT_KEY_FIELD_SEPARATOR, "\t"); keyFieldHelper.setKeyFieldSeparator(keyFieldSeparator); if (conf.get("num.key.fields.for.partition") != null) { LOG.warn("Using deprecated num.key.fields.for.partition. " + diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/util/ConfigUtil.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/util/ConfigUtil.java index d3f62e4c93..4b47379271 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/util/ConfigUtil.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/util/ConfigUtil.java @@ -290,7 +290,7 @@ private static void addDeprecatedKeys() { new DeprecationDelta("mapred.mapoutput.value.class", MRJobConfig.MAP_OUTPUT_VALUE_CLASS), new DeprecationDelta("map.output.key.field.separator", - MRJobConfig.MAP_OUTPUT_KEY_FIELD_SEPERATOR), + MRJobConfig.MAP_OUTPUT_KEY_FIELD_SEPARATOR), new DeprecationDelta("mapred.map.child.log.level", MRJobConfig.MAP_LOG_LEVEL), new DeprecationDelta("mapred.inmem.merge.threshold", @@ -412,7 +412,7 @@ private static void addDeprecatedKeys() { ControlledJob.CREATE_DIR), new DeprecationDelta("mapred.data.field.separator", org.apache.hadoop.mapreduce.lib.fieldsel. - FieldSelectionHelper.DATA_FIELD_SEPERATOR), + FieldSelectionHelper.DATA_FIELD_SEPARATOR), new DeprecationDelta("map.output.key.value.fields.spec", org.apache.hadoop.mapreduce.lib.fieldsel. FieldSelectionHelper.MAP_OUTPUT_KEY_VALUE_SPEC), @@ -427,7 +427,7 @@ private static void addDeprecatedKeys() { CombineFileInputFormat.SPLIT_MINSIZE_PERRACK), new DeprecationDelta("key.value.separator.in.input.line", org.apache.hadoop.mapreduce.lib.input. - KeyValueLineRecordReader.KEY_VALUE_SEPERATOR), + KeyValueLineRecordReader.KEY_VALUE_SEPARATOR), new DeprecationDelta("mapred.linerecordreader.maxlength", org.apache.hadoop.mapreduce.lib.input. LineRecordReader.MAX_LINE_LENGTH), @@ -436,7 +436,7 @@ private static void addDeprecatedKeys() { LazyOutputFormat.OUTPUT_FORMAT), new DeprecationDelta("mapred.textoutputformat.separator", org.apache.hadoop.mapreduce.lib.output. - TextOutputFormat.SEPERATOR), + TextOutputFormat.SEPARATOR), new DeprecationDelta("mapred.join.expr", org.apache.hadoop.mapreduce.lib.join. CompositeInputFormat.JOIN_EXPR), diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/slive/OperationOutput.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/slive/OperationOutput.java index bca5a1c777..02584f1950 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/slive/OperationOutput.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/slive/OperationOutput.java @@ -65,7 +65,7 @@ static enum OutputType { int place = key.indexOf(TYPE_SEP); if (place == -1) { throw new IllegalArgumentException( - "Invalid key format - no type seperator - " + TYPE_SEP); + "Invalid key format - no type separator - " + TYPE_SEP); } try { dataType = OutputType.valueOf( @@ -78,7 +78,7 @@ static enum OutputType { place = key.indexOf(MEASUREMENT_SEP); if (place == -1) { throw new IllegalArgumentException( - "Invalid key format - no measurement seperator - " + MEASUREMENT_SEP); + "Invalid key format - no measurement separator - " + MEASUREMENT_SEP); } opType = key.substring(0, place); measurementType = key.substring(place + 1); diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestFieldSelection.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestFieldSelection.java index 868896815e..4e14797a16 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestFieldSelection.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestFieldSelection.java @@ -77,7 +77,7 @@ public static void launch() throws Exception { job.setOutputFormat(TextOutputFormat.class); job.setNumReduceTasks(1); - job.set(FieldSelectionHelper.DATA_FIELD_SEPERATOR, "-"); + job.set(FieldSelectionHelper.DATA_FIELD_SEPARATOR, "-"); job.set(FieldSelectionHelper.MAP_OUTPUT_KEY_VALUE_SPEC, "6,5,1-3:0-"); job.set(FieldSelectionHelper.REDUCE_OUTPUT_KEY_VALUE_SPEC, ":4,3,2,1,0,0-"); diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/lib/TestKeyFieldBasedComparator.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/lib/TestKeyFieldBasedComparator.java index 35b3f243c7..3f31546c78 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/lib/TestKeyFieldBasedComparator.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/lib/TestKeyFieldBasedComparator.java @@ -63,7 +63,7 @@ public TestKeyFieldBasedComparator() throws IOException { super(HadoopTestCase.LOCAL_MR, HadoopTestCase.LOCAL_FS, 1, 1); conf = createJobConf(); localConf = createJobConf(); - localConf.set(JobContext.MAP_OUTPUT_KEY_FIELD_SEPERATOR, " "); + localConf.set(JobContext.MAP_OUTPUT_KEY_FIELD_SEPARATOR, " "); } public void configure(String keySpec, int expect) throws Exception { @@ -85,7 +85,7 @@ public void configure(String keySpec, int expect) throws Exception { conf.setOutputKeyComparatorClass(KeyFieldBasedComparator.class); conf.setKeyFieldComparatorOptions(keySpec); conf.setKeyFieldPartitionerOptions("-k1.1,1.1"); - conf.set(JobContext.MAP_OUTPUT_KEY_FIELD_SEPERATOR, " "); + conf.set(JobContext.MAP_OUTPUT_KEY_FIELD_SEPARATOR, " "); conf.setMapperClass(InverseMapper.class); conf.setReducerClass(IdentityReducer.class); if (!fs.mkdirs(testdir)) { diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/lib/fieldsel/TestMRFieldSelection.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/lib/fieldsel/TestMRFieldSelection.java index 6f9183ab21..26cc328bc9 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/lib/fieldsel/TestMRFieldSelection.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/lib/fieldsel/TestMRFieldSelection.java @@ -57,7 +57,7 @@ public static void launch() throws Exception { StringBuffer expectedOutput = new StringBuffer(); constructInputOutputData(inputData, expectedOutput, numOfInputLines); - conf.set(FieldSelectionHelper.DATA_FIELD_SEPERATOR, "-"); + conf.set(FieldSelectionHelper.DATA_FIELD_SEPARATOR, "-"); conf.set(FieldSelectionHelper.MAP_OUTPUT_KEY_VALUE_SPEC, "6,5,1-3:0-"); conf.set( FieldSelectionHelper.REDUCE_OUTPUT_KEY_VALUE_SPEC, ":4,3,2,1,0,0-"); diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/lib/partition/TestMRKeyFieldBasedComparator.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/lib/partition/TestMRKeyFieldBasedComparator.java index 0d75d2fe9e..889137c20e 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/lib/partition/TestMRKeyFieldBasedComparator.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/lib/partition/TestMRKeyFieldBasedComparator.java @@ -50,7 +50,7 @@ public class TestMRKeyFieldBasedComparator extends HadoopTestCase { public TestMRKeyFieldBasedComparator() throws IOException { super(HadoopTestCase.LOCAL_MR, HadoopTestCase.LOCAL_FS, 1, 1); conf = createJobConf(); - conf.set(MRJobConfig.MAP_OUTPUT_KEY_FIELD_SEPERATOR, " "); + conf.set(MRJobConfig.MAP_OUTPUT_KEY_FIELD_SEPARATOR, " "); } private void testComparator(String keySpec, int expect) @@ -61,7 +61,7 @@ private void testComparator(String keySpec, int expect) conf.set("mapreduce.partition.keycomparator.options", keySpec); conf.set("mapreduce.partition.keypartitioner.options", "-k1.1,1.1"); - conf.set(MRJobConfig.MAP_OUTPUT_KEY_FIELD_SEPERATOR, " "); + conf.set(MRJobConfig.MAP_OUTPUT_KEY_FIELD_SEPARATOR, " "); Job job = MapReduceTestUtil.createJob(conf, inDir, outDir, 1, 1, line1 +"\n" + line2 + "\n"); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/conf/YarnConfiguration.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/conf/YarnConfiguration.java index f52e487524..c2392499f7 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/conf/YarnConfiguration.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/conf/YarnConfiguration.java @@ -1897,7 +1897,7 @@ public static boolean isAclEnabled(Configuration conf) { public static final float DEFAULT_TIMELINE_SERVICE_VERSION = 1.0f; /** - * Comma seperated list of names for UIs hosted in the timeline server + * Comma separated list of names for UIs hosted in the timeline server * (For pluggable UIs). */ public static final String TIMELINE_SERVICE_UI_NAMES =