public class DataflowPipelineJob extends Object implements PipelineResult
DataflowRunner.PipelineResult.State| Modifier and Type | Field and Description |
|---|---|
protected String |
jobId
The id for the job.
|
protected static FluentBackoff |
STATUS_BACKOFF_FACTORY |
protected com.google.common.collect.BiMap<AppliedPTransform<?,?,?>,String> |
transformStepNames |
| Constructor and Description |
|---|
DataflowPipelineJob(DataflowClient dataflowClient,
String jobId,
DataflowPipelineOptions dataflowOptions,
Map<AppliedPTransform<?,?,?>,String> transformStepNames)
Constructs the job.
|
| Modifier and Type | Method and Description |
|---|---|
PipelineResult.State |
cancel() |
DataflowPipelineOptions |
getDataflowOptions() |
String |
getJobId()
Get the id of this job.
|
String |
getProjectId()
Get the project this job exists in.
|
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() |
MetricResults |
metrics() |
PipelineResult.State |
waitUntilFinish() |
PipelineResult.State |
waitUntilFinish(org.joda.time.Duration duration) |
PipelineResult.State |
waitUntilFinish(org.joda.time.Duration duration,
MonitoringUtil.JobMessagesHandler messageHandler)
Waits until the pipeline finishes and returns the final status.
|
protected String jobId
protected com.google.common.collect.BiMap<AppliedPTransform<?,?,?>,String> transformStepNames
protected static final FluentBackoff STATUS_BACKOFF_FACTORY
public DataflowPipelineJob(DataflowClient dataflowClient, String jobId, DataflowPipelineOptions dataflowOptions, Map<AppliedPTransform<?,?,?>,String> transformStepNames)
jobId - the job iddataflowOptions - used to configure the client for the Dataflow ServicetransformStepNames - a mapping from AppliedPTransforms to Step Namespublic String getJobId()
public String getProjectId()
public DataflowPipelineOptions getDataflowOptions()
public String getRegion()
public DataflowPipelineJob getReplacedByJob()
DataflowPipelineJob for the job that replaced this one, if applicable.IllegalStateException - if called before the job has terminated or if the job terminated
but was not updated@Nullable public PipelineResult.State waitUntilFinish()
waitUntilFinish in interface PipelineResult@Nullable public PipelineResult.State waitUntilFinish(org.joda.time.Duration duration)
waitUntilFinish in interface PipelineResult@Nullable public PipelineResult.State waitUntilFinish(org.joda.time.Duration duration, MonitoringUtil.JobMessagesHandler messageHandler) throws IOException, 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.IOException - If there is a persistent problem getting job
information.InterruptedExceptionpublic PipelineResult.State cancel() throws IOException
cancel in interface PipelineResultIOExceptionpublic PipelineResult.State getState()
getState in interface PipelineResultpublic MetricResults metrics()
metrics in interface PipelineResultCopyright © 2016–2017 The Apache Software Foundation. All rights reserved.