public class DataflowPipelineJob extends java.lang.Object implements PipelineResult
DataflowRunner
.PipelineResult.State
Modifier and Type | Field and Description |
---|---|
protected static org.apache.beam.sdk.util.FluentBackoff |
STATUS_BACKOFF_FACTORY |
Constructor and Description |
---|
DataflowPipelineJob(DataflowClient dataflowClient,
java.lang.String jobId,
DataflowPipelineOptions dataflowOptions,
java.util.Map<org.apache.beam.sdk.runners.AppliedPTransform<?,?,?>,java.lang.String> transformStepNames)
Constructs the job.
|
DataflowPipelineJob(DataflowClient dataflowClient,
java.lang.String jobId,
DataflowPipelineOptions dataflowOptions,
java.util.Map<org.apache.beam.sdk.runners.AppliedPTransform<?,?,?>,java.lang.String> transformStepNames,
@Nullable org.apache.beam.model.pipeline.v1.RunnerApi.Pipeline pipelineProto)
Constructs the job.
|
Modifier and Type | Method and Description |
---|---|
PipelineResult.State |
cancel()
Cancels the pipeline execution.
|
DataflowPipelineOptions |
getDataflowOptions() |
java.lang.String |
getJobId()
Get the id of this job.
|
@Nullable org.apache.beam.model.pipeline.v1.RunnerApi.Pipeline |
getPipelineProto()
Get the Runner API pipeline proto if available.
|
java.lang.String |
getProjectId()
Get the project this job exists in.
|
java.lang.String |
getRegion()
Get the region this job exists in.
|
DataflowPipelineJob |
getReplacedByJob()
Returns a new
DataflowPipelineJob for the job that replaced this one, if applicable. |
PipelineResult.State |
getState()
Retrieves the current state of the pipeline execution.
|
protected @Nullable org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.BiMap<org.apache.beam.sdk.runners.AppliedPTransform<?,?,?>,java.lang.String> |
getTransformStepNames() |
MetricResults |
metrics()
Returns the object to access metrics from the pipeline.
|
@Nullable PipelineResult.State |
waitUntilFinish()
Waits until the pipeline finishes and returns the final status.
|
@Nullable PipelineResult.State |
waitUntilFinish(Duration duration)
Waits until the pipeline finishes and returns the final status.
|
@Nullable PipelineResult.State |
waitUntilFinish(Duration duration,
MonitoringUtil.JobMessagesHandler messageHandler)
Waits until the pipeline finishes and returns the final status.
|
protected static final org.apache.beam.sdk.util.FluentBackoff STATUS_BACKOFF_FACTORY
public DataflowPipelineJob(DataflowClient dataflowClient, java.lang.String jobId, DataflowPipelineOptions dataflowOptions, java.util.Map<org.apache.beam.sdk.runners.AppliedPTransform<?,?,?>,java.lang.String> transformStepNames, @Nullable org.apache.beam.model.pipeline.v1.RunnerApi.Pipeline pipelineProto)
jobId
- the job iddataflowOptions
- used to configure the client for the Dataflow ServicetransformStepNames
- a mapping from AppliedPTransforms to Step NamespipelineProto
- Runner API pipeline proto.public DataflowPipelineJob(DataflowClient dataflowClient, java.lang.String jobId, DataflowPipelineOptions dataflowOptions, java.util.Map<org.apache.beam.sdk.runners.AppliedPTransform<?,?,?>,java.lang.String> transformStepNames)
jobId
- the job iddataflowOptions
- used to configure the client for the Dataflow ServicetransformStepNames
- a mapping from AppliedPTransforms to Step Namespublic java.lang.String getJobId()
public java.lang.String getProjectId()
public DataflowPipelineOptions getDataflowOptions()
public @Nullable org.apache.beam.model.pipeline.v1.RunnerApi.Pipeline getPipelineProto()
public java.lang.String getRegion()
protected @Nullable org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.BiMap<org.apache.beam.sdk.runners.AppliedPTransform<?,?,?>,java.lang.String> getTransformStepNames()
public DataflowPipelineJob getReplacedByJob()
DataflowPipelineJob
for the job that replaced this one, if applicable.java.lang.IllegalStateException
- if called before the job has terminated or if the job terminated
but was not updatedpublic @Nullable PipelineResult.State waitUntilFinish()
PipelineResult
waitUntilFinish
in interface PipelineResult
public @Nullable PipelineResult.State waitUntilFinish(Duration duration)
PipelineResult
waitUntilFinish
in interface PipelineResult
duration
- The time to wait for the pipeline to finish. Provide a value less than 1 ms for
an infinite wait.public @Nullable PipelineResult.State waitUntilFinish(Duration duration, MonitoringUtil.JobMessagesHandler messageHandler) throws java.io.IOException, java.lang.InterruptedException
duration
- The time to wait for the job to finish. Provide a value less than 1 ms for an
infinite wait.messageHandler
- If non null this handler will be invoked for each batch of messages
received.java.io.IOException
- If there is a persistent problem getting job information.java.lang.InterruptedException
public PipelineResult.State cancel() throws java.io.IOException
PipelineResult
cancel
in interface PipelineResult
java.io.IOException
- if there is a problem executing the cancel request.public PipelineResult.State getState()
PipelineResult
getState
in interface PipelineResult
PipelineResult.State
representing the state of this pipeline.public MetricResults metrics()
PipelineResult
metrics
in interface PipelineResult