use of org.apache.beam.sdk.options.PortablePipelineOptions in project beam by apache.
the class ExpansionService method createPipeline.
protected Pipeline createPipeline() {
// TODO: [BEAM-12599]: implement proper validation
PipelineOptions effectiveOpts = PipelineOptionsFactory.create();
PortablePipelineOptions portableOptions = effectiveOpts.as(PortablePipelineOptions.class);
PortablePipelineOptions specifiedOptions = pipelineOptions.as(PortablePipelineOptions.class);
Optional.ofNullable(specifiedOptions.getDefaultEnvironmentType()).ifPresent(portableOptions::setDefaultEnvironmentType);
Optional.ofNullable(specifiedOptions.getDefaultEnvironmentConfig()).ifPresent(portableOptions::setDefaultEnvironmentConfig);
effectiveOpts.as(ExperimentalOptions.class).setExperiments(pipelineOptions.as(ExperimentalOptions.class).getExperiments());
effectiveOpts.setRunner(NotRunnableRunner.class);
return Pipeline.create(effectiveOpts);
}
Aggregations