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.StageExecutionNested 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.JavaSparkContextTheJavaSparkContextto be used by this instance.final org.apache.spark.sql.SparkSessionTheSparkSessionto be used by this instance.Fields inherited from class org.apache.wayang.core.platform.PushExecutorTemplate
jobFields inherited from class org.apache.wayang.core.platform.ExecutorTemplate
logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()Releases any instances acquired by this instance to executeExecutionStages.protected Tuple<List<ChannelInstance>,PartialExecution> execute(ExecutionTask task, List<ChannelInstance> inputChannelInstances, OptimizationContext.OperatorContext producerOperatorContext, boolean isRequestEagerExecution) Executes the giventaskand return the outputChannelInstances.voidforward(ChannelInstance input, ChannelInstance output) Utility method to forward aRddChannel.Instanceto another.Provide aFunctionCompiler.intHint toSparkExecutionOperators on how many partitions they should request.Methods inherited from class org.apache.wayang.core.platform.PushExecutorTemplate
execute, getJobMethods inherited from class org.apache.wayang.core.platform.ExecutorTemplate
createPartialExecution, disposeUnreferenced, getConfiguration, getCrossPlatformExecutor, register, registerMeasuredCardinalities, registerMeasuredCardinality, toString, unregisterMethods 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, wait, wait, waitMethods 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 scTheJavaSparkContextto be used by this instance.- See Also:
-
sparkContextReference
-
ss
public final org.apache.spark.sql.SparkSession ssTheSparkSessionto 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:PushExecutorTemplateExecutes the giventaskand return the outputChannelInstances.- Specified by:
executein classPushExecutorTemplate- Parameters:
task- that should be executedinputChannelInstances- inputs into thetaskisRequestEagerExecution- whether theExecutionTaskshould be executed eagerly if possible- Returns:
- the
ChannelInstances created as output oftask
-
forward
Utility method to forward aRddChannel.Instanceto another.- Parameters:
input- that should be forwardedoutput- to that should be forwarded
-
getPlatform
- Returns:
- the
Platformthis instance belongs to
-
getNumDefaultPartitions
public int getNumDefaultPartitions()Hint toSparkExecutionOperators on how many partitions they should request.- Returns:
- the default number of partitions
-
dispose
public void dispose()Description copied from interface:ExecutorReleases any instances acquired by this instance to executeExecutionStages.- Specified by:
disposein interfaceExecutionResource- Specified by:
disposein interfaceExecutor- Overrides:
disposein classExecutorTemplate
-
getCompiler
Provide aFunctionCompiler.- Returns:
- the
FunctionCompiler
-