Author: cdouglas
Date: Mon Feb 11 16:34:43 2008
New Revision: 620680
URL: http://svn.apache.org/viewvc?rev=620680&view=rev
Log:
HADOOP-2733. Fix compiler warnings in test code.
Contributed by Tsz Wo (Nicholas), SZE
Modified:
hadoop/core/branches/branch-0.16/CHANGES.txt
hadoop/core/branches/branch-0.16/src/test/org/apache/hadoop/mapred/TestClusterMapReduceTestCase.java
hadoop/core/branches/branch-0.16/src/test/org/apache/hadoop/mapred/TestJobStatusPersistency.java
Modified: hadoop/core/branches/branch-0.16/CHANGES.txt
URL:
http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.16/CHANGES.txt?rev=620680&r1=620679&r2=620680&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.16/CHANGES.txt (original)
+++ hadoop/core/branches/branch-0.16/CHANGES.txt Mon Feb 11 16:34:43 2008
@@ -28,6 +28,9 @@
HADOOP-2754. Filter out .crc files from local file system listing.
(Hairong Kuang via cdouglas)
+ HADOOP-2733. Fix compiler warnings in test code.
+ (Tsz Wo (Nicholas), SZE via cdouglas)
+
Release 0.16.0 - 2008-02-07
INCOMPATIBLE CHANGES
Modified:
hadoop/core/branches/branch-0.16/src/test/org/apache/hadoop/mapred/TestClusterMapReduceTestCase.java
URL:
http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.16/src/test/org/apache/hadoop/mapred/TestClusterMapReduceTestCase.java?rev=620680&r1=620679&r2=620680&view=diff
==============================================================================
---
hadoop/core/branches/branch-0.16/src/test/org/apache/hadoop/mapred/TestClusterMapReduceTestCase.java
(original)
+++
hadoop/core/branches/branch-0.16/src/test/org/apache/hadoop/mapred/TestClusterMapReduceTestCase.java
Mon Feb 11 16:34:43 2008
@@ -17,51 +17,14 @@
*/
package org.apache.hadoop.mapred;
-import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
-import org.apache.hadoop.io.Writable;
-import org.apache.hadoop.io.WritableComparable;
import java.io.*;
-import java.util.Iterator;
import java.util.Properties;
public class TestClusterMapReduceTestCase extends ClusterMapReduceTestCase {
-
- public static class EchoMap implements Mapper {
-
- public void configure(JobConf conf) {
- }
-
- public void close() {
- }
-
- public void map(WritableComparable key, Writable value,
- OutputCollector collector, Reporter reporter) throws
IOException {
- collector.collect(key, value);
- }
- }
-
- public static class EchoReduce implements Reducer {
-
- public void configure(JobConf conf) {
- }
-
- public void close() {
- }
-
- public void reduce(WritableComparable key, Iterator values,
- OutputCollector collector, Reporter reporter) throws
IOException {
- while (values.hasNext()) {
- Writable value = (Writable) values.next();
- collector.collect(key, value);
- }
- }
-
- }
-
public void _testMapReduce(boolean restart) throws Exception {
OutputStream os = getFileSystem().create(new Path(getInputDir(),
"text.txt"));
Writer wr = new OutputStreamWriter(os);
@@ -88,8 +51,8 @@
conf.setOutputKeyClass(LongWritable.class);
conf.setOutputValueClass(Text.class);
- conf.setMapperClass(TestClusterMapReduceTestCase.EchoMap.class);
- conf.setReducerClass(TestClusterMapReduceTestCase.EchoReduce.class);
+ conf.setMapperClass(org.apache.hadoop.mapred.lib.IdentityMapper.class);
+ conf.setReducerClass(org.apache.hadoop.mapred.lib.IdentityReducer.class);
conf.setInputPath(getInputDir());
Modified:
hadoop/core/branches/branch-0.16/src/test/org/apache/hadoop/mapred/TestJobStatusPersistency.java
URL:
http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.16/src/test/org/apache/hadoop/mapred/TestJobStatusPersistency.java?rev=620680&r1=620679&r2=620680&view=diff
==============================================================================
---
hadoop/core/branches/branch-0.16/src/test/org/apache/hadoop/mapred/TestJobStatusPersistency.java
(original)
+++
hadoop/core/branches/branch-0.16/src/test/org/apache/hadoop/mapred/TestJobStatusPersistency.java
Mon Feb 11 16:34:43 2008
@@ -17,51 +17,14 @@
*/
package org.apache.hadoop.mapred;
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.io.WritableComparable;
-import org.apache.hadoop.io.Writable;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.fs.Path;
import java.io.*;
-import java.util.Iterator;
import java.util.Properties;
public class TestJobStatusPersistency extends ClusterMapReduceTestCase {
-
- public static class EchoMap implements Mapper {
-
- public void configure(JobConf conf) {
- }
-
- public void close() {
- }
-
- public void map(WritableComparable key, Writable value,
- OutputCollector collector, Reporter reporter) throws
IOException {
- collector.collect(key, value);
- }
- }
-
- public static class EchoReduce implements Reducer {
-
- public void configure(JobConf conf) {
- }
-
- public void close() {
- }
-
- public void reduce(WritableComparable key, Iterator values,
- OutputCollector collector, Reporter reporter) throws
IOException {
- while (values.hasNext()) {
- Writable value = (Writable) values.next();
- collector.collect(key, value);
- }
- }
-
- }
-
private String runJob() throws Exception {
OutputStream os = getFileSystem().create(new Path(getInputDir(),
"text.txt"));
Writer wr = new OutputStreamWriter(os);
@@ -83,8 +46,8 @@
conf.setOutputKeyClass(LongWritable.class);
conf.setOutputValueClass(Text.class);
- conf.setMapperClass(TestJobStatusPersistency.EchoMap.class);
- conf.setReducerClass(TestJobStatusPersistency.EchoReduce.class);
+ conf.setMapperClass(org.apache.hadoop.mapred.lib.IdentityMapper.class);
+ conf.setReducerClass(org.apache.hadoop.mapred.lib.IdentityReducer.class);
conf.setInputPath(getInputDir());