Skip to content

Commit

Permalink
updated the code style.The style from [for...yield]to
Browse files Browse the repository at this point in the history
[files.map(file=>{})]
  • Loading branch information
surongquan committed Nov 10, 2014
1 parent 88a2c20 commit 321bbe8
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,15 @@ class FileInputDStream[K: ClassTag, V: ClassTag, F <: NewInputFormat[K,V] : Clas

/** Generate one RDD from an array of files */
private def filesToRDD(files: Seq[String]): RDD[(K, V)] = {
val fileRDDs = for (file <- files; rdd = context.sparkContext.newAPIHadoopFile[K, V, F](file))
yield {
val fileRDDs = files.map(file =>{
val rdd = context.sparkContext.newAPIHadoopFile[K, V, F](file)
if (rdd.partitions.size == 0) {
logError("File " + file + " has no data in it. Spark Streaming can only ingest " +
"files that have been \"moved\" to the directory assigned to the file stream. " +
"Refer to the streaming programming guide for more details.")
}
rdd
}
})
new UnionRDD(context.sparkContext, fileRDDs)
}

Expand Down

0 comments on commit 321bbe8

Please sign in to comment.