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 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.
|
java.lang.String |
getJobId()
Get the id of this job.
|
java.lang.String |
getProjectId()
Get the project 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 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 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()
PipelineResultwaitUntilFinish in interface PipelineResult@Nullable public PipelineResult.State waitUntilFinish(Duration duration)
PipelineResultwaitUntilFinish in interface PipelineResultduration - 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.InterruptedExceptionpublic PipelineResult.State cancel() throws java.io.IOException
PipelineResultcancel in interface PipelineResultjava.io.IOException - if there is a problem executing the cancel request.public PipelineResult.State getState()
PipelineResultgetState in interface PipelineResultPipelineResult.State representing the state of this pipeline.public MetricResults metrics()
PipelineResultmetrics in interface PipelineResult