public class BlockingDataflowPipelineRunner extends PipelineRunner<DataflowPipelineJob>
PipelineRunner that's like DataflowPipelineRunner
but that waits for the launched job to finish.
Prints out job status updates and console messages while it waits.
Returns the final job state, or throws an exception if the job fails or cannot be monitored.
BlockingDataflowPipelineRunner, the Google cloudservices account and the Google compute
engine service account of the GCP project running the Dataflow Job will need access to the
corresponding source/sink.
Please see Google Cloud Dataflow Security and Permissions for more details.
| Modifier | Constructor and Description |
|---|---|
protected |
BlockingDataflowPipelineRunner(DataflowPipelineRunner internalRunner,
BlockingDataflowPipelineOptions options) |
| Modifier and Type | Method and Description |
|---|---|
<OutputT extends POutput,InputT extends PInput> |
apply(PTransform<InputT,OutputT> transform,
InputT input)
Applies a transform to the given input, returning the output.
|
static BlockingDataflowPipelineRunner |
fromOptions(PipelineOptions options)
Constructs a runner from the provided options.
|
DataflowPipelineJob |
run(Pipeline p)
Processes the given Pipeline, returning the results.
|
void |
setHooks(DataflowPipelineRunnerHooks hooks)
Sets callbacks to invoke during execution see
DataflowPipelineRunnerHooks. |
String |
toString() |
protected BlockingDataflowPipelineRunner(DataflowPipelineRunner internalRunner, BlockingDataflowPipelineOptions options)
public static BlockingDataflowPipelineRunner fromOptions(PipelineOptions options)
public DataflowPipelineJob run(Pipeline p)
run in class PipelineRunner<DataflowPipelineJob>DataflowJobExecutionException - if there is an exception during job execution.DataflowServiceException - if there is an exception retrieving information about the job.public <OutputT extends POutput,InputT extends PInput> OutputT apply(PTransform<InputT,OutputT> transform, InputT input)
PipelineRunnerThe default implementation calls PTransform.apply(input), but can be overridden to customize behavior for a particular runner.
apply in class PipelineRunner<DataflowPipelineJob>@Experimental public void setHooks(DataflowPipelineRunnerHooks hooks)
DataflowPipelineRunnerHooks.