From 7191be602b1108a4e00d72ab7d2b5b34b8c6c508 Mon Sep 17 00:00:00 2001 From: Xusen Yin Date: Thu, 3 Apr 2014 11:05:52 +0800 Subject: [PATCH] refine comments --- core/src/main/scala/org/apache/spark/SparkContext.scala | 2 ++ .../scala/org/apache/spark/api/java/JavaSparkContext.scala | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/core/src/main/scala/org/apache/spark/SparkContext.scala b/core/src/main/scala/org/apache/spark/SparkContext.scala index 3e66d8c4d8367..28a865c0ad3b5 100644 --- a/core/src/main/scala/org/apache/spark/SparkContext.scala +++ b/core/src/main/scala/org/apache/spark/SparkContext.scala @@ -394,6 +394,8 @@ class SparkContext( * ... * (a-hdfs-path/part-nnnnn, its content) * }}} + * + * @note Small files are perferred, large file is also allowable, but may cause bad performance. */ def wholeTextFiles(path: String): RDD[(String, String)] = { newAPIHadoopFile( diff --git a/core/src/main/scala/org/apache/spark/api/java/JavaSparkContext.scala b/core/src/main/scala/org/apache/spark/api/java/JavaSparkContext.scala index a34ccb3781803..6cbdeac58d5e2 100644 --- a/core/src/main/scala/org/apache/spark/api/java/JavaSparkContext.scala +++ b/core/src/main/scala/org/apache/spark/api/java/JavaSparkContext.scala @@ -167,7 +167,7 @@ class JavaSparkContext(val sc: SparkContext) extends JavaSparkContextVarargsWork * hdfs://a-hdfs-path/part-nnnnn * }}} * - * Do `JavaPairRDD rdd = context.wholeTextFiles("hdfs://a-hdfs-path")`, + * Do `JavaPairRDD rdd = sparkContext.wholeTextFiles("hdfs://a-hdfs-path")`, * *

then `rdd` contains * {{{ @@ -176,6 +176,8 @@ class JavaSparkContext(val sc: SparkContext) extends JavaSparkContextVarargsWork * ... * (a-hdfs-path/part-nnnnn, its content) * }}} + * + * @note Small files are perferred, large file is also allowable, but may cause bad performance. */ def wholeTextFiles(path: String): JavaPairRDD[String, String] = new JavaPairRDD(sc.wholeTextFiles(path))