Class EmbeddedExecutor
- java.lang.Object
-
- org.apache.flink.client.deployment.application.executors.EmbeddedExecutor
-
- All Implemented Interfaces:
PipelineExecutor
@Internal public class EmbeddedExecutor extends Object implements PipelineExecutor
A base class forexecutors
that invoke directly methods of theDispatcher
and do not go through the REST API.
-
-
Constructor Summary
Constructors Constructor Description EmbeddedExecutor(Collection<JobID> submittedJobIds, DispatcherGateway dispatcherGateway, Configuration configuration, EmbeddedJobClientCreator jobClientCreator)
Creates aEmbeddedExecutor
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CompletableFuture<JobClient>
execute(Pipeline pipeline, Configuration configuration, ClassLoader userCodeClassloader)
-
-
-
Field Detail
-
NAME
public static final String NAME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
EmbeddedExecutor
public EmbeddedExecutor(Collection<JobID> submittedJobIds, DispatcherGateway dispatcherGateway, Configuration configuration, EmbeddedJobClientCreator jobClientCreator)
Creates aEmbeddedExecutor
.- Parameters:
submittedJobIds
- a list that is going to be filled with the job ids of the new jobs that will be submitted. This is essentially used to return the submitted job ids to the caller.dispatcherGateway
- the dispatcher of the cluster which is going to be used to submit jobs.configuration
- the flink application configurationjobClientCreator
- the job client creator
-
-
Method Detail
-
execute
public CompletableFuture<JobClient> execute(Pipeline pipeline, Configuration configuration, ClassLoader userCodeClassloader) throws Exception
Description copied from interface:PipelineExecutor
Executes aPipeline
based on the provided configuration and returns aJobClient
which allows to interact with the job being executed, e.g. cancel it or take a savepoint.ATTENTION: The caller is responsible for managing the lifecycle of the returned
JobClient
. This means that e.g.close()
should be called explicitly at the call-site.- Specified by:
execute
in interfacePipelineExecutor
- Parameters:
pipeline
- thePipeline
to executeconfiguration
- theConfiguration
with the required execution parametersuserCodeClassloader
- theClassLoader
to deserialize usercode- Returns:
- a
CompletableFuture
with theJobClient
corresponding to the pipeline. - Throws:
Exception
-
-