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, disposeUnreferencedMethods inherited from class org.apache.wayang.core.util.AbstractReferenceCountable
disposeIfUnreferenced, getNumReferences, isDisposed, noteDiscardedReference, noteObtainedReferenceMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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- theJavaSparkContextto be wrapped
-
-
Method Details
-
doDispose
Description copied from class:ExecutionResourceTemplatePerforms the actual disposing work of this instance.- Specified by:
doDisposein 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
-