Sparkソースコードリーディング(4) - hadoop_FileInputFormat
戻ってhadoopFile関数
def hadoopFile[K, V]( path: String, inputFormatClass: Class[_ <: InputFormat[K, V]], keyClass: Class[K], valueClass: Class[V], minPartitions: Int = defaultMinPartitions ): RDD[(K, V)] = { // A Hadoop configuration can be about 10 KB, which is pretty big, so broadcast it. val confBroadcast = broadcast(new SerializableWritable(hadoopConfiguration)) val setInputPathsFunc = (jobConf: JobConf) => FileInputFormat.setInputPaths(jobConf, path)
次はsetInputPathsFunc
ここはScalaっぽい、というか関数型っぽい書き方で関数定義をしているよう
FileInputFormat自体はHadoopのメソッド(これ)
Sets the given comma separated paths as the list of inputs for the map-reduce job.
とあるようにカンマ区切りでHDFSのパスを受け取る
HDFSのファイルを取得する際に必要なものですね
textFileで指定したパスがここでhadoopに渡されるという流れでしょう
さて次は本丸のRDDだ!