Class SparkContextReference

All Implemented Interfaces:
ExecutionResource, ReferenceCountable

public class SparkContextReference extends ExecutionResourceTemplate
Wraps and manages a JavaSparkContext to avoid steady re-creation.
  • Constructor Details

    • SparkContextReference

      public SparkContextReference(CrossPlatformExecutor crossPlatformExecutor, org.apache.spark.api.java.JavaSparkContext sparkContext)
      Creates a new instance.
      Parameters:
      sparkContext - the JavaSparkContext to be wrapped
  • Method Details

    • doDispose

      protected void doDispose() throws Throwable
      Description copied from class: ExecutionResourceTemplate
      Performs the actual disposing work of this instance.
      Specified by:
      doDispose in class ExecutionResourceTemplate
      Throws:
      Throwable - in case anything goes wrong
    • get

      public org.apache.spark.api.java.JavaSparkContext get()
      Provides the JavaSparkContext. This instance must not be disposed, yet.
      Returns:
      the wrapped JavaSparkContext