Repository: spark
Updated Branches:
  refs/heads/branch-1.5 5553f02be -> 522b0b646


[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.fe...@gmail.com>

Closes #7874 from darkjh/SPARK-8949.

(cherry picked from commit 3d16a545007922ee6fa36e5f5c3959406cb46484)
Signed-off-by: Sean Owen <so...@cloudera.com>


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/522b0b64
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/522b0b64
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/522b0b64

Branch: refs/heads/branch-1.5
Commit: 522b0b6466b420cf21623c2342e203e157de0d15
Parents: 5553f02
Author: Han JU <ju.han.fe...@gmail.com>
Authored: Wed Aug 19 13:04:16 2015 +0100
Committer: Sean Owen <so...@cloudera.com>
Committed: Wed Aug 19 13:04:24 2015 +0100

----------------------------------------------------------------------
 core/src/main/scala/org/apache/spark/SparkContext.scala | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/522b0b64/core/src/main/scala/org/apache/spark/SparkContext.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/org/apache/spark/SparkContext.scala 
b/core/src/main/scala/org/apache/spark/SparkContext.scala
index 2e01a9a..1ddaca8 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
   }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org

Reply via email to