Class SparkExecutor
java.lang.Object
org.apache.wayang.core.util.AbstractReferenceCountable
org.apache.wayang.core.platform.ExecutorTemplate
org.apache.wayang.core.platform.PushExecutorTemplate
org.apache.wayang.spark.execution.SparkExecutor
- All Implemented Interfaces:
CompositeExecutionResource
,ExecutionResource
,Executor
,ReferenceCountable
Executor
implementation for the SparkPlatform
.-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.wayang.core.platform.PushExecutorTemplate
PushExecutorTemplate.StageExecution
Nested classes/interfaces inherited from interface org.apache.wayang.core.platform.Executor
Executor.Factory
-
Field Summary
FieldsModifier and TypeFieldDescriptionCompiler to create Spark UDFs.final org.apache.spark.api.java.JavaSparkContext
TheJavaSparkContext
to be used by this instance.final org.apache.spark.sql.SparkSession
TheSparkSession
to be used by this instance.Fields inherited from class org.apache.wayang.core.platform.PushExecutorTemplate
job
Fields inherited from class org.apache.wayang.core.platform.ExecutorTemplate
logger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
dispose()
Releases any instances acquired by this instance to executeExecutionStage
s.protected Tuple<List<ChannelInstance>,
PartialExecution> execute
(ExecutionTask task, List<ChannelInstance> inputChannelInstances, OptimizationContext.OperatorContext producerOperatorContext, boolean isRequestEagerExecution) Executes the giventask
and return the outputChannelInstance
s.void
forward
(ChannelInstance input, ChannelInstance output) Utility method to forward aRddChannel.Instance
to another.Provide aFunctionCompiler
.int
Hint toSparkExecutionOperator
s on how many partitions they should request.Methods inherited from class org.apache.wayang.core.platform.PushExecutorTemplate
execute, getJob
Methods inherited from class org.apache.wayang.core.platform.ExecutorTemplate
createPartialExecution, disposeUnreferenced, getConfiguration, getCrossPlatformExecutor, register, registerMeasuredCardinalities, registerMeasuredCardinality, toString, unregister
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, wait, wait, wait
Methods inherited from interface org.apache.wayang.core.util.ReferenceCountable
disposeIfUnreferenced, getNumReferences, isDisposed, noteDiscardedReference, noteObtainedReference
-
Field Details
-
sc
public final org.apache.spark.api.java.JavaSparkContext scTheJavaSparkContext
to be used by this instance.- See Also:
-
sparkContextReference
-
ss
public final org.apache.spark.sql.SparkSession ssTheSparkSession
to be used by this instance. -
compiler
Compiler to create Spark UDFs.
-
-
Constructor Details
-
SparkExecutor
-
-
Method Details
-
execute
protected Tuple<List<ChannelInstance>,PartialExecution> execute(ExecutionTask task, List<ChannelInstance> inputChannelInstances, OptimizationContext.OperatorContext producerOperatorContext, boolean isRequestEagerExecution) Description copied from class:PushExecutorTemplate
Executes the giventask
and return the outputChannelInstance
s.- Specified by:
execute
in classPushExecutorTemplate
- Parameters:
task
- that should be executedinputChannelInstances
- inputs into thetask
isRequestEagerExecution
- whether theExecutionTask
should be executed eagerly if possible- Returns:
- the
ChannelInstance
s created as output oftask
-
forward
Utility method to forward aRddChannel.Instance
to another.- Parameters:
input
- that should be forwardedoutput
- to that should be forwarded
-
getPlatform
- Returns:
- the
Platform
this instance belongs to
-
getNumDefaultPartitions
public int getNumDefaultPartitions()Hint toSparkExecutionOperator
s on how many partitions they should request.- Returns:
- the default number of partitions
-
dispose
public void dispose()Description copied from interface:Executor
Releases any instances acquired by this instance to executeExecutionStage
s.- Specified by:
dispose
in interfaceExecutionResource
- Specified by:
dispose
in interfaceExecutor
- Overrides:
dispose
in classExecutorTemplate
-
getCompiler
Provide aFunctionCompiler
.- Returns:
- the
FunctionCompiler
-