Java Code Examples for com.google.cloud.dataflow.sdk.transforms.ParDo#Bound

The following examples show how to use com.google.cloud.dataflow.sdk.transforms.ParDo#Bound . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DockerDo.java    From dockerflow with Apache License 2.0 4 votes vote down vote up
/** Scatter on the inputs to run multiple Docker tasks in parallel. */
public static ParDo.Bound<KV<String, WorkflowArgs>, KV<String, WorkflowArgs>> scatter(Task t) {
  return ParDo.named("Scatter").of(new ScatterTasks(t));
}
 
Example 2
Source File: FlinkBatchTransformTranslators.java    From flink-dataflow with Apache License 2.0 3 votes vote down vote up
@Override
public void translateNode(ParDo.Bound<IN, OUT> transform, FlinkBatchTranslationContext context) {
	DataSet<IN> inputDataSet = context.getInputDataSet(context.getInput(transform));

	final DoFn<IN, OUT> doFn = transform.getFn();

	TypeInformation<OUT> typeInformation = context.getTypeInfo(context.getOutput(transform));

	FlinkDoFnFunction<IN, OUT> doFnWrapper = new FlinkDoFnFunction<>(doFn, context.getPipelineOptions());
	MapPartitionOperator<IN, OUT> outputDataSet = new MapPartitionOperator<>(inputDataSet, typeInformation, doFnWrapper, transform.getName());

	transformSideInputs(transform.getSideInputs(), outputDataSet, context);

	context.setOutputDataSet(context.getOutput(transform), outputDataSet);
}