Share via


SparkContext Constructors

Definition

Overloads

SparkContext()

Create a SparkContext that loads settings from system properties (for instance, when launching with spark-submit).

SparkContext(SparkConf)

Create a SparkContext object with the given config.

SparkContext(String, String)

Initializes a SparkContext instance with a specific master and application name.

SparkContext(String, String, SparkConf)

Alternative constructor that allows setting common Spark properties directly.

SparkContext(String, String, String)

Alternative constructor that allows setting common Spark properties directly.

SparkContext()

Create a SparkContext that loads settings from system properties (for instance, when launching with spark-submit).

public SparkContext ();
Public Sub New ()

Applies to

SparkContext(SparkConf)

Create a SparkContext object with the given config.

public SparkContext (Microsoft.Spark.SparkConf conf);
new Microsoft.Spark.SparkContext : Microsoft.Spark.SparkConf -> Microsoft.Spark.SparkContext
Public Sub New (conf As SparkConf)

Parameters

conf
SparkConf

a Spark config object describing the application configuration. Any settings in this config overrides the default configs as well as system properties.

Applies to

SparkContext(String, String)

Initializes a SparkContext instance with a specific master and application name.

public SparkContext (string master, string appName);
new Microsoft.Spark.SparkContext : string * string -> Microsoft.Spark.SparkContext
Public Sub New (master As String, appName As String)

Parameters

master
String

Cluster URL to connect to (e.g. spark://host:port, local)

appName
String

A name for the application

Applies to

SparkContext(String, String, SparkConf)

Alternative constructor that allows setting common Spark properties directly.

public SparkContext (string master, string appName, Microsoft.Spark.SparkConf conf);
new Microsoft.Spark.SparkContext : string * string * Microsoft.Spark.SparkConf -> Microsoft.Spark.SparkContext
Public Sub New (master As String, appName As String, conf As SparkConf)

Parameters

master
String

Cluster URL to connect to (e.g. spark://host:port, local)

appName
String

A name for the application

conf
SparkConf

A SparkConf object specifying other Spark parameters

Applies to

SparkContext(String, String, String)

Alternative constructor that allows setting common Spark properties directly.

public SparkContext (string master, string appName, string sparkHome);
new Microsoft.Spark.SparkContext : string * string * string -> Microsoft.Spark.SparkContext
Public Sub New (master As String, appName As String, sparkHome As String)

Parameters

master
String

Cluster URL to connect to (e.g. spark://host:port, local)

appName
String

A name for the application

sparkHome
String

The path that holds spark bits

Applies to