public class DataflowPipelineJob extends java.lang.Object implements PipelineResult
DataflowRunner
.PipelineResult.State
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
jobId
The id for the job.
|
protected static org.apache.beam.sdk.util.FluentBackoff |
STATUS_BACKOFF_FACTORY |
protected org.apache.beam.vendor.guava.v20_0.com.google.common.collect.BiMap<org.apache.beam.sdk.runners.AppliedPTransform<?,?,?>,java.lang.String> |
transformStepNames |
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.
|
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.
|
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.
|
MetricResults |
metrics()
Returns the object to access metrics from the pipeline.
|
PipelineResult.State |
waitUntilFinish()
Waits until the pipeline finishes and returns the final status.
|
PipelineResult.State |
waitUntilFinish(Duration duration)
Waits until the pipeline finishes and returns the final status.
|
PipelineResult.State |
waitUntilFinish(Duration duration,
MonitoringUtil.JobMessagesHandler messageHandler)
Waits until the pipeline finishes and returns the final status.
|
protected java.lang.String jobId
protected org.apache.beam.vendor.guava.v20_0.com.google.common.collect.BiMap<org.apache.beam.sdk.runners.AppliedPTransform<?,?,?>,java.lang.String> transformStepNames
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)
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 java.lang.String getRegion()
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 updated@Nullable public PipelineResult.State waitUntilFinish()
PipelineResult
waitUntilFinish
in interface PipelineResult
@Nullable public 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.@Nullable public 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