You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by me...@apache.org on 2018/07/23 18:55:10 UTC

[beam-site] 01/03: Update Java Quickstart for Windows

This is an automated email from the ASF dual-hosted git repository.

mergebot-role pushed a commit to branch mergebot
in repository https://gitbox.apache.org/repos/asf/beam-site.git

commit 0a13ed8fa0795b8c66ac955265a81966c72547e0
Author: Rafael Fernandez <rf...@google.com>
AuthorDate: Thu Jul 19 16:40:37 2018 -0700

    Update Java Quickstart for Windows
    
    Add PowerShell options for setup, build, and direct runner execution/inspection to better support Microsoft Windows users.
    
    Really the main difference is the need to have spaces after the "-D" and "-P"s in mvn, and break lines in PowerShell style.
---
 src/get-started/quickstart-java.md | 65 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 65 insertions(+)

diff --git a/src/get-started/quickstart-java.md b/src/get-started/quickstart-java.md
index acdcd29..4d22401 100644
--- a/src/get-started/quickstart-java.md
+++ b/src/get-started/quickstart-java.md
@@ -41,6 +41,7 @@ This Quickstart will walk you through executing your first Beam pipeline to run
 
 The easiest way to get a copy of the WordCount pipeline is to use the following command to generate a simple Maven project that contains Beam's WordCount examples and builds against the most recent Beam release:
 
+{:.unix}
 ```
 $ mvn archetype:generate \
       -DarchetypeGroupId=org.apache.beam \
@@ -52,9 +53,23 @@ $ mvn archetype:generate \
       -Dpackage=org.apache.beam.examples \
       -DinteractiveMode=false
 ```
+{:.powershell}
+```
+PS> mvn archetype:generate `
+ -D archetypeGroupId=org.apache.beam `
+ -D archetypeArtifactId=beam-sdks-java-maven-archetypes-examples `
+ -D archetypeVersion={{ site.release_latest }} `
+ -D groupId=org.example `
+ -D artifactId=word-count-beam `
+ -D version="0.1" `
+ -D package=org.apache.beam.examples `
+ -D interactiveMode=false
+```
+
 
 This will create a directory `word-count-beam` that contains a simple `pom.xml` and a series of example pipelines that count words in text files.
 
+{:.unix}
 ```
 $ cd word-count-beam/
 
@@ -65,6 +80,32 @@ $ ls src/main/java/org/apache/beam/examples/
 DebuggingWordCount.java	WindowedWordCount.java	common
 MinimalWordCount.java	WordCount.java
 ```
+{:.powershell}
+```
+PS> cd .\word-count-beam
+
+PS> dir
+
+... 
+ 
+Mode                LastWriteTime         Length Name                                                        
+----                -------------         ------ ----                                                        
+d-----        7/19/2018  11:00 PM                src                                                         
+-a----        7/19/2018  11:00 PM          16051 pom.xml
+
+PS> dir .\src\main\java\org\apache\beam\examples
+
+...
+Mode                LastWriteTime         Length Name                                                        
+----                -------------         ------ ----                                                        
+d-----        7/19/2018  11:00 PM                common                                                      
+d-----        7/19/2018  11:00 PM                complete                                                    
+d-----        7/19/2018  11:00 PM                subprocess                                                  
+-a----        7/19/2018  11:00 PM           7073 DebuggingWordCount.java                                     
+-a----        7/19/2018  11:00 PM           5945 MinimalWordCount.java                                       
+-a----        7/19/2018  11:00 PM           9490 WindowedWordCount.java                                      
+-a----        7/19/2018  11:00 PM           7662 WordCount.java
+```
 
 For a detailed introduction to the Beam concepts used in these examples, see the [WordCount Example Walkthrough]({{ site.baseurl }}/get-started/wordcount-example). Here, we'll just focus on executing `WordCount.java`.
 
@@ -88,6 +129,12 @@ $ mvn compile exec:java -Dexec.mainClass=org.apache.beam.examples.WordCount \
      -Dexec.args="--inputFile=pom.xml --output=counts" -Pdirect-runner
 ```
 
+{:.runner-direct-powershell}
+```
+PS> mvn compile exec:java -D exec.mainClass=org.apache.beam.examples.WordCount `
+ -D exec.args="--inputFile=pom.xml --output=counts" -P direct-runner
+```
+
 {:.runner-apex}
 ```
 $ mvn compile exec:java -Dexec.mainClass=org.apache.beam.examples.WordCount \
@@ -141,6 +188,11 @@ Once the pipeline has completed, you can view the output. You'll notice that the
 $ ls counts*
 ```
 
+{:.runner-direct-powershell}
+```
+PS> dir counts*
+```
+
 {:.runner-apex}
 ```
 $ ls counts*
@@ -186,6 +238,19 @@ Foundation: 1
 ...
 ```
 
+{:.runner-direct-powershell}
+```
+PS> cat counts*
+the: 28
+executions: 2
+available: 5
+project: 6
+clients: 4
+to: 11
+Dependencies: 1
+...
+```
+
 {:.runner-apex}
 ```
 $ cat counts*