From 60dcc42f8d5bbb3a002ca66ceaa4dd2b2bdb526a Mon Sep 17 00:00:00 2001 From: Hadar Hod Date: Wed, 3 May 2017 15:08:40 -0700 Subject: [PATCH 1/2] Transfer some content from Create Your Pipeline to the Programming Guide. --- .../pipelines/create-your-pipeline.md | 76 +--------- src/documentation/programming-guide.md | 132 ++++++++++++------ 2 files changed, 91 insertions(+), 117 deletions(-) diff --git a/src/documentation/pipelines/create-your-pipeline.md b/src/documentation/pipelines/create-your-pipeline.md index 120ec356d29..b7654671639 100644 --- a/src/documentation/pipelines/create-your-pipeline.md +++ b/src/documentation/pipelines/create-your-pipeline.md @@ -22,7 +22,7 @@ A Beam program often starts by creating a `Pipeline` object. In the Beam SDKs, each pipeline is represented by an explicit object of type `Pipeline`. Each `Pipeline` object is an independent entity that encapsulates both the data the pipeline operates over and the transforms that get applied to that data. -To create a pipeline, declare a `Pipeline` object, and pass it some configuration options, which are explained in a section below. You pass the configuration options by creating an object of type `PipelineOptions`, which you can build by using the static method `PipelineOptionsFactory.create()`. +To create a pipeline, declare a `Pipeline` object, and pass it some [configuration options]({{ site.baseurl }}/documentation/programming-guide#options). ```java // Start by defining the options for the pipeline. @@ -32,71 +32,6 @@ PipelineOptions options = PipelineOptionsFactory.create(); Pipeline p = Pipeline.create(options); ``` -### Configuring Pipeline Options - -Use the pipeline options to configure different aspects of your pipeline, such as the pipeline runner that will execute your pipeline and any runner-specific configuration required by the chosen runner. Your pipeline options will potentially include information such as your project ID or a location for storing files. - -When you run the pipeline on a runner of your choice, a copy of the PipelineOptions will be available to your code. For example, you can read PipelineOptions from a DoFn's Context. - -#### Setting PipelineOptions from Command-Line Arguments - -While you can configure your pipeline by creating a `PipelineOptions` object and setting the fields directly, the Beam SDKs include a command-line parser that you can use to set fields in `PipelineOptions` using command-line arguments. - -To read options from the command-line, construct your `PipelineOptions` object as demonstrated in the following example code: - -```java -MyOptions options = PipelineOptionsFactory.fromArgs(args).withValidation().create(); -``` - -This interprets command-line arguments that follow the format: - -```java ---