Packages

object SparkContext extends Logging

The SparkContext object contains a number of implicit conversions and parameters for use with various Spark features.

Source
SparkContext.scala
Linear Supertypes
Logging, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. SparkContext
  2. Logging
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. def getOrCreate(): SparkContext

    This function may be used to get or instantiate a SparkContext and register it as a singleton object.

    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.

    This method allows not passing a SparkConf (useful if just retrieving).

    returns

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

  2. def getOrCreate(config: SparkConf): SparkContext

    This function may be used to get or instantiate a SparkContext and register it as a singleton object.

    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.

    config

    SparkConfig that will be used for initialisation of the SparkContext

    returns

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

  3. def jarOfClass(cls: Class[_]): Option[String]

    Find the JAR from which a given class was loaded, to make it easy for users to pass their JARs to SparkContext.

    Find the JAR from which a given class was loaded, to make it easy for users to pass their JARs to SparkContext.

    cls

    class that should be inside of the jar

    returns

    jar that contains the Class, None if not found

  4. def jarOfObject(obj: AnyRef): Option[String]

    Find the JAR that contains the class of a particular object, to make it easy for users to pass their JARs to SparkContext.

    Find the JAR that contains the class of a particular object, to make it easy for users to pass their JARs to SparkContext. In most cases you can call jarOfObject(this) in your driver program.

    obj

    reference to an instance which class should be inside of the jar

    returns

    jar that contains the class of the instance, None if not found