hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cdoug...@apache.org
Subject svn commit: r653544 - in /hadoop/core/trunk: CHANGES.txt src/test/org/apache/hadoop/mapred/EmptyInputFormat.java src/test/org/apache/hadoop/mapred/TestReduceTask.java
Date Mon, 05 May 2008 18:04:33 GMT
Author: cdouglas
Date: Mon May  5 11:04:33 2008
New Revision: 653544

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


Modified:
    hadoop/core/trunk/CHANGES.txt
    hadoop/core/trunk/src/test/org/apache/hadoop/mapred/EmptyInputFormat.java
    hadoop/core/trunk/src/test/org/apache/hadoop/mapred/TestReduceTask.java

Modified: hadoop/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/CHANGES.txt?rev=653544&r1=653543&r2=653544&view=diff
==============================================================================
--- hadoop/core/trunk/CHANGES.txt (original)
+++ hadoop/core/trunk/CHANGES.txt Mon May  5 11:04:33 2008
@@ -145,6 +145,8 @@
     HADOOP-3101. Prevent JobClient from throwing an exception when printing
     usage. (Edward J. Yoon via cdouglas)
 
+    HADOOP-3031. Fix javac warnings in test classes. (cdouglas)
+
 Release 0.17.0 - Unreleased
 
   INCOMPATIBLE CHANGES

Modified: hadoop/core/trunk/src/test/org/apache/hadoop/mapred/EmptyInputFormat.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/test/org/apache/hadoop/mapred/EmptyInputFormat.java?rev=653544&r1=653543&r2=653544&view=diff
==============================================================================
--- hadoop/core/trunk/src/test/org/apache/hadoop/mapred/EmptyInputFormat.java (original)
+++ hadoop/core/trunk/src/test/org/apache/hadoop/mapred/EmptyInputFormat.java Mon May  5 11:04:33
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/trunk/src/test/org/apache/hadoop/mapred/TestReduceTask.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/test/org/apache/hadoop/mapred/TestReduceTask.java?rev=653544&r1=653543&r2=653544&view=diff
==============================================================================
--- hadoop/core/trunk/src/test/org/apache/hadoop/mapred/TestReduceTask.java (original)
+++ hadoop/core/trunk/src/test/org/apache/hadoop/mapred/TestReduceTask.java Mon May  5 11:04:33
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