Created
January 25, 2021 17:59
-
-
Save iht/d4119a34399f08ee704272811d2d5570 to your computer and use it in GitHub Desktop.
Relay your custom options to Dataflow, assuming your are using Flex Templates
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.beam.runners.dataflow.options.DataflowPipelineOptions; | |
import org.apache.beam.sdk.options.PipelineOptionsFactory; | |
public static void main(String[] args) { | |
PipelineOptions opts = | |
PipelineOptionsFactory.fromArgs(args); | |
DataflowPipelineOptions dataflowPipelineOptions = | |
opts.as(DataflowPipelineOptions.class); | |
if (opts.iWantStreamingEngine) { | |
dataflowPipelineOptions.setEnableStreamingEngine(true); | |
} else { | |
dataflowPipelineOptions.setEnableStreamingEngine(false); | |
} | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment