You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by jk...@apache.org on 2017/05/15 19:16:31 UTC

[1/4] beam-site git commit: [BEAM-1353] Style Guide fixups

Repository: beam-site
Updated Branches:
  refs/heads/asf-site 9cc5b2280 -> 9ffe5ec58


[BEAM-1353] Style Guide fixups

Fixes usages of PTransforms affected by changes as part of
https://issues.apache.org/jira/browse/BEAM-1353


Project: http://git-wip-us.apache.org/repos/asf/beam-site/repo
Commit: http://git-wip-us.apache.org/repos/asf/beam-site/commit/e78f8f27
Tree: http://git-wip-us.apache.org/repos/asf/beam-site/tree/e78f8f27
Diff: http://git-wip-us.apache.org/repos/asf/beam-site/diff/e78f8f27

Branch: refs/heads/asf-site
Commit: e78f8f276a6cbf3156e0f7af3dd4ae1d9b92ee7a
Parents: 0d0da02
Author: Eugene Kirpichov <ki...@google.com>
Authored: Fri May 12 16:07:19 2017 -0700
Committer: Eugene Kirpichov <ki...@google.com>
Committed: Mon May 15 11:28:52 2017 -0700

----------------------------------------------------------------------
 .../pipelines/create-your-pipeline.md           |  4 +-
 .../pipelines/design-your-pipeline.md           | 20 ++++----
 src/documentation/programming-guide.md          | 54 ++++++++++----------
 src/documentation/sdks/java-extensions.md       |  2 +-
 src/get-started/mobile-gaming-example.md        | 20 ++++----
 src/get-started/wordcount-example.md            |  6 +--
 6 files changed, 53 insertions(+), 53 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/beam-site/blob/e78f8f27/src/documentation/pipelines/create-your-pipeline.md
----------------------------------------------------------------------
diff --git a/src/documentation/pipelines/create-your-pipeline.md b/src/documentation/pipelines/create-your-pipeline.md
index b765467..cbf7d31 100644
--- a/src/documentation/pipelines/create-your-pipeline.md
+++ b/src/documentation/pipelines/create-your-pipeline.md
@@ -42,7 +42,7 @@ The following example code shows how to `apply` a `TextIO.Read` root transform t
 
 ```java
 PCollection<String> lines = p.apply(
-  "ReadLines", TextIO.Read.from("gs://some/inputData.txt"));
+  "ReadLines", TextIO.read().from("gs://some/inputData.txt"));
 ```
 
 ## Applying Transforms to Process Pipeline Data
@@ -68,7 +68,7 @@ The following example code shows how to `apply` a `TextIO.Write` transform to wr
 ```java
 PCollection<String> filteredWords = ...;
 
-filteredWords.apply("WriteMyFile", TextIO.Write.to("gs://some/outputData.txt"));
+filteredWords.apply("WriteMyFile", TextIO.write().to("gs://some/outputData.txt"));
 ```
 
 ## Running Your Pipeline

http://git-wip-us.apache.org/repos/asf/beam-site/blob/e78f8f27/src/documentation/pipelines/design-your-pipeline.md
----------------------------------------------------------------------
diff --git a/src/documentation/pipelines/design-your-pipeline.md b/src/documentation/pipelines/design-your-pipeline.md
index c40803c..ce6a734 100644
--- a/src/documentation/pipelines/design-your-pipeline.md
+++ b/src/documentation/pipelines/design-your-pipeline.md
@@ -103,13 +103,7 @@ final TupleTag<String> startsWithATag = new TupleTag<String>(){};
 final TupleTag<String> startsWithBTag = new TupleTag<String>(){};
 
 PCollectionTuple mixedCollection =
-    dbRowCollection.apply(
-        ParDo
-        // Specify main output. In this example, it is the output
-        // with tag startsWithATag.
-        .withOutputTags(startsWithATag,
-        // Specify the output with tag startsWithBTag, as a TupleTagList.
-                        TupleTagList.of(startsWithBTag))
+    dbRowCollection.apply(ParDo
         .of(new DoFn<String, String>() {
           @ProcessElement
           public void processElement(ProcessContext c) {
@@ -121,8 +115,12 @@ PCollectionTuple mixedCollection =
               c.output(startsWithBTag, c.element());
             }
           }
-        }
-        ));
+        })
+        // Specify main output. In this example, it is the output
+        // with tag startsWithATag.
+        .withOutputTags(startsWithATag,
+        // Specify the output with tag startsWithBTag, as a TupleTagList.
+                        TupleTagList.of(startsWithBTag)));
 
 // Get subset of the output with tag startsWithATag.
 mixedCollection.get(startsWithATag).apply(...);
@@ -159,7 +157,7 @@ mergedCollectionWithFlatten.apply(...);
 
 ## Multiple sources
 
-Your pipeline can read its input from one or more sources. If your pipeline reads from multiple sources and the data from those sources is related, it can be useful to join the inputs together. In the example illustrated in Figure 5 below, the pipeline reads names and addresses from a database table, and names and order numbers from a text file. The pipeline then uses `CoGroupByKey` to join this information, where the key is the name; the resulting `PCollection` contains all the combinations of names, addresses, and orders.
+Your pipeline can read its input from one or more sources. If your pipeline reads from multiple sources and the data from those sources is related, it can be useful to join the inputs together. In the example illustrated in Figure 5 below, the pipeline reads names and addresses from a database table, and names and order numbers from a Kafka topic. The pipeline then uses `CoGroupByKey` to join this information, where the key is the name; the resulting `PCollection` contains all the combinations of names, addresses, and orders.
 
 <figure id="fig5">
     <img src="{{ site.baseurl }}/images/design-your-pipeline-join.png"
@@ -169,7 +167,7 @@ Figure 5: A pipeline with multiple input sources. See the example code below:
 ```java
 PCollection<KV<String, String>> userAddress = pipeline.apply(JdbcIO.<KV<String, String>>read()...);
 
-PCollection<KV<String, String>> userOrder = pipeline.apply(TextIO.<KV<String, String>>read()...);
+PCollection<KV<String, String>> userOrder = pipeline.apply(KafkaIO.<String, String>read()...);
 
 final TupleTag<String> addressTag = new TupleTag<String>();
 final TupleTag<String> orderTag = new TupleTag<String>();

http://git-wip-us.apache.org/repos/asf/beam-site/blob/e78f8f27/src/documentation/programming-guide.md
----------------------------------------------------------------------
diff --git a/src/documentation/programming-guide.md b/src/documentation/programming-guide.md
index f70e255..d7e37a0 100644
--- a/src/documentation/programming-guide.md
+++ b/src/documentation/programming-guide.md
@@ -191,7 +191,7 @@ public static void main(String[] args) {
 
     // Create the PCollection 'lines' by applying a 'Read' transform.
     PCollection<String> lines = p.apply(
-      "ReadMyFile", TextIO.Read.from("protocol://path/to/some/inputData.txt"));
+      "ReadMyFile", TextIO.read().from("protocol://path/to/some/inputData.txt"));
 }
 ```
 
@@ -479,8 +479,8 @@ PCollection<String> words = ...;
 // Apply a MapElements with an anonymous lambda function to the PCollection words.
 // Save the result as the PCollection wordLengths.
 PCollection<Integer> wordLengths = words.apply(
-  MapElements.via((String word) -> word.length())
-      .withOutputType(new TypeDescriptor<Integer>() {});
+  MapElements.into(TypeDescriptors.integers())
+             .via((String word) -> word.length()));
 ```
 
 ```py
@@ -862,16 +862,18 @@ Side inputs are useful if your `ParDo` needs to inject additional data when proc
 
   // Apply a ParDo that takes maxWordLengthCutOffView as a side input.
   PCollection<String> wordsBelowCutOff =
-  words.apply(ParDo.withSideInputs(maxWordLengthCutOffView)
-                    .of(new DoFn<String, String>() {
-      public void processElement(ProcessContext c) {
-        String word = c.element();
-        // In our DoFn, access the side input.
-        int lengthCutOff = c.sideInput(maxWordLengthCutOffView);
-        if (word.length() <= lengthCutOff) {
-          c.output(word);
-        }
-  }}));
+  words.apply(ParDo
+      .of(new DoFn<String, String>() {
+          public void processElement(ProcessContext c) {
+            String word = c.element();
+            // In our DoFn, access the side input.
+            int lengthCutOff = c.sideInput(maxWordLengthCutOffView);
+            if (word.length() <= lengthCutOff) {
+              c.output(word);
+            }
+          }
+      }).withSideInputs(maxWordLengthCutOffView)
+  );
 ```
 
 ```py
