Skip to content

Commit b6d22af

Browse files
pwendellaarondav
authored andcommitted
HOTFIX: Add no-arg SparkContext constructor in Java
Self explanatory. Author: Patrick Wendell <pwendell@gmail.com> Closes #878 from pwendell/java-constructor and squashes the following commits: 2cc1605 [Patrick Wendell] HOTFIX: Add no-arg SparkContext constructor in Java
1 parent c3576ff commit b6d22af

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

core/src/main/scala/org/apache/spark/api/java/JavaSparkContext.scala

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ import org.apache.spark.rdd.RDD
4141
* [[org.apache.spark.api.java.JavaRDD]]s and works with Java collections instead of Scala ones.
4242
*/
4343
class JavaSparkContext(val sc: SparkContext) extends JavaSparkContextVarargsWorkaround {
44+
/**
45+
* Create a JavaSparkContext that loads settings from system properties (for instance, when
46+
* launching with ./bin/spark-submit).
47+
*/
48+
def this() = this(new SparkContext())
49+
4450
/**
4551
* @param conf a [[org.apache.spark.SparkConf]] object specifying Spark parameters
4652
*/

0 commit comments

Comments
 (0)