hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cdoug...@apache.org
Subject svn commit: r655591 - in /hadoop/core/branches/branch-0.17: CHANGES.txt src/test/org/apache/hadoop/mapred/EmptyInputFormat.java src/test/org/apache/hadoop/mapred/TestReduceTask.java
Date Mon, 12 May 2008 18:31:53 GMT
Author: cdouglas
Date: Mon May 12 11:31:52 2008
New Revision: 655591

URL: http://svn.apache.org/viewvc?rev=655591&view=rev
Log:
HADOOP-3031. Fix javac warnings in test classes.



Modified:
    hadoop/core/branches/branch-0.17/CHANGES.txt
    hadoop/core/branches/branch-0.17/src/test/org/apache/hadoop/mapred/EmptyInputFormat.java
    hadoop/core/branches/branch-0.17/src/test/org/apache/hadoop/mapred/TestReduceTask.java

Modified: hadoop/core/branches/branch-0.17/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.17/CHANGES.txt?rev=655591&r1=655590&r2=655591&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.17/CHANGES.txt (original)
+++ hadoop/core/branches/branch-0.17/CHANGES.txt Mon May 12 11:31:52 2008
@@ -582,6 +582,8 @@
     HADOOP-3372. Fix heap management in streaming tests. (Arun Murthy via
     cdouglas)
 
+    HADOOP-3031. Fix javac warnings in test classes. (cdouglas)
+
 Release 0.16.4 - 2008-05-05
 
   BUG FIXES

Modified: hadoop/core/branches/branch-0.17/src/test/org/apache/hadoop/mapred/EmptyInputFormat.java
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.17/src/test/org/apache/hadoop/mapred/EmptyInputFormat.java?rev=655591&r1=655590&r2=655591&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.17/src/test/org/apache/hadoop/mapred/EmptyInputFormat.java
(original)
+++ hadoop/core/branches/branch-0.17/src/test/org/apache/hadoop/mapred/EmptyInputFormat.java
Mon May 12 11:31:52 2008
@@ -25,13 +25,23 @@
   * InputFormat which simulates the absence of input data
   * by returning zero split.
   */
-public class EmptyInputFormat<K, V> extends FileInputFormat<K, V> {
+public class EmptyInputFormat<K, V> implements InputFormat<K, V> {
 
-  public FileSplit[] getSplits(FileSystem fs, JobConf job, int numSplits) throws IOException
{
-    return new FileSplit[0];
+  public void validateInput(JobConf job) { }
+
+  public InputSplit[] getSplits(JobConf job, int numSplits) throws IOException {
+    return new InputSplit[0];
   }
 
-  public RecordReader<K, V> getRecordReader(InputSplit split, JobConf job, Reporter
reporter) throws IOException {
-    return new SequenceFileRecordReader(job, (FileSplit) split);
+  public RecordReader<K, V> getRecordReader(InputSplit split, JobConf job,
+                              Reporter reporter) throws IOException {
+    return new RecordReader<K,V>() {
+      public boolean next(K key, V value) throws IOException { return false; }
+      public K createKey() { return null; }
+      public V createValue() { return null; }
+      public long getPos() throws IOException { return 0L; }
+      public void close() throws IOException { }
+      public float getProgress() throws IOException { return 0.0f; }
+    };
   }
 }

Modified: hadoop/core/branches/branch-0.17/src/test/org/apache/hadoop/mapred/TestReduceTask.java
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.17/src/test/org/apache/hadoop/mapred/TestReduceTask.java?rev=655591&r1=655590&r2=655591&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.17/src/test/org/apache/hadoop/mapred/TestReduceTask.java
(original)
+++ hadoop/core/branches/branch-0.17/src/test/org/apache/hadoop/mapred/TestReduceTask.java
Mon May 12 11:31:52 2008
@@ -87,10 +87,11 @@
                                                          Text.class, conf);
     SequenceFile.Sorter.RawKeyValueIterator rawItr = 
       sorter.merge(new Path[]{path}, false, tmpDir);
+    @SuppressWarnings("unchecked") // WritableComparators are not generic
     ReduceTask.ValuesIterator valItr = 
-      new ReduceTask.ValuesIterator(rawItr, WritableComparator.get(Text.class), 
-                                    Text.class, Text.class,
-                                    conf, new NullProgress());
+      new ReduceTask.ValuesIterator<Text,Text>(rawItr,
+          WritableComparator.get(Text.class), Text.class, Text.class,
+          conf, new NullProgress());
     int i = 0;
     while (valItr.more()) {
       Object key = valItr.getKey();



Mime
View raw message