Class SparkContextReference
- java.lang.Object
-
- org.apache.wayang.core.util.AbstractReferenceCountable
-
- org.apache.wayang.core.platform.ExecutionResourceTemplate
-
- org.apache.wayang.spark.execution.SparkContextReference
-
- All Implemented Interfaces:
ExecutionResource
,ReferenceCountable
public class SparkContextReference extends ExecutionResourceTemplate
Wraps and manages aJavaSparkContext
to avoid steady re-creation.
-
-
Constructor Summary
Constructors Constructor Description SparkContextReference(CrossPlatformExecutor crossPlatformExecutor, org.apache.spark.api.java.JavaSparkContext sparkContext)
Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
doDispose()
Performs the actual disposing work of this instance.org.apache.spark.api.java.JavaSparkContext
get()
Provides theJavaSparkContext
.-
Methods inherited from class org.apache.wayang.core.platform.ExecutionResourceTemplate
dispose, disposeUnreferenced
-
Methods inherited from class org.apache.wayang.core.util.AbstractReferenceCountable
disposeIfUnreferenced, getNumReferences, isDisposed, noteDiscardedReference, noteObtainedReference
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.wayang.core.util.ReferenceCountable
disposeIfUnreferenced, getNumReferences, isDisposed, noteDiscardedReference, noteObtainedReference
-
-
-
-
Constructor Detail
-
SparkContextReference
public SparkContextReference(CrossPlatformExecutor crossPlatformExecutor, org.apache.spark.api.java.JavaSparkContext sparkContext)
Creates a new instance.- Parameters:
sparkContext
- theJavaSparkContext
to be wrapped
-
-
Method Detail
-
doDispose
protected void doDispose() throws java.lang.Throwable
Description copied from class:ExecutionResourceTemplate
Performs the actual disposing work of this instance.- Specified by:
doDispose
in classExecutionResourceTemplate
- Throws:
java.lang.Throwable
- in case anything goes wrong
-
get
public org.apache.spark.api.java.JavaSparkContext get()
Provides theJavaSparkContext
. This instance must not be disposed, yet.- Returns:
- the wrapped
JavaSparkContext
-
-