Cluster URL to connect to (e.g. mesos://host:port, spark://host:port, local[4]).
A name for your application, to display on the cluster web UI
The SPARK_HOME directory on the slave nodes
Collection of JARs to send to the cluster. These can be paths on the local file system or HDFS, HTTP, HTTPS, or FTP URLs.
Environment variables to set on worker nodes
Cluster URL to connect to (e.g. mesos://host:port, spark://host:port, local[4]).
A name for your application, to display on the cluster web UI
The SPARK_HOME directory on the slave nodes
Collection of JARs to send to the cluster. These can be paths on the local file system or HDFS, HTTP, HTTPS, or FTP URLs.
Cluster URL to connect to (e.g. mesos://host:port, spark://host:port, local[4]).
A name for your application, to display on the cluster web UI
The SPARK_HOME directory on the slave nodes
JAR file to send to the cluster. This can be a path on the local file system or an HDFS, HTTP, HTTPS, or FTP URL.
Cluster URL to connect to (e.g. mesos://host:port, spark://host:port, local[4]).
A name for your application, to display on the cluster web UI
a org.apache.spark.SparkConf object specifying other Spark parameters
Cluster URL to connect to (e.g. mesos://host:port, spark://host:port, local[4]).
A name for your application, to display on the cluster web UI
a org.apache.spark.SparkConf object specifying Spark parameters
Create a JavaSparkContext that loads settings from system properties (for instance, when launching with .
Create a JavaSparkContext that loads settings from system properties (for instance, when launching with ./bin/spark-submit).
Create an org.apache.spark.Accumulable shared variable of the given type, to which tasks
can "add" values with add
.
Create an org.apache.spark.Accumulable shared variable of the given type, to which tasks
can "add" values with add
. Only the master can access the accumuable's value
.
Create an org.apache.spark.Accumulator variable of a given type, which tasks can "add"
values to using the add
method.
Create an org.apache.spark.Accumulator variable of a given type, which tasks can "add"
values to using the add
method. Only the master can access the accumulator's value
.
Create an org.apache.spark.Accumulator double variable, which tasks can "add" values
to using the add
method.
Create an org.apache.spark.Accumulator double variable, which tasks can "add" values
to using the add
method. Only the master can access the accumulator's value
.
Create an org.apache.spark.Accumulator integer variable, which tasks can "add" values
to using the add
method.
Create an org.apache.spark.Accumulator integer variable, which tasks can "add" values
to using the add
method. Only the master can access the accumulator's value
.
Add a file to be downloaded with this Spark job on every node.
Add a file to be downloaded with this Spark job on every node.
The path
passed can be either a local file, a file in HDFS (or other Hadoop-supported
filesystems), or an HTTP, HTTPS or FTP URI. To access the file in Spark jobs,
use SparkFiles.get(path)
to find its download location.
Adds a JAR dependency for all tasks to be executed on this SparkContext in the future.
Adds a JAR dependency for all tasks to be executed on this SparkContext in the future.
The path
passed can be either a local file, a file in HDFS (or other Hadoop-supported
filesystems), or an HTTP, HTTPS or FTP URI.
Broadcast a read-only variable to the cluster, returning a org.apache.spark.broadcast.Broadcast object for reading it in distributed functions.
Broadcast a read-only variable to the cluster, returning a org.apache.spark.broadcast.Broadcast object for reading it in distributed functions. The variable will be sent to each cluster only once.
Cancel all jobs that have been scheduled or are running.
Cancel active jobs for the specified group.
Cancel active jobs for the specified group. See org.apache.spark.api.java.JavaSparkContext.setJobGroup for more information.
Pass-through to SparkContext.
Pass-through to SparkContext.setCallSite. For API support only.
Clear the current thread's job group ID and its description.
Default min number of partitions for Hadoop RDDs when not given by user
Default level of parallelism to use when not given by user (e.
Default level of parallelism to use when not given by user (e.g. parallelize and makeRDD).
Create an org.apache.spark.Accumulator double variable, which tasks can "add" values
to using the add
method.
Create an org.apache.spark.Accumulator double variable, which tasks can "add" values
to using the add
method. Only the master can access the accumulator's value
.
Return a copy of this JavaSparkContext's configuration.
Return a copy of this JavaSparkContext's configuration. The configuration cannot be changed at runtime.
Get a local property set in this thread, or null if it is missing.
Get a local property set in this thread, or null if it is missing. See org.apache.spark.api.java.JavaSparkContext.setLocalProperty.
Get Spark's home location from either a value set through the constructor, or the spark.
Get Spark's home location from either a value set through the constructor, or the spark.home Java property, or the SPARK_HOME environment variable (in that order of preference). If neither of these is set, return None.
Returns the Hadoop configuration used for the Hadoop code (e.
Returns the Hadoop configuration used for the Hadoop code (e.g. file systems) we reuse.
Get an RDD for a Hadoop file with an arbitrary InputFormat
Get an RDD for a Hadoop file with an arbitrary InputFormat
Note: Because Hadoop's RecordReader class re-uses the same Writable object for each
record, directly caching the returned RDD will create many references to the same object.
If you plan to directly cache Hadoop writable objects, you should first copy them using
a map
function.
Get an RDD for a Hadoop file with an arbitrary InputFormat.
Get an RDD for a Hadoop file with an arbitrary InputFormat.
Note: Because Hadoop's RecordReader class re-uses the same Writable object for each
record, directly caching the returned RDD will create many references to the same object.
If you plan to directly cache Hadoop writable objects, you should first copy them using
a map
function.
Get an RDD for a Hadoop-readable dataset from a Hadooop JobConf giving its InputFormat and any other necessary info (e.
Get an RDD for a Hadoop-readable dataset from a Hadooop JobConf giving its InputFormat and any other necessary info (e.g. file name for a filesystem-based dataset, table name for HyperTable,
Note: Because Hadoop's RecordReader class re-uses the same Writable object for each
record, directly caching the returned RDD will create many references to the same object.
If you plan to directly cache Hadoop writable objects, you should first copy them using
a map
function.
Get an RDD for a Hadoop-readable dataset from a Hadooop JobConf giving its InputFormat and any other necessary info (e.
Get an RDD for a Hadoop-readable dataset from a Hadooop JobConf giving its InputFormat and any other necessary info (e.g. file name for a filesystem-based dataset, table name for HyperTable, etc).
Note: Because Hadoop's RecordReader class re-uses the same Writable object for each
record, directly caching the returned RDD will create many references to the same object.
If you plan to directly cache Hadoop writable objects, you should first copy them using
a map
function.
Create an org.apache.spark.Accumulator integer variable, which tasks can "add" values
to using the add
method.
Create an org.apache.spark.Accumulator integer variable, which tasks can "add" values
to using the add
method. Only the master can access the accumulator's value
.
Get an RDD for a given Hadoop file with an arbitrary new API InputFormat and extra configuration options to pass to the input format.
Get an RDD for a given Hadoop file with an arbitrary new API InputFormat and extra configuration options to pass to the input format.
Note: Because Hadoop's RecordReader class re-uses the same Writable object for each
record, directly caching the returned RDD will create many references to the same object.
If you plan to directly cache Hadoop writable objects, you should first copy them using
a map
function.
Get an RDD for a given Hadoop file with an arbitrary new API InputFormat and extra configuration options to pass to the input format.
Get an RDD for a given Hadoop file with an arbitrary new API InputFormat and extra configuration options to pass to the input format.
Note: Because Hadoop's RecordReader class re-uses the same Writable object for each
record, directly caching the returned RDD will create many references to the same object.
If you plan to directly cache Hadoop writable objects, you should first copy them using
a map
function.
Load an RDD saved as a SequenceFile containing serialized objects, with NullWritable keys and BytesWritable values that contain a serialized partition.
Load an RDD saved as a SequenceFile containing serialized objects, with NullWritable keys and BytesWritable values that contain a serialized partition. This is still an experimental storage format and may not be supported exactly as is in future Spark releases. It will also be pretty slow if you use the default serializer (Java serialization), though the nice thing about it is that there's very little effort required to save arbitrary objects.
Load an RDD saved as a SequenceFile containing serialized objects, with NullWritable keys and BytesWritable values that contain a serialized partition.
Load an RDD saved as a SequenceFile containing serialized objects, with NullWritable keys and BytesWritable values that contain a serialized partition. This is still an experimental storage format and may not be supported exactly as is in future Spark releases. It will also be pretty slow if you use the default serializer (Java serialization), though the nice thing about it is that there's very little effort required to save arbitrary objects.
Distribute a local Scala collection to form an RDD.
Distribute a local Scala collection to form an RDD.
Distribute a local Scala collection to form an RDD.
Distribute a local Scala collection to form an RDD.
Distribute a local Scala collection to form an RDD.
Distribute a local Scala collection to form an RDD.
Get an RDD for a Hadoop SequenceFile.
Get an RDD for a Hadoop SequenceFile.
Note: Because Hadoop's RecordReader class re-uses the same Writable object for each
record, directly caching the returned RDD will create many references to the same object.
If you plan to directly cache Hadoop writable objects, you should first copy them using
a map
function.
Get an RDD for a Hadoop SequenceFile with given key and value types.
Get an RDD for a Hadoop SequenceFile with given key and value types.
Note: Because Hadoop's RecordReader class re-uses the same Writable object for each
record, directly caching the returned RDD will create many references to the same object.
If you plan to directly cache Hadoop writable objects, you should first copy them using
a map
function.
Pass-through to SparkContext.
Pass-through to SparkContext.setCallSite. For API support only.
Set the directory under which RDDs are going to be checkpointed.
Set the directory under which RDDs are going to be checkpointed. The directory must be a HDFS path if running on a cluster.
Assigns a group ID to all the jobs started by this thread until the group ID is set to a different value or cleared.
Assigns a group ID to all the jobs started by this thread until the group ID is set to a different value or cleared.
setJobGroup(groupId: String, description: String, interruptThread: Boolean)
.
This method sets interruptOnCancel to false.
Assigns a group ID to all the jobs started by this thread until the group ID is set to a different value or cleared.
Assigns a group ID to all the jobs started by this thread until the group ID is set to a different value or cleared.
Often, a unit of execution in an application consists of multiple Spark actions or jobs. Application programmers can use this method to group all those jobs together and give a group description. Once set, the Spark web UI will associate such jobs with this group.
The application can also use org.apache.spark.api.java.JavaSparkContext.cancelJobGroup to cancel all running jobs in this group. For example,
// In the main thread: sc.setJobGroup("some_job_to_cancel", "some job description"); rdd.map(...).count(); // In a separate thread: sc.cancelJobGroup("some_job_to_cancel");
If interruptOnCancel is set to true for the job group, then job cancellation will result in Thread.interrupt() being called on the job's executor threads. This is useful to help ensure that the tasks are actually stopped in a timely manner, but is off by default due to HDFS-1208, where HDFS may respond to Thread.interrupt() by marking nodes as dead.
Set a local property that affects jobs submitted from this thread, such as the Spark fair scheduler pool.
Shut down the SparkContext.
Read a text file from HDFS, a local file system (available on all nodes), or any Hadoop-supported file system URI, and return it as an RDD of Strings.
Read a text file from HDFS, a local file system (available on all nodes), or any Hadoop-supported file system URI, and return it as an RDD of Strings.
Build the union of two or more RDDs.
Build the union of two or more RDDs.
Build the union of two or more RDDs.
Build the union of two or more RDDs.
Build the union of two or more RDDs.
Build the union of two or more RDDs.
Read a directory of text files from HDFS, a local file system (available on all nodes), or any Hadoop-supported file system URI.
Read a directory of text files from HDFS, a local file system (available on all nodes), or any Hadoop-supported file system URI. Each file is read as a single record and returned in a key-value pair, where the key is the path of each file, the value is the content of each file.
wholeTextFiles(path: String, minPartitions: Int)
.
Read a directory of text files from HDFS, a local file system (available on all nodes), or any Hadoop-supported file system URI.
Read a directory of text files from HDFS, a local file system (available on all nodes), or any Hadoop-supported file system URI. Each file is read as a single record and returned in a key-value pair, where the key is the path of each file, the value is the content of each file.
For example, if you have the following files:
hdfs://a-hdfs-path/part-00000 hdfs://a-hdfs-path/part-00001 ... hdfs://a-hdfs-path/part-nnnnn
Do JavaPairRDD<String, String> rdd = sparkContext.wholeTextFiles("hdfs://a-hdfs-path")
,
then rdd
contains
(a-hdfs-path/part-00000, its content) (a-hdfs-path/part-00001, its content) ... (a-hdfs-path/part-nnnnn, its content)
A suggestion value of the minimal splitting number for input data.
Small files are preferred, large file is also allowable, but may cause bad performance.
Clear the job's list of files added by addFile
so that they do not get downloaded to
any new nodes.
Clear the job's list of files added by addFile
so that they do not get downloaded to
any new nodes.
(Since version 1.0.0) adding files no longer creates local copies that need to be deleted
Clear the job's list of JARs added by addJar
so that they do not get downloaded to
any new nodes.
Clear the job's list of JARs added by addJar
so that they do not get downloaded to
any new nodes.
(Since version 1.0.0) adding jars no longer creates local copies that need to be deleted
Default min number of partitions for Hadoop RDDs when not given by user.
Default min number of partitions for Hadoop RDDs when not given by user.
(Since version 1.0.0) use defaultMinPartitions
A Java-friendly version of org.apache.spark.SparkContext that returns org.apache.spark.api.java.JavaRDDs and works with Java collections instead of Scala ones.