title: How to read avro file in spark using newAPIHadoopFile?
body: <p>I am trying to read na <code>Avro</code> file in spark job.<br>
  My spark version is <code>1.6.0</code> (spark-core_2.10-1.6.0-cdh5.7.1).</p>
  
  <p>Here is my java code:</p>
  
  <pre><code>JavaSparkContext sc = new JavaSparkContext(new SparkConf().setAppName("ReadAvro"));
  JavaPairRDD &lt;NullWritable, Text&gt; lines = sc.newAPIHadoopFile(args[0],AvroKeyValueInputFormat.class,AvroKey.class,AvroValue.class,new Configuration());
  </code></pre>
  
  <p>But I am getting a compile time exception:</p>
  
  <blockquote>
    <p>The method newAPIHadoopFile(String, Class, Class, Class,
    Configuration) in the type JavaSparkContext is not applicable for the
    arguments (String, Class, Class,
    Class, Configuration)</p>
  </blockquote>
  
  <p>So what is the correct way to use <code>JavaSparkContext.newAPIHadoopFile()</code> in Java?</p>