title: Hadoop map reduce whole file input format
body: <p>I am trying to use the hadoop map reduce, but instead of mapping each line at a time in my Mapper, I would like to map a whole file at once.</p>
  
  <p>So I have found these two classes
  (<a href="https://code.google.com/p/hadoop-course/source/browse/HadoopSamples/src/main/java/mr/wholeFile/?r=3" rel="nofollow">https://code.google.com/p/hadoop-course/source/browse/HadoopSamples/src/main/java/mr/wholeFile/?r=3</a>)
  That suppose to help me do this.</p>
  
  <p>And I got a compilation error that says : </p>
  
  <blockquote>
    <p>The method setInputFormat(Class) in the type
    JobConf is not applicable for the arguments
    (Class) Driver.java /ex2/src    line 33 Java
    Problem</p>
  </blockquote>
  
  <p>I changed my Driver class to be</p>
  
  <pre><code>import org.apache.hadoop.fs.Path;
  import org.apache.hadoop.io.IntWritable;
  import org.apache.hadoop.io.Text;
  import org.apache.hadoop.mapred.FileInputFormat;
  import org.apache.hadoop.mapred.FileOutputFormat;
  import org.apache.hadoop.mapred.InputFormat;
  import org.apache.hadoop.mapred.JobClient;
  import org.apache.hadoop.mapred.JobConf;
  import org.apache.hadoop.mapred.TextInputFormat;
  import org.apache.hadoop.mapred.TextOutputFormat;
  
  import forma.WholeFileInputFormat;
  
  /*
   * Driver
   * The Driver class is responsible of creating the job and commiting it.
   */
  public class Driver {
      public static void main(String[] args) throws Exception {
          JobConf conf = new JobConf(Driver.class);
          conf.setJobName("Get minimun for each month");
  
          conf.setOutputKeyClass(IntWritable.class);
          conf.setOutputValueClass(IntWritable.class);
  
          conf.setMapperClass(Map.class);
          conf.setCombinerClass(Reduce.class);
          conf.setReducerClass(Reduce.class);
  
          // previous it was 
          // conf.setInputFormat(TextInputFormat.class);
          // And it was changed it to :
          conf.setInputFormat(WholeFileInputFormat.class);
  
          conf.setOutputFormat(TextOutputFormat.class);
  
          FileInputFormat.setInputPaths(conf,new Path("input"));
          FileOutputFormat.setOutputPath(conf,new Path("output"));
  
          System.out.println("Starting Job...");
          JobClient.runJob(conf);
          System.out.println("Job Done!");
      }
  
  }
  </code></pre>
  
  <p>What am I doing wrong?</p>