diff options
author | Han JU <ju.han.felix@gmail.com> | 2015-08-19 13:04:16 +0100 |
---|---|---|
committer | Sean Owen <sowen@cloudera.com> | 2015-08-19 13:04:16 +0100 |
commit | 3d16a545007922ee6fa36e5f5c3959406cb46484 (patch) | |
tree | 5f8153bc00ad78b13b8fa237ac4566d9cb303545 /core | |
parent | ba2a07e2b6c5a39597b64041cd5bf342ef9631f5 (diff) | |
download | spark-3d16a545007922ee6fa36e5f5c3959406cb46484.tar.gz spark-3d16a545007922ee6fa36e5f5c3959406cb46484.tar.bz2 spark-3d16a545007922ee6fa36e5f5c3959406cb46484.zip |
[SPARK-8949] Print warnings when using preferred locations feature
Add warnings according to SPARK-8949 in `SparkContext`
- warnings in scaladoc
- log warnings when preferred locations feature is used through `SparkContext`'s constructor
However I didn't found any documentation reference of this feature. Please direct me if you know any reference to this feature.
Author: Han JU <ju.han.felix@gmail.com>
Closes #7874 from darkjh/SPARK-8949.
Diffstat (limited to 'core')
-rw-r--r-- | core/src/main/scala/org/apache/spark/SparkContext.scala | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/core/src/main/scala/org/apache/spark/SparkContext.scala b/core/src/main/scala/org/apache/spark/SparkContext.scala index 2e01a9a18c..1ddaca8a5b 100644 --- a/core/src/main/scala/org/apache/spark/SparkContext.scala +++ b/core/src/main/scala/org/apache/spark/SparkContext.scala @@ -118,9 +118,11 @@ class SparkContext(config: SparkConf) extends Logging with ExecutorAllocationCli * Can be generated using [[org.apache.spark.scheduler.InputFormatInfo.computePreferredLocations]] * from a list of input files or InputFormats for the application. */ + @deprecated("Passing in preferred locations has no effect at all, see SPARK-8949", "1.5.0") @DeveloperApi def this(config: SparkConf, preferredNodeLocationData: Map[String, Set[SplitInfo]]) = { this(config) + logWarning("Passing in preferred locations has no effect at all, see SPARK-8949") this.preferredNodeLocationData = preferredNodeLocationData } @@ -153,6 +155,9 @@ class SparkContext(config: SparkConf) extends Logging with ExecutorAllocationCli preferredNodeLocationData: Map[String, Set[SplitInfo]] = Map()) = { this(SparkContext.updatedConf(new SparkConf(), master, appName, sparkHome, jars, environment)) + if (preferredNodeLocationData.nonEmpty) { + logWarning("Passing in preferred locations has no effect at all, see SPARK-8949") + } this.preferredNodeLocationData = preferredNodeLocationData } |