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
Wraps and manages a
JavaSparkContext
to avoid steady re-creation.-
Constructor Summary
ConstructorsConstructorDescriptionSparkContextReference
(CrossPlatformExecutor crossPlatformExecutor, org.apache.spark.api.java.JavaSparkContext sparkContext) Creates a new instance. -
Method Summary
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 Details
-
SparkContextReference
public SparkContextReference(CrossPlatformExecutor crossPlatformExecutor, org.apache.spark.api.java.JavaSparkContext sparkContext) Creates a new instance.- Parameters:
sparkContext
- theJavaSparkContext
to be wrapped
-
-
Method Details
-
doDispose
Description copied from class:ExecutionResourceTemplate
Performs the actual disposing work of this instance.- Specified by:
doDispose
in classExecutionResourceTemplate
- Throws:
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
-