@@ -943,17 +945,16 @@ While `ParDo` always produces a main output `PCollection` (as the return value f
 // to our ParDo. Note that all of the outputs (including the main output PCollection) are bundled into the returned PCollectionTuple.
 
   PCollectionTuple results =
-      words.apply(
-          ParDo
+      words.apply(ParDo
+          .of(new DoFn<String, String>() {
+            // DoFn continues here.
+            ...
+          })
           // Specify the tag for the main output.
           .withOutputTags(wordsBelowCutOffTag,
           // Specify the tags for the two additional outputs as a TupleTagList.
                           TupleTagList.of(wordLengthsAboveCutOffTag)
-                                      .and(markedWordsTag))
-          .of(new DoFn<String, String>() {
-            // DoFn continues here.
-            ...
-          }
+                                      .and(markedWordsTag)));
 ```
 
 ```py
@@ -1114,7 +1115,7 @@ Read transforms read data from an external source and return a `PCollection` rep
 #### Using a read transform:
 
 ```java
-PCollection<String> lines = p.apply(TextIO.Read.from("gs://some/inputData.txt"));
+PCollection<String> lines = p.apply(TextIO.read().from("gs://some/inputData.txt"));
 ```
 
 ```py
@@ -1128,7 +1129,7 @@ Write transforms write the data in a `PCollection` to an external data source. Y
 #### Using a Write transform:
 
 ```java
-output.apply(TextIO.Write.to("gs://some/outputData"));
+output.apply(TextIO.write().to("gs://some/outputData"));
 ```
 
 ```py
@@ -1143,7 +1144,7 @@ Many read transforms support reading from multiple input files matching a glob o
 
 ```java
 p.apply(“ReadFromText”,
-    TextIO.Read.from("protocol://my_bucket/path/to/input-*.csv");
+    TextIO.read().from("protocol://my_bucket/path/to/input-*.csv");
 ```
 
 ```py
@@ -1161,7 +1162,7 @@ The following write transform example writes multiple output files to a location
 
 ```java
 records.apply("WriteToText",
-    TextIO.Write.to("protocol://my_bucket/path/to/numbers")
+    TextIO.write().to("protocol://my_bucket/path/to/numbers")
                 .withSuffix(".csv"));
 ```
 
@@ -1563,7 +1564,7 @@ You can allow late data by invoking the `.withAllowedLateness` operation when yo
               .withAllowedLateness(Duration.standardDays(2)));
 ```
 
-When you set `.withAllowedLateness` on a `PCollection`, that allowed lateness propagates forward to any subsequent `PCollection` derived from the first `PCollection` you applied allowed lateness to. If you want to change the allowed lateness later in your pipeline, you must do so explictly by applying `Window.withAllowedLateness()` again.
+When you set `.withAllowedLateness` on a `PCollection`, that allowed lateness propagates forward to any subsequent `PCollection` derived from the first `PCollection` you applied allowed lateness to. If you want to change the allowed lateness later in your pipeline, you must do so explictly by applying `Window.configure().withAllowedLateness()`.
 
 
 ### Adding timestamps to a PCollection's elements
@@ -1737,7 +1738,7 @@ You set the allowed lateness by using `.withAllowedLateness()` when you set your
   # The Beam SDK for Python does not support triggers.
 ```
 
-This allowed lateness propagates to all `PCollection`s derived as a result of applying transforms to the original `PCollection`. If you want to change the allowed lateness later in your pipeline, you can apply `Window.withAllowedLateness()` again, explicitly.
+This allowed lateness propagates to all `PCollection`s derived as a result of applying transforms to the original `PCollection`. If you want to change the allowed lateness later in your pipeline, you can apply `Window.configure().withAllowedLateness()` again, explicitly.
 
 
 ### <a name="composite-triggers"></a>Composite Triggers
@@ -1770,6 +1771,7 @@ You can express this pattern using `AfterWatermark.pastEndOfWindow`. For example
 
 ```java
   .apply(Window
+      .configure()
       .triggering(AfterWatermark
            .pastEndOfWindow()
            .withLateFirings(AfterProcessingTime

http://git-wip-us.apache.org/repos/asf/beam-site/blob/e78f8f27/src/documentation/sdks/java-extensions.md
----------------------------------------------------------------------
diff --git a/src/documentation/sdks/java-extensions.md b/src/documentation/sdks/java-extensions.md
index a4694af..17a79e7 100644
--- a/src/documentation/sdks/java-extensions.md
+++ b/src/documentation/sdks/java-extensions.md
@@ -55,5 +55,5 @@ PCollection<KV<String, Iterable<KV<String, Integer>>>> grouped =
 // For every primary key, sort the iterable of <SecondaryKey, Value> pairs by secondary key.
 PCollection<KV<String, Iterable<KV<String, Integer>>>> groupedAndSorted =
     grouped.apply(
-        SortValues.<String, String, Integer>create(new BufferedExternalSorter.Options()));
+        SortValues.<String, String, Integer>create(BufferedExternalSorter.options()));
 ```

http://git-wip-us.apache.org/repos/asf/beam-site/blob/e78f8f27/src/get-started/mobile-gaming-example.md
----------------------------------------------------------------------
diff --git a/src/get-started/mobile-gaming-example.md b/src/get-started/mobile-gaming-example.md
index 5c97274..9e59274 100644
--- a/src/get-started/mobile-gaming-example.md
+++ b/src/get-started/mobile-gaming-example.md
@@ -107,9 +107,9 @@ public static class ExtractAndSumScore
 
     return gameInfo
       .apply(MapElements
-          .via((GameActionInfo gInfo) -> KV.of(gInfo.getKey(field), gInfo.getScore()))
-          .withOutputType(
-              TypeDescriptors.kvs(TypeDescriptors.strings(), TypeDescriptors.integers())))
+          .into(
+              TypeDescriptors.kvs(TypeDescriptors.strings(), TypeDescriptors.integers()))
+          .via((GameActionInfo gInfo) -> KV.of(gInfo.getKey(field), gInfo.getScore())))
       .apply(Sum.<String>integersPerKey());
   }
 }
@@ -148,7 +148,7 @@ public static void main(String[] args) throws Exception {
   Pipeline pipeline = Pipeline.create(options);
 
   // Read events from a text file and parse them.
-  pipeline.apply(TextIO.Read.from(options.getInput()))
+  pipeline.apply(TextIO.read().from(options.getInput()))
     .apply("ParseGameEvent", ParDo.of(new ParseEventFn()))
     // Extract and sum username/score pairs from the event data.
     .apply("ExtractUserScore", new ExtractAndSumScore("user"))
@@ -314,7 +314,7 @@ public static void main(String[] args) throws Exception {
   final Instant startMinTimestamp = new Instant(minFmt.parseMillis(options.getStartMin()));
 
   // Read 'gaming' events from a text file.
-  pipeline.apply(TextIO.Read.from(options.getInput()))
+  pipeline.apply(TextIO.read().from(options.getInput()))
     // Parse the incoming data.
     .apply("ParseGameEvent", ParDo.of(new ParseEventFn()))
 
@@ -601,8 +601,6 @@ public static class CalculateSpammyUsers
     // Filter the user sums using the global mean.
     PCollection<KV<String, Integer>> filtered = sumScores
         .apply("ProcessAndFilter", ParDo
-            // use the derived mean total score as a side input
-            .withSideInputs(globalMeanScore)
             .of(new DoFn<KV<String, Integer>, KV<String, Integer>>() {
               private final Aggregator<Long, Long> numSpammerUsers =
                 createAggregator("SpammerUsers", new Sum.SumLongFn());
@@ -617,7 +615,9 @@ public static class CalculateSpammyUsers
                   c.output(c.element());
                 }
               }
-            }));
+            })
+            // use the derived mean total score as a side input
+            .withSideInputs(globalMeanScore));
     return filtered;
   }
 }
@@ -635,7 +635,6 @@ rawEvents
       FixedWindows.of(Duration.standardMinutes(options.getFixedWindowDuration()))))
   // Filter out the detected spammer users, using the side input derived above.
   .apply("FilterOutSpammers", ParDo
-          .withSideInputs(spammersView)
           .of(new DoFn<GameActionInfo, GameActionInfo>() {
             @ProcessElement
             public void processElement(ProcessContext c) {
@@ -644,7 +643,8 @@ rawEvents
                 c.output(c.element());
               }
             }
-          }))
+          })
+          .withSideInputs(spammersView))
   // Extract and sum teamname/score pairs from the event data.
   .apply("ExtractTeamScore", new ExtractAndSumScore("team"))
 ```

http://git-wip-us.apache.org/repos/asf/beam-site/blob/e78f8f27/src/get-started/wordcount-example.md
----------------------------------------------------------------------
diff --git a/src/get-started/wordcount-example.md b/src/get-started/wordcount-example.md
index 503f930..023086d 100644
--- a/src/get-started/wordcount-example.md
+++ b/src/get-started/wordcount-example.md
@@ -96,7 +96,7 @@ The Minimal WordCount pipeline contains five transforms:
 1.  A text file `Read` transform is applied to the Pipeline object itself, and produces a `PCollection` as output. Each element in the output PCollection represents one line of text from the input file. This example uses input data stored in a publicly accessible Google Cloud Storage bucket ("gs://").
 
     ```java
-    p.apply(TextIO.Read.from("gs://apache-beam-samples/shakespeare/*"))
+    p.apply(TextIO.read().from("gs://apache-beam-samples/shakespeare/*"))
     ```
 
     ```py
@@ -157,7 +157,7 @@ The Minimal WordCount pipeline contains five transforms:
 5.  A text file write transform. This transform takes the final `PCollection` of formatted Strings as input and writes each element to an output text file. Each element in the input `PCollection` represents one line of text in the resulting output file.
 
     ```java
-    .apply(TextIO.Write.to("wordcounts"));
+    .apply(TextIO.write().to("wordcounts"));
     ```
 
     ```py
@@ -398,7 +398,7 @@ public static void main(String[] args) throws IOException {
     Pipeline pipeline = Pipeline.create(options);
 
     PCollection<String> input = pipeline
-      .apply(TextIO.Read.from(options.getInputFile()))
+      .apply(TextIO.read().from(options.getInputFile()))
 
 ```
 


[4/4] beam-site git commit: This closes #243

Posted by jk...@apache.org.
This closes #243


Project: http://git-wip-us.apache.org/repos/asf/beam-site/repo
Commit: http://git-wip-us.apache.org/repos/asf/beam-site/commit/9ffe5ec5
Tree: http://git-wip-us.apache.org/repos/asf/beam-site/tree/9ffe5ec5
Diff: http://git-wip-us.apache.org/repos/asf/beam-site/diff/9ffe5ec5

Branch: refs/heads/asf-site
Commit: 9ffe5ec58b17976c3082bf31e6c1c68ee52b02a5
Parents: 9cc5b22 846a886
Author: Eugene Kirpichov <ki...@google.com>
Authored: Mon May 15 12:15:37 2017 -0700
Committer: Eugene Kirpichov <ki...@google.com>
Committed: Mon May 15 12:15:37 2017 -0700

----------------------------------------------------------------------
 .../pipelines/create-your-pipeline/index.html   |  4 +-
 .../pipelines/design-your-pipeline/index.html   | 20 ++---
 .../documentation/programming-guide/index.html  | 94 ++++++++------------
 .../sdks/java-extensions/index.html             |  2 +-
 .../mobile-gaming-example/index.html            | 20 ++---
 .../get-started/wordcount-example/index.html    |  6 +-
 .../pipelines/create-your-pipeline.md           |  4 +-
 .../pipelines/design-your-pipeline.md           | 20 ++---
 src/documentation/programming-guide.md          | 92 ++++++++-----------
 src/documentation/sdks/java-extensions.md       |  2 +-
 src/get-started/mobile-gaming-example.md        | 20 ++---
 src/get-started/wordcount-example.md            |  6 +-
 12 files changed, 124 insertions(+), 166 deletions(-)
----------------------------------------------------------------------



[2/4] beam-site git commit: Rewrites the section on Coders to not talk about them as a parsing mechanism

Posted by jk...@apache.org.
Rewrites the section on Coders to not talk about them as a parsing mechanism


Project: http://git-wip-us.apache.org/repos/asf/beam-site/repo
Commit: http://git-wip-us.apache.org/repos/asf/beam-site/commit/0d0da026
Tree: http://git-wip-us.apache.org/repos/asf/beam-site/tree/0d0da026
Diff: http://git-wip-us.apache.org/repos/asf/beam-site/diff/0d0da026

Branch: refs/heads/asf-site
Commit: 0d0da0265d8a3ee07493feec835e56efd6acfd85
Parents: 9cc5b22
Author: Eugene Kirpichov <ki...@google.com>
Authored: Fri May 12 16:06:09 2017 -0700
Committer: Eugene Kirpichov <ki...@google.com>
Committed: Mon May 15 11:28:52 2017 -0700

----------------------------------------------------------------------
 src/documentation/programming-guide.md | 38 ++++++-----------------------
 1 file changed, 8 insertions(+), 30 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/beam-site/blob/0d0da026/src/documentation/programming-guide.md
----------------------------------------------------------------------
diff --git a/src/documentation/programming-guide.md b/src/documentation/programming-guide.md
index 11ec86d..f70e255 100644
--- a/src/documentation/programming-guide.md
+++ b/src/documentation/programming-guide.md
@@ -1175,11 +1175,9 @@ See the  [Beam-provided I/O Transforms]({{site.baseurl }}/documentation/io/built
 
 ## <a name="coders"></a>Data encoding and type safety
 
-When you create or output pipeline data, you'll need to specify how the elements in your `PCollection`s are encoded and decoded to and from byte strings. Byte strings are used for intermediate storage as well reading from sources and writing to sinks. The Beam SDKs use objects called coders to describe how the elements of a given `PCollection` should be encoded and decoded.
+When Beam runners execute your pipeline, they often need to materialize the intermediate data in your `PCollection`s, which requires converting elements to and from byte strings. The Beam SDKs use objects called `Coder`s to describe how the elements of a given `PCollection` may be encoded and decoded.
 
-### Using coders
-
-You typically need to specify a coder when reading data into your pipeline from an external source (or creating pipeline data from local data), and also when you output pipeline data to an external sink.
+> Note that coders are unrelated to parsing or formatting data when interacting with external data sources or sinks. Such parsing or formatting should typically be done explicitly, using transforms such as `ParDo` or `MapElements`.
 
 {:.language-java}
 In the Beam SDK for Java, the type `Coder` provides the methods required for encoding and decoding data. The SDK for Java provides a number of Coder subclasses that work with a variety of standard Java types, such as Integer, Long, Double, StringUtf8 and more. You can find all of the available Coder subclasses in the [Coder package](https://github.com/apache/beam/tree/master/sdks/java/core/src/main/java/org/apache/beam/sdk/coders).
@@ -1187,38 +1185,18 @@ In the Beam SDK for Java, the type `Coder` provides the methods required for enc
 {:.language-py}
 In the Beam SDK for Python, the type `Coder` provides the methods required for encoding and decoding data. The SDK for Python provides a number of Coder subclasses that work with a variety of standard Python types, such as primitive types, Tuple, Iterable, StringUtf8 and more. You can find all of the available Coder subclasses in the [apache_beam.coders](https://github.com/apache/beam/tree/master/sdks/python/apache_beam/coders) package.
 
-When you read data into a pipeline, the coder indicates how to interpret the input data into a language-specific type, such as integer or string. Likewise, the coder indicates how the language-specific types in your pipeline should be written into byte strings for an output data sink, or to materialize intermediate data in your pipeline.
-
-The Beam SDKs set a coder for every `PCollection` in a pipeline, including those generated as output from a transform. Most of the time, the Beam SDKs can automatically infer the correct coder for an output `PCollection`.
-
 > Note that coders do not necessarily have a 1:1 relationship with types. For example, the Integer type can have multiple valid coders, and input and output data can use different Integer coders. A transform might have Integer-typed input data that uses BigEndianIntegerCoder, and Integer-typed output data that uses VarIntCoder.
 
-You can explicitly set a `Coder` when inputting or outputting a `PCollection`. You set the `Coder` by <span class="language-java">calling the method `.withCoder`</span> <span class="language-py">setting the `coder` argument</span> when you apply your pipeline's read or write transform.
-
-Typically, you set the `Coder` when the coder for a `PCollection` cannot be automatically inferred, or when you want to use a different coder than your pipeline's default. The following example code reads a set of numbers from a text file, and sets a `Coder` of type <span class="language-java">`TextualIntegerCoder`</span> <span class="language-py">`VarIntCoder`</span> for the resulting `PCollection`:
-
-```java
-PCollection<Integer> numbers =
-  p.begin()
-  .apply(TextIO.Read.named("ReadNumbers")
-    .from("gs://my_bucket/path/to/numbers-*.txt")
-    .withCoder(TextualIntegerCoder.of()));
-```
-
-```py
-p = beam.Pipeline()
-numbers = ReadFromText("gs://my_bucket/path/to/numbers-*.txt", coder=VarIntCoder())
-```
+### Specifying coders
+The Beam SDKs require a coder for every `PCollection` in your pipeline. In most cases, the Beam SDK is able to automatically infer a `Coder` for a `PCollection` based on its element type or the transform that produces it, however, in some cases the pipeline author will need to specify a `Coder` explicitly, or develop a `Coder` for their custom type.
 
 {:.language-java}
-You can set the coder for an existing `PCollection` by using the method `PCollection.setCoder`. Note that you cannot call `setCoder` on a `PCollection` that has been finalized (e.g. by calling `.apply` on it).
+You can explicitly set the coder for an existing `PCollection` by using the method `PCollection.setCoder`. Note that you cannot call `setCoder` on a `PCollection` that has been finalized (e.g. by calling `.apply` on it).
 
 {:.language-java}
-You can get the coder for an existing `PCollection` by using the method `getCoder`. This method will fail with `anIllegalStateException` if a coder has not been set and cannot be inferred for the given `PCollection`.
-
-### Coder inference and default coders
+You can get the coder for an existing `PCollection` by using the method `getCoder`. This method will fail with an `IllegalStateException` if a coder has not been set and cannot be inferred for the given `PCollection`.
 
-The Beam SDKs require a coder for every `PCollection` in your pipeline. Most of the time, however, you do not need to explicitly specify a coder, such as for an intermediate `PCollection` produced by a transform in the middle of your pipeline. In such cases, the Beam SDKs can infer an appropriate coder from the inputs and outputs of the transform used to produce the PCollection.
+Beam SDKs use a variety of mechanisms when attempting to automatically infer the `Coder` for a `PCollection`.
 
 {:.language-java}
 Each pipeline object has a `CoderRegistry`. The `CoderRegistry` represents a mapping of Java types to the default coders that the pipeline should use for `PCollection`s of each type.
@@ -1227,7 +1205,7 @@ Each pipeline object has a `CoderRegistry`. The `CoderRegistry` represents a map
 The Beam SDK for Python has a `CoderRegistry` that represents a mapping of Python types to the default coder that should be used for `PCollection`s of each type.
 
 {:.language-java}
-By default, the Beam SDK for Java automatically infers the `Coder` for the elements of an output `PCollection` using the type parameter from the transform's function object, such as `DoFn`. In the case of `ParDo`, for example, a `DoFn<Integer, String>function` object accepts an input element of type `Integer` and produces an output element of type `String`. In such a case, the SDK for Java will automatically infer the default `Coder` for the output `PCollection<String>` (in the default pipeline `CoderRegistry`, this is `StringUtf8Coder`).
+By default, the Beam SDK for Java automatically infers the `Coder` for the elements of a `PCollection` produced by a `PTransform` using the type parameter from the transform's function object, such as `DoFn`. In the case of `ParDo`, for example, a `DoFn<Integer, String>` function object accepts an input element of type `Integer` and produces an output element of type `String`. In such a case, the SDK for Java will automatically infer the default `Coder` for the output `PCollection<String>` (in the default pipeline `CoderRegistry`, this is `StringUtf8Coder`).
 
 {:.language-py}
 By default, the Beam SDK for Python automatically infers the `Coder` for the elements of an output `PCollection` using the typehints from the transform's function object, such as `DoFn`. In the case of `ParDo`, for example a `DoFn` with the typehints `@beam.typehints.with_input_types(int)` and `@beam.typehints.with_output_types(str)` accepts an input element of type int and produces an output element of type str. In such a case, the Beam SDK for Python will automatically infer the default `Coder` for the output `PCollection` (in the default pipeline `CoderRegistry`, this is `BytesCoder`).


[3/4] beam-site git commit: Regenerate website

Posted by jk...@apache.org.
Regenerate website


Project: http://git-wip-us.apache.org/repos/asf/beam-site/repo
Commit: http://git-wip-us.apache.org/repos/asf/beam-site/commit/846a8863
Tree: http://git-wip-us.apache.org/repos/asf/beam-site/tree/846a8863
Diff: http://git-wip-us.apache.org/repos/asf/beam-site/diff/846a8863

Branch: refs/heads/asf-site
Commit: 846a886371ca91513faf2f1db61641428ea05c2a
Parents: e78f8f2
Author: Eugene Kirpichov <ki...@google.com>
Authored: Mon May 15 12:15:03 2017 -0700
Committer: Eugene Kirpichov <ki...@google.com>
Committed: Mon May 15 12:15:03 2017 -0700

----------------------------------------------------------------------
 .../pipelines/create-your-pipeline/index.html   |  4 +-
 .../pipelines/design-your-pipeline/index.html   | 20 ++---
 .../documentation/programming-guide/index.html  | 94 ++++++++------------
 .../sdks/java-extensions/index.html             |  2 +-
 .../mobile-gaming-example/index.html            | 20 ++---
 .../get-started/wordcount-example/index.html    |  6 +-
 6 files changed, 63 insertions(+), 83 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/beam-site/blob/846a8863/content/documentation/pipelines/create-your-pipeline/index.html
----------------------------------------------------------------------
diff --git a/content/documentation/pipelines/create-your-pipeline/index.html b/content/documentation/pipelines/create-your-pipeline/index.html
index 6cfe938..4f31a5b 100644
--- a/content/documentation/pipelines/create-your-pipeline/index.html
+++ b/content/documentation/pipelines/create-your-pipeline/index.html
@@ -197,7 +197,7 @@
 <p>The following example code shows how to <code class="highlighter-rouge">apply</code> a <code class="highlighter-rouge">TextIO.Read</code> root transform to read data from a text file. The transform is applied to a <code class="highlighter-rouge">Pipeline</code> object <code class="highlighter-rouge">p</code>, and returns a pipeline data set in the form of a <code class="highlighter-rouge">PCollection&lt;String&gt;</code>:</p>
 
 <div class="language-java highlighter-rouge"><pre class="highlight"><code><span class="n">PCollection</span><span class="o">&lt;</span><span class="n">String</span><span class="o">&gt;</span> <span class="n">lines</span> <span class="o">=</span> <span class="n">p</span><span class="o">.</span><span class="na">apply</span><span class="o">(</span>
-  <span class="s">"ReadLines"</span><span class="o">,</span> <span class="n">TextIO</span><span class="o">.</span><span class="na">Read</span><span class="o">.</span><span class="na">from</span><span class="o">(</span><span class="s">"gs://some/inputData.txt"</span><span class="o">));</span>
+  <span class="s">"ReadLines"</span><span class="o">,</span> <span class="n">TextIO</span><span class="o">.</span><span class="na">read</span><span class="o">().</span><span class="na">from</span><span class="o">(</span><span class="s">"gs://some/inputData.txt"</span><span class="o">));</span>
 </code></pre>
 </div>
 
@@ -223,7 +223,7 @@
 
 <div class="language-java highlighter-rouge"><pre class="highlight"><code><span class="n">PCollection</span><span class="o">&lt;</span><span class="n">String</span><span class="o">&gt;</span> <span class="n">filteredWords</span> <span class="o">=</span> <span class="o">...;</span>
 
-<span class="n">filteredWords</span><span class="o">.</span><span class="na">apply</span><span class="o">(</span><span class="s">"WriteMyFile"</span><span class="o">,</span> <span class="n">TextIO</span><span class="o">.</span><span class="na">Write</span><span class="o">.</span><span class="na">to</span><span class="o">(</span><span class="s">"gs://some/outputData.txt"</span><span class="o">));</span>
+<span class="n">filteredWords</span><span class="o">.</span><span class="na">apply</span><span class="o">(</span><span class="s">"WriteMyFile"</span><span class="o">,</span> <span class="n">TextIO</span><span class="o">.</span><span class="na">write</span><span class="o">().</span><span class="na">to</span><span class="o">(</span><span class="s">"gs://some/outputData.txt"</span><span class="o">));</span>
 </code></pre>
 </div>
 

http://git-wip-us.apache.org/repos/asf/beam-site/blob/846a8863/content/documentation/pipelines/design-your-pipeline/index.html
----------------------------------------------------------------------
diff --git a/content/documentation/pipelines/design-your-pipeline/index.html b/content/documentation/pipelines/design-your-pipeline/index.html
index 2185418..2e7018e 100644
--- a/content/documentation/pipelines/design-your-pipeline/index.html
+++ b/content/documentation/pipelines/design-your-pipeline/index.html
@@ -259,13 +259,7 @@
 <span class="kd">final</span> <span class="n">TupleTag</span><span class="o">&lt;</span><span class="n">String</span><span class="o">&gt;</span> <span class="n">startsWithBTag</span> <span class="o">=</span> <span class="k">new</span> <span class="n">TupleTag</span><span class="o">&lt;</span><span class="n">String</span><span class="o">&gt;(){};</span>
 
 <span class="n">PCollectionTuple</span> <span class="n">mixedCollection</span> <span class="o">=</span>
-    <span class="n">dbRowCollection</span><span class="o">.</span><span class="na">apply</span><span class="o">(</span>
-        <span class="n">ParDo</span>
-        <span class="c1">// Specify main output. In this example, it is the output</span>
-        <span class="c1">// with tag startsWithATag.</span>
-        <span class="o">.</span><span class="na">withOutputTags</span><span class="o">(</span><span class="n">startsWithATag</span><span class="o">,</span>
-        <span class="c1">// Specify the output with tag startsWithBTag, as a TupleTagList.</span>
-                        <span class="n">TupleTagList</span><span class="o">.</span><span class="na">of</span><span class="o">(</span><span class="n">startsWithBTag</span><span class="o">))</span>
+    <span class="n">dbRowCollection</span><span class="o">.</span><span class="na">apply</span><span class="o">(</span><span class="n">ParDo</span>
         <span class="o">.</span><span class="na">of</span><span class="o">(</span><span class="k">new</span> <span class="n">DoFn</span><span class="o">&lt;</span><span class="n">String</span><span class="o">,</span> <span class="n">String</span><span class="o">&gt;()</span> <span class="o">{</span>
           <span class="nd">@ProcessElement</span>
           <span class="kd">public</span> <span class="kt">void</span> <span class="nf">processElement</span><span class="o">(</span><span class="n">ProcessContext</span> <span class="n">c</span><span class="o">)</span> <span class="o">{</span>
@@ -277,8 +271,12 @@
               <span class="n">c</span><span class="o">.</span><span class="na">output</span><span class="o">(</span><span class="n">startsWithBTag</span><span class="o">,</span> <span class="n">c</span><span class="o">.</span><span class="na">element</span><span class="o">());</span>
             <span class="o">}</span>
           <span class="o">}</span>
-        <span class="o">}</span>
-        <span class="o">));</span>
+        <span class="o">})</span>
+        <span class="c1">// Specify main output. In this example, it is the output</span>
+        <span class="c1">// with tag startsWithATag.</span>
+        <span class="o">.</span><span class="na">withOutputTags</span><span class="o">(</span><span class="n">startsWithATag</span><span class="o">,</span>
+        <span class="c1">// Specify the output with tag startsWithBTag, as a TupleTagList.</span>
+                        <span class="n">TupleTagList</span><span class="o">.</span><span class="na">of</span><span class="o">(</span><span class="n">startsWithBTag</span><span class="o">)));</span>
 
 <span class="c1">// Get subset of the output with tag startsWithATag.</span>
 <span class="n">mixedCollection</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="n">startsWithATag</span><span class="o">).</span><span class="na">apply</span><span class="o">(...);</span>
@@ -317,7 +315,7 @@
 
 <h2 id="multiple-sources">Multiple sources</h2>
 
-<p>Your pipeline can read its input from one or more sources. If your pipeline reads from multiple sources and the data from those sources is related, it can be useful to join the inputs together. In the example illustrated in Figure 5 below, the pipeline reads names and addresses from a database table, and names and order numbers from a text file. The pipeline then uses <code class="highlighter-rouge">CoGroupByKey</code> to join this information, where the key is the name; the resulting <code class="highlighter-rouge">PCollection</code> contains all the combinations of names, addresses, and orders.</p>
+<p>Your pipeline can read its input from one or more sources. If your pipeline reads from multiple sources and the data from those sources is related, it can be useful to join the inputs together. In the example illustrated in Figure 5 below, the pipeline reads names and addresses from a database table, and names and order numbers from a Kafka topic. The pipeline then uses <code class="highlighter-rouge">CoGroupByKey</code> to join this information, where the key is the name; the resulting <code class="highlighter-rouge">PCollection</code> contains all the combinations of names, addresses, and orders.</p>
 
 <figure id="fig5">
     <img src="/images/design-your-pipeline-join.png" alt="A pipeline with multiple input sources." />
@@ -325,7 +323,7 @@
 <p>Figure 5: A pipeline with multiple input sources. See the example code below:</p>
 <div class="language-java highlighter-rouge"><pre class="highlight"><code><span class="n">PCollection</span><span class="o">&lt;</span><span class="n">KV</span><span class="o">&lt;</span><span class="n">String</span><span class="o">,</span> <span class="n">String</span><span class="o">&gt;&gt;</span> <span class="n">userAddress</span> <span class="o">=</span> <span class="n">pipeline</span><span class="o">.</span><span class="na">apply</span><span class="o">(</span><span class="n">JdbcIO</span><span class="o">.&lt;</span><span class="n">KV</span><span class="o">&lt;</span><span class="n">String</span><span class="o">,</span> <span class="n">String</span><span class="o">&gt;&gt;</span><span class="n">read</span><span class="o">()...);</span>
 
-<span class="n">PCollection</span><span class="o">&lt;</span><span class="n">KV</span><span class="o">&lt;</span><span class="n">String</span><span class="o">,</span> <span class="n">String</span><span class="o">&gt;&gt;</span> <span class="n">userOrder</span> <span class="o">=</span> <span class="n">pipeline</span><span class="o">.</span><span class="na">apply</span><span class="o">(</span><span class="n">TextIO</span><span class="o">.&lt;</span><span class="n">KV</span><span class="o">&lt;</span><span class="n">String</span><span class="o">,</span> <span class="n">String</span><span class="o">&gt;&gt;</span><span class="n">read</span><span class="o">()...);</span>
+<span class="n">PCollection</span><span class="o">&lt;</span><span class="n">KV</span><span class="o">&lt;</span><span class="n">String</span><span class="o">,</span> <span class="n">String</span><span class="o">&gt;&gt;</span> <span class="n">userOrder</span> <span class="o">=</span> <span class="n">pipeline</span><span class="o">.</span><span class="na">apply</span><span class="o">(</span><span class="n">KafkaIO</span><span class="o">.&lt;</span><span class="n">String</span><span class="o">,</span> <span class="n">String</span><span class="o">&gt;</span><span class="n">read</span><span class="o">()...);</span>
 
 <span class="kd">final</span> <span class="n">TupleTag</span><span class="o">&lt;</span><span class="n">String</span><span class="o">&gt;</span> <span class="n">addressTag</span> <span class="o">=</span> <span class="k">new</span> <span class="n">TupleTag</span><span class="o">&lt;</span><span class="n">String</span><span class="o">&gt;();</span>
 <span class="kd">final</span> <span class="n">TupleTag</span><span class="o">&lt;</span><span class="n">String</span><span class="o">&gt;</span> <span class="n">orderTag</span> <span class="o">=</span> <span class="k">new</span> <span class="n">TupleTag</span><span class="o">&lt;</span><span class="n">String</span><span class="o">&gt;();</span>

http://git-wip-us.apache.org/repos/asf/beam-site/blob/846a8863/content/documentation/programming-guide/index.html
----------------------------------------------------------------------
diff --git a/content/documentation/programming-guide/index.html b/content/documentation/programming-guide/index.html
index 3b3cb14..056dfda 100644
--- a/content/documentation/programming-guide/index.html
+++ b/content/documentation/programming-guide/index.html
@@ -376,7 +376,7 @@
 
     <span class="c1">// Create the PCollection 'lines' by applying a 'Read' transform.</span>
     <span class="n">PCollection</span><span class="o">&lt;</span><span class="n">String</span><span class="o">&gt;</span> <span class="n">lines</span> <span class="o">=</span> <span class="n">p</span><span class="o">.</span><span class="na">apply</span><span class="o">(</span>
-      <span class="s">"ReadMyFile"</span><span class="o">,</span> <span class="n">TextIO</span><span class="o">.</span><span class="na">Read</span><span class="o">.</span><span class="na">from</span><span class="o">(</span><span class="s">"protocol://path/to/some/inputData.txt"</span><span class="o">));</span>
+      <span class="s">"ReadMyFile"</span><span class="o">,</span> <span class="n">TextIO</span><span class="o">.</span><span class="na">read</span><span class="o">().</span><span class="na">from</span><span class="o">(</span><span class="s">"protocol://path/to/some/inputData.txt"</span><span class="o">));</span>
 <span class="o">}</span>
 </code></pre>
 </div>
@@ -681,8 +681,8 @@
 <span class="c1">// Apply a MapElements with an anonymous lambda function to the PCollection words.</span>
 <span class="c1">// Save the result as the PCollection wordLengths.</span>
 <span class="n">PCollection</span><span class="o">&lt;</span><span class="n">Integer</span><span class="o">&gt;</span> <span class="n">wordLengths</span> <span class="o">=</span> <span class="n">words</span><span class="o">.</span><span class="na">apply</span><span class="o">(</span>
-  <span class="n">MapElements</span><span class="o">.</span><span class="na">via</span><span class="o">((</span><span class="n">String</span> <span class="n">word</span><span class="o">)</span> <span class="o">-&gt;</span> <span class="n">word</span><span class="o">.</span><span class="na">length</span><span class="o">())</span>
-      <span class="o">.</span><span class="na">withOutputType</span><span class="o">(</span><span class="k">new</span> <span class="n">TypeDescriptor</span><span class="o">&lt;</span><span class="n">Integer</span><span class="o">&gt;()</span> <span class="o">{});</span>
+  <span class="n">MapElements</span><span class="o">.</span><span class="na">into</span><span class="o">(</span><span class="n">TypeDescriptors</span><span class="o">.</span><span class="na">integers</span><span class="o">())</span>
+             <span class="o">.</span><span class="na">via</span><span class="o">((</span><span class="n">String</span> <span class="n">word</span><span class="o">)</span> <span class="o">-&gt;</span> <span class="n">word</span><span class="o">.</span><span class="na">length</span><span class="o">()));</span>
 </code></pre>
 </div>
 
@@ -1104,16 +1104,18 @@ guest, [[], [order4]]
 
   <span class="c1">// Apply a ParDo that takes maxWordLengthCutOffView as a side input.</span>
   <span class="n">PCollection</span><span class="o">&lt;</span><span class="n">String</span><span class="o">&gt;</span> <span class="n">wordsBelowCutOff</span> <span class="o">=</span>
-  <span class="n">words</span><span class="o">.</span><span class="na">apply</span><span class="o">(</span><span class="n">ParDo</span><span class="o">.</span><span class="na">withSideInputs</span><span class="o">(</span><span class="n">maxWordLengthCutOffView</span><span class="o">)</span>
-                    <span class="o">.</span><span class="na">of</span><span class="o">(</span><span class="k">new</span> <span class="n">DoFn</span><span class="o">&lt;</span><span class="n">String</span><span class="o">,</span> <span class="n">String</span><span class="o">&gt;()</span> <span class="o">{</span>
-      <span class="kd">public</span> <span class="kt">void</span> <span class="nf">processElement</span><span class="o">(</span><span class="n">ProcessContext</span> <span class="n">c</span><span class="o">)</span> <span class="o">{</span>
-        <span class="n">String</span> <span class="n">word</span> <span class="o">=</span> <span class="n">c</span><span class="o">.</span><span class="na">element</span><span class="o">();</span>
-        <span class="c1">// In our DoFn, access the side input.</span>
-        <span class="kt">int</span> <span class="n">lengthCutOff</span> <span class="o">=</span> <span class="n">c</span><span class="o">.</span><span class="na">sideInput</span><span class="o">(</span><span class="n">maxWordLengthCutOffView</span><span class="o">);</span>
-        <span class="k">if</span> <span class="o">(</span><span class="n">word</span><span class="o">.</span><span class="na">length</span><span class="o">()</span> <span class="o">&lt;=</span> <span class="n">lengthCutOff</span><span class="o">)</span> <span class="o">{</span>
-          <span class="n">c</span><span class="o">.</span><span class="na">output</span><span class="o">(</span><span class="n">word</span><span class="o">);</span>
-        <span class="o">}</span>
-  <span class="o">}}));</span>
+  <span class="n">words</span><span class="o">.</span><span class="na">apply</span><span class="o">(</span><span class="n">ParDo</span>
+      <span class="o">.</span><span class="na">of</span><span class="o">(</span><span class="k">new</span> <span class="n">DoFn</span><span class="o">&lt;</span><span class="n">String</span><span class="o">,</span> <span class="n">String</span><span class="o">&gt;()</span> <span class="o">{</span>
+          <span class="kd">public</span> <span class="kt">void</span> <span class="nf">processElement</span><span class="o">(</span><span class="n">ProcessContext</span> <span class="n">c</span><span class="o">)</span> <span class="o">{</span>
+            <span class="n">String</span> <span class="n">word</span> <span class="o">=</span> <span class="n">c</span><span class="o">.</span><span class="na">element</span><span class="o">();</span>
+            <span class="c1">// In our DoFn, access the side input.</span>
+            <span class="kt">int</span> <span class="n">lengthCutOff</span> <span class="o">=</span> <span class="n">c</span><span class="o">.</span><span class="na">sideInput</span><span class="o">(</span><span class="n">maxWordLengthCutOffView</span><span class="o">);</span>
+            <span class="k">if</span> <span class="o">(</span><span class="n">word</span><span class="o">.</span><span class="na">length</span><span class="o">()</span> <span class="o">&lt;=</span> <span class="n">lengthCutOff</span><span class="o">)</span> <span class="o">{</span>
+              <span class="n">c</span><span class="o">.</span><span class="na">output</span><span class="o">(</span><span class="n">word</span><span class="o">);</span>
+            <span class="o">}</span>
+          <span class="o">}</span>
+      <span class="o">}).</span><span class="na">withSideInputs</span><span class="o">(</span><span class="n">maxWordLengthCutOffView</span><span class="o">)</span>
+  <span class="o">);</span>
 </code></pre>
 </div>
 
@@ -1212,17 +1214,16 @@ guest, [[], [order4]]
 <span class="c1">// to our ParDo. Note that all of the outputs (including the main output PCollection) are bundled into the returned PCollectionTuple.</span>
 
   <span class="n">PCollectionTuple</span> <span class="n">results</span> <span class="o">=</span>
-      <span class="n">words</span><span class="o">.</span><span class="na">apply</span><span class="o">(</span>
-          <span class="n">ParDo</span>
+      <span class="n">words</span><span class="o">.</span><span class="na">apply</span><span class="o">(</span><span class="n">ParDo</span>
+          <span class="o">.</span><span class="na">of</span><span class="o">(</span><span class="k">new</span> <span class="n">DoFn</span><span class="o">&lt;</span><span class="n">String</span><span class="o">,</span> <span class="n">String</span><span class="o">&gt;()</span> <span class="o">{</span>
+            <span class="c1">// DoFn continues here.</span>
+            <span class="o">...</span>
+          <span class="o">})</span>
           <span class="c1">// Specify the tag for the main output.</span>
           <span class="o">.</span><span class="na">withOutputTags</span><span class="o">(</span><span class="n">wordsBelowCutOffTag</span><span class="o">,</span>
           <span class="c1">// Specify the tags for the two additional outputs as a TupleTagList.</span>
                           <span class="n">TupleTagList</span><span class="o">.</span><span class="na">of</span><span class="o">(</span><span class="n">wordLengthsAboveCutOffTag</span><span class="o">)</span>
-                                      <span class="o">.</span><span class="na">and</span><span class="o">(</span><span class="n">markedWordsTag</span><span class="o">))</span>
-          <span class="o">.</span><span class="na">of</span><span class="o">(</span><span class="k">new</span> <span class="n">DoFn</span><span class="o">&lt;</span><span class="n">String</span><span class="o">,</span> <span class="n">String</span><span class="o">&gt;()</span> <span class="o">{</span>
-            <span class="c1">// DoFn continues here.</span>
-            <span class="o">...</span>
-          <span class="o">}</span>
+                                      <span class="o">.</span><span class="na">and</span><span class="o">(</span><span class="n">markedWordsTag</span><span class="o">)));</span>
 </code></pre>
 </div>
 
@@ -1432,7 +1433,7 @@ guest, [[], [order4]]
 
 <h4 id="using-a-read-transform">Using a read transform:</h4>
 
-<div class="language-java highlighter-rouge"><pre class="highlight"><code><span class="n">PCollection</span><span class="o">&lt;</span><span class="n">String</span><span class="o">&gt;</span> <span class="n">lines</span> <span class="o">=</span> <span class="n">p</span><span class="o">.</span><span class="na">apply</span><span class="o">(</span><span class="n">TextIO</span><span class="o">.</span><span class="na">Read</span><span class="o">.</span><span class="na">from</span><span class="o">(</span><span class="s">"gs://some/inputData.txt"</span><span class="o">));</span>
+<div class="language-java highlighter-rouge"><pre class="highlight"><code><span class="n">PCollection</span><span class="o">&lt;</span><span class="n">String</span><span class="o">&gt;</span> <span class="n">lines</span> <span class="o">=</span> <span class="n">p</span><span class="o">.</span><span class="na">apply</span><span class="o">(</span><span class="n">TextIO</span><span class="o">.</span><span class="na">read</span><span class="o">().</span><span class="na">from</span><span class="o">(</span><span class="s">"gs://some/inputData.txt"</span><span class="o">));</span>
 </code></pre>
 </div>
 
@@ -1446,7 +1447,7 @@ guest, [[], [order4]]
 
 <h4 id="using-a-write-transform">Using a Write transform:</h4>
 
-<div class="language-java highlighter-rouge"><pre class="highlight"><code><span class="n">output</span><span class="o">.</span><span class="na">apply</span><span class="o">(</span><span class="n">TextIO</span><span class="o">.</span><span class="na">Write</span><span class="o">.</span><span class="na">to</span><span class="o">(</span><span class="s">"gs://some/outputData"</span><span class="o">));</span>
+<div class="language-java highlighter-rouge"><pre class="highlight"><code><span class="n">output</span><span class="o">.</span><span class="na">apply</span><span class="o">(</span><span class="n">TextIO</span><span class="o">.</span><span class="na">write</span><span class="o">().</span><span class="na">to</span><span class="o">(</span><span class="s">"gs://some/outputData"</span><span class="o">));</span>
 </code></pre>
 </div>
 
@@ -1461,7 +1462,7 @@ guest, [[], [order4]]
 <p>Many read transforms support reading from multiple input files matching a glob operator you provide. Note that glob operators are filesystem-specific and obey filesystem-specific consistency models. The following TextIO example uses a glob operator (*) to read all matching input files that have prefix “input-“ and the suffix “.csv” in the given location:</p>
 
 <div class="language-java highlighter-rouge"><pre class="highlight"><code><span class="n">p</span><span class="o">.</span><span class="na">apply</span><span class="o">(</span><span class="err">“</span><span class="n">ReadFromText</span><span class="err">”</span><span class="o">,</span>
-    <span class="n">TextIO</span><span class="o">.</span><span class="na">Read</span><span class="o">.</span><span class="na">from</span><span class="o">(</span><span class="s">"protocol://my_bucket/path/to/input-*.csv"</span><span class="o">);</span>
+    <span class="n">TextIO</span><span class="o">.</span><span class="na">read</span><span class="o">().</span><span class="na">from</span><span class="o">(</span><span class="s">"protocol://my_bucket/path/to/input-*.csv"</span><span class="o">);</span>
 </code></pre>
 </div>
 
@@ -1479,7 +1480,7 @@ guest, [[], [order4]]
 <p>The following write transform example writes multiple output files to a location. Each file has the prefix “numbers”, a numeric tag, and the suffix “.csv”.</p>
 
 <div class="language-java highlighter-rouge"><pre class="highlight"><code><span class="n">records</span><span class="o">.</span><span class="na">apply</span><span class="o">(</span><span class="s">"WriteToText"</span><span class="o">,</span>
-    <span class="n">TextIO</span><span class="o">.</span><span class="na">Write</span><span class="o">.</span><span class="na">to</span><span class="o">(</span><span class="s">"protocol://my_bucket/path/to/numbers"</span><span class="o">)</span>
+    <span class="n">TextIO</span><span class="o">.</span><span class="na">write</span><span class="o">().</span><span class="na">to</span><span class="o">(</span><span class="s">"protocol://my_bucket/path/to/numbers"</span><span class="o">)</span>
                 <span class="o">.</span><span class="na">withSuffix</span><span class="o">(</span><span class="s">".csv"</span><span class="o">));</span>
 </code></pre>
 </div>
@@ -1495,54 +1496,34 @@ guest, [[], [order4]]
 
 <h2 id="a-namecodersadata-encoding-and-type-safety"><a name="coders"></a>Data encoding and type safety</h2>
 
-<p>When you create or output pipeline data, you’ll need to specify how the elements in your <code class="highlighter-rouge">PCollection</code>s are encoded and decoded to and from byte strings. Byte strings are used for intermediate storage as well reading from sources and writing to sinks. The Beam SDKs use objects called coders to describe how the elements of a given <code class="highlighter-rouge">PCollection</code> should be encoded and decoded.</p>
-
-<h3 id="using-coders">Using coders</h3>
+<p>When Beam runners execute your pipeline, they often need to materialize the intermediate data in your <code class="highlighter-rouge">PCollection</code>s, which requires converting elements to and from byte strings. The Beam SDKs use objects called <code class="highlighter-rouge">Coder</code>s to describe how the elements of a given <code class="highlighter-rouge">PCollection</code> may be encoded and decoded.</p>
 
-<p>You typically need to specify a coder when reading data into your pipeline from an external source (or creating pipeline data from local data), and also when you output pipeline data to an external sink.</p>
+<blockquote>
+  <p>Note that coders are unrelated to parsing or formatting data when interacting with external data sources or sinks. Such parsing or formatting should typically be done explicitly, using transforms such as <code class="highlighter-rouge">ParDo</code> or <code class="highlighter-rouge">MapElements</code>.</p>
+</blockquote>
 
 <p class="language-java">In the Beam SDK for Java, the type <code class="highlighter-rouge">Coder</code> provides the methods required for encoding and decoding data. The SDK for Java provides a number of Coder subclasses that work with a variety of standard Java types, such as Integer, Long, Double, StringUtf8 and more. You can find all of the available Coder subclasses in the <a href="https://github.com/apache/beam/tree/master/sdks/java/core/src/main/java/org/apache/beam/sdk/coders">Coder package</a>.</p>
 
 <p class="language-py">In the Beam SDK for Python, the type <code class="highlighter-rouge">Coder</code> provides the methods required for encoding and decoding data. The SDK for Python provides a number of Coder subclasses that work with a variety of standard Python types, such as primitive types, Tuple, Iterable, StringUtf8 and more. You can find all of the available Coder subclasses in the <a href="https://github.com/apache/beam/tree/master/sdks/python/apache_beam/coders">apache_beam.coders</a> package.</p>
 
-<p>When you read data into a pipeline, the coder indicates how to interpret the input data into a language-specific type, such as integer or string. Likewise, the coder indicates how the language-specific types in your pipeline should be written into byte strings for an output data sink, or to materialize intermediate data in your pipeline.</p>
-
-<p>The Beam SDKs set a coder for every <code class="highlighter-rouge">PCollection</code> in a pipeline, including those generated as output from a transform. Most of the time, the Beam SDKs can automatically infer the correct coder for an output <code class="highlighter-rouge">PCollection</code>.</p>
-
 <blockquote>
   <p>Note that coders do not necessarily have a 1:1 relationship with types. For example, the Integer type can have multiple valid coders, and input and output data can use different Integer coders. A transform might have Integer-typed input data that uses BigEndianIntegerCoder, and Integer-typed output data that uses VarIntCoder.</p>
 </blockquote>
 
-<p>You can explicitly set a <code class="highlighter-rouge">Coder</code> when inputting or outputting a <code class="highlighter-rouge">PCollection</code>. You set the <code class="highlighter-rouge">Coder</code> by <span class="language-java">calling the method <code class="highlighter-rouge">.withCoder</code></span> <span class="language-py">setting the <code class="highlighter-rouge">coder</code> argument</span> when you apply your pipeline’s read or write transform.</p>
-
-<p>Typically, you set the <code class="highlighter-rouge">Coder</code> when the coder for a <code class="highlighter-rouge">PCollection</code> cannot be automatically inferred, or when you want to use a different coder than your pipeline’s default. The following example code reads a set of numbers from a text file, and sets a <code class="highlighter-rouge">Coder</code> of type <span class="language-java"><code class="highlighter-rouge">TextualIntegerCoder</code></span> <span class="language-py"><code class="highlighter-rouge">VarIntCoder</code></span> for the resulting <code class="highlighter-rouge">PCollection</code>:</p>
-
-<div class="language-java highlighter-rouge"><pre class="highlight"><code><span class="n">PCollection</span><span class="o">&lt;</span><span class="n">Integer</span><span class="o">&gt;</span> <span class="n">numbers</span> <span class="o">=</span>
-  <span class="n">p</span><span class="o">.</span><span class="na">begin</span><span class="o">()</span>
-  <span class="o">.</span><span class="na">apply</span><span class="o">(</span><span class="n">TextIO</span><span class="o">.</span><span class="na">Read</span><span class="o">.</span><span class="na">named</span><span class="o">(</span><span class="s">"ReadNumbers"</span><span class="o">)</span>
-    <span class="o">.</span><span class="na">from</span><span class="o">(</span><span class="s">"gs://my_bucket/path/to/numbers-*.txt"</span><span class="o">)</span>
-    <span class="o">.</span><span class="na">withCoder</span><span class="o">(</span><span class="n">TextualIntegerCoder</span><span class="o">.</span><span class="na">of</span><span class="o">()));</span>
-</code></pre>
-</div>
-
-<div class="language-py highlighter-rouge"><pre class="highlight"><code><span class="n">p</span> <span class="o">=</span> <span class="n">beam</span><span class="o">.</span><span class="n">Pipeline</span><span class="p">()</span>
-<span class="n">numbers</span> <span class="o">=</span> <span class="n">ReadFromText</span><span class="p">(</span><span class="s">"gs://my_bucket/path/to/numbers-*.txt"</span><span class="p">,</span> <span class="n">coder</span><span class="o">=</span><span class="n">VarIntCoder</span><span class="p">())</span>
-</code></pre>
-</div>
-
-<p class="language-java">You can set the coder for an existing <code class="highlighter-rouge">PCollection</code> by using the method <code class="highlighter-rouge">PCollection.setCoder</code>. Note that you cannot call <code class="highlighter-rouge">setCoder</code> on a <code class="highlighter-rouge">PCollection</code> that has been finalized (e.g. by calling <code class="highlighter-rouge">.apply</code> on it).</p>
+<h3 id="specifying-coders">Specifying coders</h3>
+<p>The Beam SDKs require a coder for every <code class="highlighter-rouge">PCollection</code> in your pipeline. In most cases, the Beam SDK is able to automatically infer a <code class="highlighter-rouge">Coder</code> for a <code class="highlighter-rouge">PCollection</code> based on its element type or the transform that produces it, however, in some cases the pipeline author will need to specify a <code class="highlighter-rouge">Coder</code> explicitly, or develop a <code class="highlighter-rouge">Coder</code> for their custom type.</p>
 
-<p class="language-java">You can get the coder for an existing <code class="highlighter-rouge">PCollection</code> by using the method <code class="highlighter-rouge">getCoder</code>. This method will fail with <code class="highlighter-rouge">anIllegalStateException</code> if a coder has not been set and cannot be inferred for the given <code class="highlighter-rouge">PCollection</code>.</p>
+<p class="language-java">You can explicitly set the coder for an existing <code class="highlighter-rouge">PCollection</code> by using the method <code class="highlighter-rouge">PCollection.setCoder</code>. Note that you cannot call <code class="highlighter-rouge">setCoder</code> on a <code class="highlighter-rouge">PCollection</code> that has been finalized (e.g. by calling <code class="highlighter-rouge">.apply</code> on it).</p>
 
-<h3 id="coder-inference-and-default-coders">Coder inference and default coders</h3>
+<p class="language-java">You can get the coder for an existing <code class="highlighter-rouge">PCollection</code> by using the method <code class="highlighter-rouge">getCoder</code>. This method will fail with an <code class="highlighter-rouge">IllegalStateException</code> if a coder has not been set and cannot be inferred for the given <code class="highlighter-rouge">PCollection</code>.</p>
 
-<p>The Beam SDKs require a coder for every <code class="highlighter-rouge">PCollection</code> in your pipeline. Most of the time, however, you do not need to explicitly specify a coder, such as for an intermediate <code class="highlighter-rouge">PCollection</code> produced by a transform in the middle of your pipeline. In such cases, the Beam SDKs can infer an appropriate coder from the inputs and outputs of the transform used to produce the PCollection.</p>
+<p>Beam SDKs use a variety of mechanisms when attempting to automatically infer the <code class="highlighter-rouge">Coder</code> for a <code class="highlighter-rouge">PCollection</code>.</p>
 
 <p class="language-java">Each pipeline object has a <code class="highlighter-rouge">CoderRegistry</code>. The <code class="highlighter-rouge">CoderRegistry</code> represents a mapping of Java types to the default coders that the pipeline should use for <code class="highlighter-rouge">PCollection</code>s of each type.</p>
 
 <p class="language-py">The Beam SDK for Python has a <code class="highlighter-rouge">CoderRegistry</code> that represents a mapping of Python types to the default coder that should be used for <code class="highlighter-rouge">PCollection</code>s of each type.</p>
 
-<p class="language-java">By default, the Beam SDK for Java automatically infers the <code class="highlighter-rouge">Coder</code> for the elements of an output <code class="highlighter-rouge">PCollection</code> using the type parameter from the transform’s function object, such as <code class="highlighter-rouge">DoFn</code>. In the case of <code class="highlighter-rouge">ParDo</code>, for example, a <code class="highlighter-rouge">DoFn&lt;Integer, String&gt;function</code> object accepts an input element of type <code class="highlighter-rouge">Integer</code> and produces an output element of type <code class="highlighter-rouge">String</code>. In such a case, the SDK for Java will automatically infer the default <code class="highlighter-rouge">Coder</code> for the output <code class="highlighter-rouge">PCollection&lt;String&gt;</code> (in the default pipeline <code class="highlighter-rouge">CoderRegistry</code>, this is <code class="highlighter-rouge">StringUtf8Coder</code>).</p>
+<p class="language-java">By default, the Beam SDK for Java automatically infers the <code class="highlighter-rouge">Coder</code> for the elements of a <code class="highlighter-rouge">PCollection</code> produced by a <code class="highlighter-rouge">PTransform</code> using the type parameter from the transform’s function object, such as <code class="highlighter-rouge">DoFn</code>. In the case of <code class="highlighter-rouge">ParDo</code>, for example, a <code class="highlighter-rouge">DoFn&lt;Integer, String&gt;</code> function object accepts an input element of type <code class="highlighter-rouge">Integer</code> and produces an output element of type <code class="highlighter-rouge">String</code>. In such a case, the SDK for Java will automatically infer the default <code class="highlighter-rouge">Coder</code> for the output <code class="highlighter-rouge">PCollection&lt;String&gt;</code> (in the default pipeline <code class="highlighter-rouge">CoderRegistry</code>, this is <code 
 class="highlighter-rouge">StringUtf8Coder</code>).</p>
 
 <p class="language-py">By default, the Beam SDK for Python automatically infers the <code class="highlighter-rouge">Coder</code> for the elements of an output <code class="highlighter-rouge">PCollection</code> using the typehints from the transform’s function object, such as <code class="highlighter-rouge">DoFn</code>. In the case of <code class="highlighter-rouge">ParDo</code>, for example a <code class="highlighter-rouge">DoFn</code> with the typehints <code class="highlighter-rouge">@beam.typehints.with_input_types(int)</code> and <code class="highlighter-rouge">@beam.typehints.with_output_types(str)</code> accepts an input element of type int and produces an output element of type str. In such a case, the Beam SDK for Python will automatically infer the default <code class="highlighter-rouge">Coder</code> for the output <code class="highlighter-rouge">PCollection</code> (in the default pipeline <code class="highlighter-rouge">CoderRegistry</code>, this is <code class="highligh
 ter-rouge">BytesCoder</code>).</p>
 
@@ -1906,7 +1887,7 @@ Subsequent transforms, however, are applied to the result of the <code class="hi
 </code></pre>
 </div>
 
-<p>When you set <code class="highlighter-rouge">.withAllowedLateness</code> on a <code class="highlighter-rouge">PCollection</code>, that allowed lateness propagates forward to any subsequent <code class="highlighter-rouge">PCollection</code> derived from the first <code class="highlighter-rouge">PCollection</code> you applied allowed lateness to. If you want to change the allowed lateness later in your pipeline, you must do so explictly by applying <code class="highlighter-rouge">Window.withAllowedLateness()</code> again.</p>
+<p>When you set <code class="highlighter-rouge">.withAllowedLateness</code> on a <code class="highlighter-rouge">PCollection</code>, that allowed lateness propagates forward to any subsequent <code class="highlighter-rouge">PCollection</code> derived from the first <code class="highlighter-rouge">PCollection</code> you applied allowed lateness to. If you want to change the allowed lateness later in your pipeline, you must do so explictly by applying <code class="highlighter-rouge">Window.configure().withAllowedLateness()</code>.</p>
 
 <h3 id="adding-timestamps-to-a-pcollections-elements">Adding timestamps to a PCollection’s elements</h3>
 
@@ -2098,7 +2079,7 @@ Subsequent transforms, however, are applied to the result of the <code class="hi
 </code></pre>
 </div>
 
-<p>This allowed lateness propagates to all <code class="highlighter-rouge">PCollection</code>s derived as a result of applying transforms to the original <code class="highlighter-rouge">PCollection</code>. If you want to change the allowed lateness later in your pipeline, you can apply <code class="highlighter-rouge">Window.withAllowedLateness()</code> again, explicitly.</p>
+<p>This allowed lateness propagates to all <code class="highlighter-rouge">PCollection</code>s derived as a result of applying transforms to the original <code class="highlighter-rouge">PCollection</code>. If you want to change the allowed lateness later in your pipeline, you can apply <code class="highlighter-rouge">Window.configure().withAllowedLateness()</code> again, explicitly.</p>
 
 <h3 id="a-namecomposite-triggersacomposite-triggers"><a name="composite-triggers"></a>Composite Triggers</h3>
 
@@ -2135,6 +2116,7 @@ Subsequent transforms, however, are applied to the result of the <code class="hi
 </ul>
 
 <div class="language-java highlighter-rouge"><pre class="highlight"><code>  <span class="o">.</span><span class="na">apply</span><span class="o">(</span><span class="n">Window</span>
+      <span class="o">.</span><span class="na">configure</span><span class="o">()</span>
       <span class="o">.</span><span class="na">triggering</span><span class="o">(</span><span class="n">AfterWatermark</span>
            <span class="o">.</span><span class="na">pastEndOfWindow</span><span class="o">()</span>
            <span class="o">.</span><span class="na">withLateFirings</span><span class="o">(</span><span class="n">AfterProcessingTime</span>

http://git-wip-us.apache.org/repos/asf/beam-site/blob/846a8863/content/documentation/sdks/java-extensions/index.html
----------------------------------------------------------------------
diff --git a/content/documentation/sdks/java-extensions/index.html b/content/documentation/sdks/java-extensions/index.html
index ee93238..33edb38 100644
--- a/content/documentation/sdks/java-extensions/index.html
+++ b/content/documentation/sdks/java-extensions/index.html
@@ -205,7 +205,7 @@ PCollection&lt;KV&lt;String, Iterable&lt;KV&lt;String, Integer&gt;&gt;&gt;&gt; g
 // For every primary key, sort the iterable of &lt;SecondaryKey, Value&gt; pairs by secondary key.
 PCollection&lt;KV&lt;String, Iterable&lt;KV&lt;String, Integer&gt;&gt;&gt;&gt; groupedAndSorted =
     grouped.apply(
-        SortValues.&lt;String, String, Integer&gt;create(new BufferedExternalSorter.Options()));
+        SortValues.&lt;String, String, Integer&gt;create(BufferedExternalSorter.options()));
 </code></pre>
 </div>
 

http://git-wip-us.apache.org/repos/asf/beam-site/blob/846a8863/content/get-started/mobile-gaming-example/index.html
----------------------------------------------------------------------
diff --git a/content/get-started/mobile-gaming-example/index.html b/content/get-started/mobile-gaming-example/index.html
index 7a3fbb4..70a26f4 100644
--- a/content/get-started/mobile-gaming-example/index.html
+++ b/content/get-started/mobile-gaming-example/index.html
@@ -290,9 +290,9 @@
 
     <span class="k">return</span> <span class="n">gameInfo</span>
       <span class="o">.</span><span class="na">apply</span><span class="o">(</span><span class="n">MapElements</span>
-          <span class="o">.</span><span class="na">via</span><span class="o">((</span><span class="n">GameActionInfo</span> <span class="n">gInfo</span><span class="o">)</span> <span class="o">-&gt;</span> <span class="n">KV</span><span class="o">.</span><span class="na">of</span><span class="o">(</span><span class="n">gInfo</span><span class="o">.</span><span class="na">getKey</span><span class="o">(</span><span class="n">field</span><span class="o">),</span> <span class="n">gInfo</span><span class="o">.</span><span class="na">getScore</span><span class="o">()))</span>
-          <span class="o">.</span><span class="na">withOutputType</span><span class="o">(</span>
-              <span class="n">TypeDescriptors</span><span class="o">.</span><span class="na">kvs</span><span class="o">(</span><span class="n">TypeDescriptors</span><span class="o">.</span><span class="na">strings</span><span class="o">(),</span> <span class="n">TypeDescriptors</span><span class="o">.</span><span class="na">integers</span><span class="o">())))</span>
+          <span class="o">.</span><span class="na">into</span><span class="o">(</span>
+              <span class="n">TypeDescriptors</span><span class="o">.</span><span class="na">kvs</span><span class="o">(</span><span class="n">TypeDescriptors</span><span class="o">.</span><span class="na">strings</span><span class="o">(),</span> <span class="n">TypeDescriptors</span><span class="o">.</span><span class="na">integers</span><span class="o">()))</span>
+          <span class="o">.</span><span class="na">via</span><span class="o">((</span><span class="n">GameActionInfo</span> <span class="n">gInfo</span><span class="o">)</span> <span class="o">-&gt;</span> <span class="n">KV</span><span class="o">.</span><span class="na">of</span><span class="o">(</span><span class="n">gInfo</span><span class="o">.</span><span class="na">getKey</span><span class="o">(</span><span class="n">field</span><span class="o">),</span> <span class="n">gInfo</span><span class="o">.</span><span class="na">getScore</span><span class="o">())))</span>
       <span class="o">.</span><span class="na">apply</span><span class="o">(</span><span class="n">Sum</span><span class="o">.&lt;</span><span class="n">String</span><span class="o">&gt;</span><span class="n">integersPerKey</span><span class="o">());</span>
   <span class="o">}</span>
 <span class="o">}</span>
@@ -331,7 +331,7 @@
   <span class="n">Pipeline</span> <span class="n">pipeline</span> <span class="o">=</span> <span class="n">Pipeline</span><span class="o">.</span><span class="na">create</span><span class="o">(</span><span class="n">options</span><span class="o">);</span>
 
   <span class="c1">// Read events from a text file and parse them.</span>
-  <span class="n">pipeline</span><span class="o">.</span><span class="na">apply</span><span class="o">(</span><span class="n">TextIO</span><span class="o">.</span><span class="na">Read</span><span class="o">.</span><span class="na">from</span><span class="o">(</span><span class="n">options</span><span class="o">.</span><span class="na">getInput</span><span class="o">()))</span>
+  <span class="n">pipeline</span><span class="o">.</span><span class="na">apply</span><span class="o">(</span><span class="n">TextIO</span><span class="o">.</span><span class="na">read</span><span class="o">().</span><span class="na">from</span><span class="o">(</span><span class="n">options</span><span class="o">.</span><span class="na">getInput</span><span class="o">()))</span>
     <span class="o">.</span><span class="na">apply</span><span class="o">(</span><span class="s">"ParseGameEvent"</span><span class="o">,</span> <span class="n">ParDo</span><span class="o">.</span><span class="na">of</span><span class="o">(</span><span class="k">new</span> <span class="n">ParseEventFn</span><span class="o">()))</span>
     <span class="c1">// Extract and sum username/score pairs from the event data.</span>
     <span class="o">.</span><span class="na">apply</span><span class="o">(</span><span class="s">"ExtractUserScore"</span><span class="o">,</span> <span class="k">new</span> <span class="n">ExtractAndSumScore</span><span class="o">(</span><span class="s">"user"</span><span class="o">))</span>
@@ -509,7 +509,7 @@
   <span class="kd">final</span> <span class="n">Instant</span> <span class="n">startMinTimestamp</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Instant</span><span class="o">(</span><span class="n">minFmt</span><span class="o">.</span><span class="na">parseMillis</span><span class="o">(</span><span class="n">options</span><span class="o">.</span><span class="na">getStartMin</span><span class="o">()));</span>
 
   <span class="c1">// Read 'gaming' events from a text file.</span>
-  <span class="n">pipeline</span><span class="o">.</span><span class="na">apply</span><span class="o">(</span><span class="n">TextIO</span><span class="o">.</span><span class="na">Read</span><span class="o">.</span><span class="na">from</span><span class="o">(</span><span class="n">options</span><span class="o">.</span><span class="na">getInput</span><span class="o">()))</span>
+  <span class="n">pipeline</span><span class="o">.</span><span class="na">apply</span><span class="o">(</span><span class="n">TextIO</span><span class="o">.</span><span class="na">read</span><span class="o">().</span><span class="na">from</span><span class="o">(</span><span class="n">options</span><span class="o">.</span><span class="na">getInput</span><span class="o">()))</span>
     <span class="c1">// Parse the incoming data.</span>
     <span class="o">.</span><span class="na">apply</span><span class="o">(</span><span class="s">"ParseGameEvent"</span><span class="o">,</span> <span class="n">ParDo</span><span class="o">.</span><span class="na">of</span><span class="o">(</span><span class="k">new</span> <span class="n">ParseEventFn</span><span class="o">()))</span>
 
@@ -808,8 +808,6 @@
     <span class="c1">// Filter the user sums using the global mean.</span>
     <span class="n">PCollection</span><span class="o">&lt;</span><span class="n">KV</span><span class="o">&lt;</span><span class="n">String</span><span class="o">,</span> <span class="n">Integer</span><span class="o">&gt;&gt;</span> <span class="n">filtered</span> <span class="o">=</span> <span class="n">sumScores</span>
         <span class="o">.</span><span class="na">apply</span><span class="o">(</span><span class="s">"ProcessAndFilter"</span><span class="o">,</span> <span class="n">ParDo</span>
-            <span class="c1">// use the derived mean total score as a side input</span>
-            <span class="o">.</span><span class="na">withSideInputs</span><span class="o">(</span><span class="n">globalMeanScore</span><span class="o">)</span>
             <span class="o">.</span><span class="na">of</span><span class="o">(</span><span class="k">new</span> <span class="n">DoFn</span><span class="o">&lt;</span><span class="n">KV</span><span class="o">&lt;</span><span class="n">String</span><span class="o">,</span> <span class="n">Integer</span><span class="o">&gt;,</span> <span class="n">KV</span><span class="o">&lt;</span><span class="n">String</span><span class="o">,</span> <span class="n">Integer</span><span class="o">&gt;&gt;()</span> <span class="o">{</span>
               <span class="kd">private</span> <span class="kd">final</span> <span class="n">Aggregator</span><span class="o">&lt;</span><span class="n">Long</span><span class="o">,</span> <span class="n">Long</span><span class="o">&gt;</span> <span class="n">numSpammerUsers</span> <span class="o">=</span>
                 <span class="n">createAggregator</span><span class="o">(</span><span class="s">"SpammerUsers"</span><span class="o">,</span> <span class="k">new</span> <span class="n">Sum</span><span class="o">.</span><span class="na">SumLongFn</span><span class="o">());</span>
@@ -824,7 +822,9 @@
                   <span class="n">c</span><span class="o">.</span><span class="na">output</span><span class="o">(</span><span class="n">c</span><span class="o">.</span><span class="na">element</span><span class="o">());</span>
                 <span class="o">}</span>
               <span class="o">}</span>
-            <span class="o">}));</span>
+            <span class="o">})</span>
+            <span class="c1">// use the derived mean total score as a side input</span>
+            <span class="o">.</span><span class="na">withSideInputs</span><span class="o">(</span><span class="n">globalMeanScore</span><span class="o">));</span>
     <span class="k">return</span> <span class="n">filtered</span><span class="o">;</span>
   <span class="o">}</span>
 <span class="o">}</span>
@@ -842,7 +842,6 @@
       <span class="n">FixedWindows</span><span class="o">.</span><span class="na">of</span><span class="o">(</span><span class="n">Duration</span><span class="o">.</span><span class="na">standardMinutes</span><span class="o">(</span><span class="n">options</span><span class="o">.</span><span class="na">getFixedWindowDuration</span><span class="o">()))))</span>
   <span class="c1">// Filter out the detected spammer users, using the side input derived above.</span>
   <span class="o">.</span><span class="na">apply</span><span class="o">(</span><span class="s">"FilterOutSpammers"</span><span class="o">,</span> <span class="n">ParDo</span>
-          <span class="o">.</span><span class="na">withSideInputs</span><span class="o">(</span><span class="n">spammersView</span><span class="o">)</span>
           <span class="o">.</span><span class="na">of</span><span class="o">(</span><span class="k">new</span> <span class="n">DoFn</span><span class="o">&lt;</span><span class="n">GameActionInfo</span><span class="o">,</span> <span class="n">GameActionInfo</span><span class="o">&gt;()</span> <span class="o">{</span>
             <span class="nd">@ProcessElement</span>
             <span class="kd">public</span> <span class="kt">void</span> <span class="nf">processElement</span><span class="o">(</span><span class="n">ProcessContext</span> <span class="n">c</span><span class="o">)</span> <span class="o">{</span>
@@ -851,7 +850,8 @@
                 <span class="n">c</span><span class="o">.</span><span class="na">output</span><span class="o">(</span><span class="n">c</span><span class="o">.</span><span class="na">element</span><span class="o">());</span>
               <span class="o">}</span>
             <span class="o">}</span>
-          <span class="o">}))</span>
+          <span class="o">})</span>
+          <span class="o">.</span><span class="na">withSideInputs</span><span class="o">(</span><span class="n">spammersView</span><span class="o">))</span>
   <span class="c1">// Extract and sum teamname/score pairs from the event data.</span>
   <span class="o">.</span><span class="na">apply</span><span class="o">(</span><span class="s">"ExtractTeamScore"</span><span class="o">,</span> <span class="k">new</span> <span class="n">ExtractAndSumScore</span><span class="o">(</span><span class="s">"team"</span><span class="o">))</span>
 </code></pre>

http://git-wip-us.apache.org/repos/asf/beam-site/blob/846a8863/content/get-started/wordcount-example/index.html
----------------------------------------------------------------------
diff --git a/content/get-started/wordcount-example/index.html b/content/get-started/wordcount-example/index.html
index f0c027b..1167138 100644
--- a/content/get-started/wordcount-example/index.html
+++ b/content/get-started/wordcount-example/index.html
@@ -285,7 +285,7 @@ Figure 1: The pipeline data flow.</p>
   <li>
     <p>A text file <code class="highlighter-rouge">Read</code> transform is applied to the Pipeline object itself, and produces a <code class="highlighter-rouge">PCollection</code> as output. Each element in the output PCollection represents one line of text from the input file. This example uses input data stored in a publicly accessible Google Cloud Storage bucket (“gs://”).</p>
 
-    <div class="language-java highlighter-rouge"><pre class="highlight"><code><span class="n">p</span><span class="o">.</span><span class="na">apply</span><span class="o">(</span><span class="n">TextIO</span><span class="o">.</span><span class="na">Read</span><span class="o">.</span><span class="na">from</span><span class="o">(</span><span class="s">"gs://apache-beam-samples/shakespeare/*"</span><span class="o">))</span>
+    <div class="language-java highlighter-rouge"><pre class="highlight"><code><span class="n">p</span><span class="o">.</span><span class="na">apply</span><span class="o">(</span><span class="n">TextIO</span><span class="o">.</span><span class="na">read</span><span class="o">().</span><span class="na">from</span><span class="o">(</span><span class="s">"gs://apache-beam-samples/shakespeare/*"</span><span class="o">))</span>
 </code></pre>
     </div>
 
@@ -351,7 +351,7 @@ Figure 1: The pipeline data flow.</p>
   <li>
     <p>A text file write transform. This transform takes the final <code class="highlighter-rouge">PCollection</code> of formatted Strings as input and writes each element to an output text file. Each element in the input <code class="highlighter-rouge">PCollection</code> represents one line of text in the resulting output file.</p>
 
-    <div class="language-java highlighter-rouge"><pre class="highlight"><code><span class="o">.</span><span class="na">apply</span><span class="o">(</span><span class="n">TextIO</span><span class="o">.</span><span class="na">Write</span><span class="o">.</span><span class="na">to</span><span class="o">(</span><span class="s">"wordcounts"</span><span class="o">));</span>
+    <div class="language-java highlighter-rouge"><pre class="highlight"><code><span class="o">.</span><span class="na">apply</span><span class="o">(</span><span class="n">TextIO</span><span class="o">.</span><span class="na">write</span><span class="o">().</span><span class="na">to</span><span class="o">(</span><span class="s">"wordcounts"</span><span class="o">));</span>
 </code></pre>
     </div>
 
@@ -664,7 +664,7 @@ Figure 1: The pipeline data flow.</p>
     <span class="n">Pipeline</span> <span class="n">pipeline</span> <span class="o">=</span> <span class="n">Pipeline</span><span class="o">.</span><span class="na">create</span><span class="o">(</span><span class="n">options</span><span class="o">);</span>
 
     <span class="n">PCollection</span><span class="o">&lt;</span><span class="n">String</span><span class="o">&gt;</span> <span class="n">input</span> <span class="o">=</span> <span class="n">pipeline</span>
-      <span class="o">.</span><span class="na">apply</span><span class="o">(</span><span class="n">TextIO</span><span class="o">.</span><span class="na">Read</span><span class="o">.</span><span class="na">from</span><span class="o">(</span><span class="n">options</span><span class="o">.</span><span class="na">getInputFile</span><span class="o">()))</span>
+      <span class="o">.</span><span class="na">apply</span><span class="o">(</span><span class="n">TextIO</span><span class="o">.</span><span class="na">read</span><span class="o">().</span><span class="na">from</span><span class="o">(</span><span class="n">options</span><span class="o">.</span><span class="na">getInputFile</span><span class="o">()))</span>
 
 </code></pre>
 </div>