update code for spark 1.0 and hadoop 2.4.0