I am trying to read files for rdd as below
JavaRDD objectRDD = sparkContext.textFile(fileName).map(new Function()