Class FlinkContextReference
- java.lang.Object
-
- org.apache.wayang.core.util.AbstractReferenceCountable
-
- org.apache.wayang.core.platform.ExecutionResourceTemplate
-
- org.apache.wayang.flink.execution.FlinkContextReference
-
- All Implemented Interfaces:
ExecutionResource
,ReferenceCountable
public class FlinkContextReference extends ExecutionResourceTemplate
Wraps and manages a FlinkExecutionEnvironment
to avoid steady re-creation.
-
-
Constructor Summary
Constructors Constructor Description FlinkContextReference(CrossPlatformExecutor crossPlatformExecutor, org.apache.flink.api.java.ExecutionEnvironment flinkEnviroment, int parallelism)
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.flink.api.java.ExecutionEnvironment
get()
Provides theExecutionEnvironment
.boolean
isDisposed()
Optional operation. Tell whether this instance has been disposed.-
Methods inherited from class org.apache.wayang.core.platform.ExecutionResourceTemplate
dispose, disposeUnreferenced
-
Methods inherited from class org.apache.wayang.core.util.AbstractReferenceCountable
disposeIfUnreferenced, getNumReferences, 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, noteDiscardedReference, noteObtainedReference
-
-
-
-
Constructor Detail
-
FlinkContextReference
public FlinkContextReference(CrossPlatformExecutor crossPlatformExecutor, org.apache.flink.api.java.ExecutionEnvironment flinkEnviroment, int parallelism)
Creates a new instance.- Parameters:
flinkEnviroment
- theExecutionEnvironment
to be wrapped
-
-
Method Detail
-
get
public org.apache.flink.api.java.ExecutionEnvironment get()
Provides theExecutionEnvironment
. This instance must not be disposed, yet.- Returns:
- the wrapped
ExecutionEnvironment
-
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
-
isDisposed
public boolean isDisposed()
Description copied from interface:ReferenceCountable
Optional operation. Tell whether this instance has been disposed.- Specified by:
isDisposed
in interfaceReferenceCountable
- Overrides:
isDisposed
in classAbstractReferenceCountable
- Returns:
- whether this instance has been disposed
-
-