Class JobInvocation
java.lang.Object
org.apache.beam.runners.jobsubmission.JobInvocation
Internal representation of a Job which has been invoked (prepared and run) by a client.
-
Constructor Summary
ConstructorsConstructorDescriptionJobInvocation
(JobInfo jobInfo, org.apache.beam.vendor.guava.v32_1_2_jre.com.google.common.util.concurrent.ListeningExecutorService executorService, org.apache.beam.model.pipeline.v1.RunnerApi.Pipeline pipeline, PortablePipelineRunner pipelineRunner) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addMessageListener
(Consumer<org.apache.beam.model.jobmanagement.v1.JobApi.JobMessage> messageStreamObserver) Listen for job messages with aConsumer
.void
addStateListener
(Consumer<org.apache.beam.model.jobmanagement.v1.JobApi.JobStateEvent> stateStreamObserver) Listen for job state changes with aConsumer
.void
cancel()
Cancel the job.getId()
org.apache.beam.model.jobmanagement.v1.JobApi.MetricResults
org.apache.beam.model.pipeline.v1.RunnerApi.Pipeline
Retrieve the job's pipeline.org.apache.beam.model.jobmanagement.v1.JobApi.JobState.Enum
getState()
Retrieve the job's current state.org.apache.beam.model.jobmanagement.v1.JobApi.JobStateEvent
Retrieve the job's current state.static Boolean
isTerminated
(org.apache.beam.model.jobmanagement.v1.JobApi.JobState.Enum state) void
start()
Start the job.org.apache.beam.model.jobmanagement.v1.JobApi.JobInfo
toProto()
Convert toJobApi.JobInfo
.
-
Constructor Details
-
JobInvocation
public JobInvocation(JobInfo jobInfo, org.apache.beam.vendor.guava.v32_1_2_jre.com.google.common.util.concurrent.ListeningExecutorService executorService, org.apache.beam.model.pipeline.v1.RunnerApi.Pipeline pipeline, PortablePipelineRunner pipelineRunner)
-
-
Method Details
-
start
public void start()Start the job. -
getId
- Returns:
- Unique identifier for the job invocation.
-
cancel
public void cancel()Cancel the job. -
getMetrics
public org.apache.beam.model.jobmanagement.v1.JobApi.MetricResults getMetrics() -
getState
public org.apache.beam.model.jobmanagement.v1.JobApi.JobState.Enum getState()Retrieve the job's current state. -
getStateEvent
public org.apache.beam.model.jobmanagement.v1.JobApi.JobStateEvent getStateEvent()Retrieve the job's current state. -
getPipeline
public org.apache.beam.model.pipeline.v1.RunnerApi.Pipeline getPipeline()Retrieve the job's pipeline. -
addStateListener
public void addStateListener(Consumer<org.apache.beam.model.jobmanagement.v1.JobApi.JobStateEvent> stateStreamObserver) Listen for job state changes with aConsumer
. -
addMessageListener
public void addMessageListener(Consumer<org.apache.beam.model.jobmanagement.v1.JobApi.JobMessage> messageStreamObserver) Listen for job messages with aConsumer
. -
toProto
public org.apache.beam.model.jobmanagement.v1.JobApi.JobInfo toProto()Convert toJobApi.JobInfo
. -
isTerminated
public static Boolean isTerminated(org.apache.beam.model.jobmanagement.v1.JobApi.JobState.Enum state)
-