Repository: spark
Updated Branches:
  refs/heads/master ba2a07e2b -> 3d16a5450


[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.


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

Branch: refs/heads/master
Commit: 3d16a545007922ee6fa36e5f5c3959406cb46484
Parents: ba2a07e
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:16 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/3d16a545/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