How to use Spark's .newAPIHadoopFile() in Java
<p>I am trying to read na <code>lzo</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("ReadLzo"));
JavaPairRDD &lt;NullWritable, Text&gt; lines = sc.newAPIHadoopFile(args[0],LzoTextInputFormat.class,NullWritable.class,Text.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>