public class DataflowPipelineJob extends Object implements PipelineResult
DataflowPipelineRunner.PipelineResult.State| Constructor and Description |
|---|
DataflowPipelineJob(String projectId,
String jobId,
com.google.api.services.dataflow.Dataflow dataflowClient,
com.google.cloud.dataflow.sdk.runners.dataflow.DataflowAggregatorTransforms aggregatorTransforms)
Constructs the job.
|
| Modifier and Type | Method and Description |
|---|---|
void |
cancel()
Cancels the job.
|
<OutputT> AggregatorValues<OutputT> |
getAggregatorValues(Aggregator<?,OutputT> aggregator)
Retrieves the current value of the provided
Aggregator. |
com.google.api.services.dataflow.Dataflow |
getDataflowClient() |
String |
getJobId() |
String |
getProjectId() |
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.
|
PipelineResult.State |
waitToFinish(long timeToWait,
TimeUnit timeUnit,
com.google.cloud.dataflow.sdk.util.MonitoringUtil.JobMessagesHandler messageHandler)
Waits for the job to finish and return the final status.
|
public DataflowPipelineJob(String projectId, String jobId, com.google.api.services.dataflow.Dataflow dataflowClient, com.google.cloud.dataflow.sdk.runners.dataflow.DataflowAggregatorTransforms aggregatorTransforms)
projectId - the project idjobId - the job iddataflowClient - the client for the Dataflow Servicepublic String getJobId()
public String getProjectId()
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 updatedpublic com.google.api.services.dataflow.Dataflow getDataflowClient()
@Nullable public PipelineResult.State waitToFinish(long timeToWait, TimeUnit timeUnit, com.google.cloud.dataflow.sdk.util.MonitoringUtil.JobMessagesHandler messageHandler) throws IOException, InterruptedException
timeToWait - The time to wait in units timeUnit for the job to finish.
Provide a value less than 1 ms for an infinite wait.timeUnit - The unit of time for timeToWait.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 void cancel()
throws IOException
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 <OutputT> AggregatorValues<OutputT> getAggregatorValues(Aggregator<?,OutputT> aggregator) throws AggregatorRetrievalException
PipelineResultAggregator.getAggregatorValues in interface PipelineResultaggregator - the Aggregator to retrieve values forAggregatorRetrievalException - if the aggregator values could not be retrieved