SparkContext.GetOrCreate(SparkConf) Method

Definition

This function may be used to get or instantiate a SparkContext and register it as a singleton object. Because we can only have one active SparkContext per JVM, this is useful when applications may wish to share a SparkContext.

public static Microsoft.Spark.SparkContext GetOrCreate (Microsoft.Spark.SparkConf conf);
static member GetOrCreate : Microsoft.Spark.SparkConf -> Microsoft.Spark.SparkContext
Public Shared Function GetOrCreate (conf As SparkConf) As SparkContext

Parameters

conf
SparkConf

SparkConf that will be used for creating SparkContext

Returns

Current SparkContext (or a new one if it wasn't created before the function call)

Applies to