This is an automated email from the ASF dual-hosted git repository. git-site-role pushed a commit to branch asf-site in repository https://gitbox.apache.org/repos/asf/beam.git
The following commit(s) were added to refs/heads/asf-site by this push: new c3849c3 Publishing website 2019/04/22 23:02:17 at commit bdb1a71 c3849c3 is described below commit c3849c399197e5b675cec0966366065bba92294e Author: jenkins <bui...@apache.org> AuthorDate: Mon Apr 22 23:02:18 2019 +0000 Publishing website 2019/04/22 23:02:17 at commit bdb1a71 --- .../get-started/beam-overview/index.html | 4 + .../get-started/downloads/index.html | 1 + website/generated-content/get-started/index.html | 1 + .../get-started/mobile-gaming-example/index.html | 1 + .../get-started/quickstart-go/index.html | 1 + .../get-started/quickstart-java/index.html | 1 + .../get-started/quickstart-py/index.html | 1 + .../get-started/try-apache-beam/index.html | 449 +++++++++++++++++++++ .../get-started/wordcount-example/index.html | 1 + website/generated-content/index.html | 3 +- 10 files changed, 462 insertions(+), 1 deletion(-) diff --git a/website/generated-content/get-started/beam-overview/index.html b/website/generated-content/get-started/beam-overview/index.html index 9ab2cfd..e949d37 100644 --- a/website/generated-content/get-started/beam-overview/index.html +++ b/website/generated-content/get-started/beam-overview/index.html @@ -156,6 +156,7 @@ <span class="section-nav-list-title">Quickstarts</span> <ul class="section-nav-list"> + <li><a href="/get-started/try-apache-beam/">Try Apache Beam</a></li> <li><a href="/get-started/quickstart-java/">Quickstart - Java</a></li> <li><a href="/get-started/quickstart-py/">Quickstart - Python</a></li> <li><a href="/get-started/quickstart-go/">Quickstart - Go</a></li> @@ -258,6 +259,9 @@ limitations under the License. <ol> <li> + <p><a href="/get-started/try-apache-beam">Try Apache Beam</a> in an online interactive environment.</p> + </li> + <li> <p>Follow the Quickstart for the <a href="/get-started/quickstart-java">Java SDK</a>, the <a href="/get-started/quickstart-py">Python SDK</a> or the <a href="/get-started/quickstart-go">Go SDK</a>.</p> </li> <li> diff --git a/website/generated-content/get-started/downloads/index.html b/website/generated-content/get-started/downloads/index.html index c9333a1..ff22069 100644 --- a/website/generated-content/get-started/downloads/index.html +++ b/website/generated-content/get-started/downloads/index.html @@ -156,6 +156,7 @@ <span class="section-nav-list-title">Quickstarts</span> <ul class="section-nav-list"> + <li><a href="/get-started/try-apache-beam/">Try Apache Beam</a></li> <li><a href="/get-started/quickstart-java/">Quickstart - Java</a></li> <li><a href="/get-started/quickstart-py/">Quickstart - Python</a></li> <li><a href="/get-started/quickstart-go/">Quickstart - Go</a></li> diff --git a/website/generated-content/get-started/index.html b/website/generated-content/get-started/index.html index ad8a176..0d05351 100644 --- a/website/generated-content/get-started/index.html +++ b/website/generated-content/get-started/index.html @@ -156,6 +156,7 @@ <span class="section-nav-list-title">Quickstarts</span> <ul class="section-nav-list"> + <li><a href="/get-started/try-apache-beam/">Try Apache Beam</a></li> <li><a href="/get-started/quickstart-java/">Quickstart - Java</a></li> <li><a href="/get-started/quickstart-py/">Quickstart - Python</a></li> <li><a href="/get-started/quickstart-go/">Quickstart - Go</a></li> diff --git a/website/generated-content/get-started/mobile-gaming-example/index.html b/website/generated-content/get-started/mobile-gaming-example/index.html index f574fce..1004140 100644 --- a/website/generated-content/get-started/mobile-gaming-example/index.html +++ b/website/generated-content/get-started/mobile-gaming-example/index.html @@ -156,6 +156,7 @@ <span class="section-nav-list-title">Quickstarts</span> <ul class="section-nav-list"> + <li><a href="/get-started/try-apache-beam/">Try Apache Beam</a></li> <li><a href="/get-started/quickstart-java/">Quickstart - Java</a></li> <li><a href="/get-started/quickstart-py/">Quickstart - Python</a></li> <li><a href="/get-started/quickstart-go/">Quickstart - Go</a></li> diff --git a/website/generated-content/get-started/quickstart-go/index.html b/website/generated-content/get-started/quickstart-go/index.html index 2bcf08f..bb14f29 100644 --- a/website/generated-content/get-started/quickstart-go/index.html +++ b/website/generated-content/get-started/quickstart-go/index.html @@ -156,6 +156,7 @@ <span class="section-nav-list-title">Quickstarts</span> <ul class="section-nav-list"> + <li><a href="/get-started/try-apache-beam/">Try Apache Beam</a></li> <li><a href="/get-started/quickstart-java/">Quickstart - Java</a></li> <li><a href="/get-started/quickstart-py/">Quickstart - Python</a></li> <li><a href="/get-started/quickstart-go/">Quickstart - Go</a></li> diff --git a/website/generated-content/get-started/quickstart-java/index.html b/website/generated-content/get-started/quickstart-java/index.html index a8e0bdc..3e84260 100644 --- a/website/generated-content/get-started/quickstart-java/index.html +++ b/website/generated-content/get-started/quickstart-java/index.html @@ -156,6 +156,7 @@ <span class="section-nav-list-title">Quickstarts</span> <ul class="section-nav-list"> + <li><a href="/get-started/try-apache-beam/">Try Apache Beam</a></li> <li><a href="/get-started/quickstart-java/">Quickstart - Java</a></li> <li><a href="/get-started/quickstart-py/">Quickstart - Python</a></li> <li><a href="/get-started/quickstart-go/">Quickstart - Go</a></li> diff --git a/website/generated-content/get-started/quickstart-py/index.html b/website/generated-content/get-started/quickstart-py/index.html index 78d4713..fab6a5b 100644 --- a/website/generated-content/get-started/quickstart-py/index.html +++ b/website/generated-content/get-started/quickstart-py/index.html @@ -156,6 +156,7 @@ <span class="section-nav-list-title">Quickstarts</span> <ul class="section-nav-list"> + <li><a href="/get-started/try-apache-beam/">Try Apache Beam</a></li> <li><a href="/get-started/quickstart-java/">Quickstart - Java</a></li> <li><a href="/get-started/quickstart-py/">Quickstart - Python</a></li> <li><a href="/get-started/quickstart-go/">Quickstart - Go</a></li> diff --git a/website/generated-content/get-started/try-apache-beam/index.html b/website/generated-content/get-started/try-apache-beam/index.html new file mode 100644 index 0000000..bd3fefa --- /dev/null +++ b/website/generated-content/get-started/try-apache-beam/index.html @@ -0,0 +1,449 @@ +<!DOCTYPE html> +<!-- + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. See accompanying LICENSE file. +--> + +<html lang="en"> + <!-- + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. See accompanying LICENSE file. +--> + +<head> + <meta charset="utf-8"> + <meta http-equiv="X-UA-Compatible" content="IE=edge"> + <meta name="viewport" content="width=device-width, initial-scale=1"> + <title>Try Apache Beam</title> + <meta name="description" content="Apache Beam is an open source, unified model and set of language-specific SDKs for defining and executing data processing workflows, and also data ingestion and integration flows, supporting Enterprise Integration Patterns (EIPs) and Domain Specific Languages (DSLs). Dataflow pipelines simplify the mechanics of large-scale batch and streaming data processing and can run on a number of runtimes like Apache Flink, Apache Spark, and Google Cloud Dataflow [...] +"> + <link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400" rel="stylesheet"> + <link rel="stylesheet" href="/css/site.css"> + <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script> + <script src="/js/bootstrap.min.js"></script> + <script src="/js/language-switch.js"></script> + <script src="/js/fix-menu.js"></script> + <script src="/js/section-nav.js"></script> + <script src="/js/page-nav.js"></script> + <link rel="canonical" href="https://beam.apache.org/get-started/try-apache-beam/" data-proofer-ignore> + <link rel="shortcut icon" type="image/x-icon" href="/images/favicon.ico"> + <link rel="alternate" type="application/rss+xml" title="Apache Beam" href="https://beam.apache.org/feed.xml"> + <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.4.1/css/all.css" integrity="sha384-5sAR7xN1Nv6T6+dT2mhtzEpVJvfS3NScPQTrOxhwjIuvcA67KV2R5Jz6kr4abQsz" crossorigin="anonymous"> + <script> + (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ + (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), + m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) + })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); + ga('create', 'UA-73650088-1', 'auto'); + ga('send', 'pageview'); + </script> +</head> + + <body class="body" data-spy="scroll" data-target=".page-nav" data-offset="0"> + <!-- + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. See accompanying LICENSE file. +--> + +<nav class="header navbar navbar-fixed-top"> + <div class="navbar-header"> + <button type="button" class="navbar-toggle" aria-expanded="false" aria-controls="navbar"> + <span class="sr-only">Toggle navigation</span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + </button> + + <a href="/" class="navbar-brand" > + <img alt="Brand" style="height: 25px" src="/images/beam_logo_navbar.png"> + </a> + </div> + + <div class="navbar-mask closed"></div> + + <div id="navbar" class="navbar-container closed"> + <ul class="nav navbar-nav"> + <li> + <a href="/get-started/beam-overview/">Get Started</a> + </li> + <li> + <a href="/documentation/">Documentation</a> + </li> + <li> + <a href="/documentation/sdks/java/">Languages</a> + </li> + <li> + <a href="/documentation/runners/capability-matrix/">RUNNERS</a> + </li> + <li> + <a href="/roadmap/">Roadmap</a> + </li> + <li> + <a href="/contribute/">Contribute</a> + </li> + <li> + <a href="/community/contact-us/">Community</a> + </li> + <li><a href="/blog">Blog</a></li> + </ul> + <ul class="nav navbar-nav navbar-right"> + <li class="dropdown"> + <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><img src="https://www.apache.org/foundation/press/kit/feather_small.png" alt="Apache Logo" style="height:20px;"><span class="caret"></span></a> + <ul class="dropdown-menu dropdown-menu-right"> + <li><a href="http://www.apache.org/">ASF Homepage</a></li> + <li><a href="http://www.apache.org/licenses/">License</a></li> + <li><a href="http://www.apache.org/security/">Security</a></li> + <li><a href="http://www.apache.org/foundation/thanks.html">Thanks</a></li> + <li><a href="http://www.apache.org/foundation/sponsorship.html">Sponsorship</a></li> + <li><a href="https://www.apache.org/foundation/policies/conduct">Code of Conduct</a></li> + </ul> + </li> + <li> + <!-- + data-proofer-ignore disables link checking from website test automation. + GitHub links will not resolve until the markdown source is available on the master branch. + New pages would fail validation during development / PR test automation. + --> + <a href="https://github.com/apache/beam/edit/master/website/src/get-started/try-apache-beam.md" data-proofer-ignore> + <i class="far fa-edit fa-lg" alt="Edit on GitHub" title="Edit on GitHub"></i> + </a> + </li> + </ul> + </div> +</nav> + + <div class="clearfix container-main-content"> + <div class="section-nav closed" data-offset-top="90" data-offset-bottom="500"> + <span class="section-nav-back glyphicon glyphicon-menu-left"></span> + <nav> + <ul class="section-nav-list" data-section-nav> + <!-- + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. See accompanying LICENSE file. +--> + +<li><span class="section-nav-list-main-title">Get started</span></li> +<li><a href="/get-started/beam-overview/">Beam Overview</a></li> +<li> + <span class="section-nav-list-title">Quickstarts</span> + + <ul class="section-nav-list"> + <li><a href="/get-started/try-apache-beam/">Try Apache Beam</a></li> + <li><a href="/get-started/quickstart-java/">Quickstart - Java</a></li> + <li><a href="/get-started/quickstart-py/">Quickstart - Python</a></li> + <li><a href="/get-started/quickstart-go/">Quickstart - Go</a></li> + </ul> +</li> +<li> + <span class="section-nav-list-title">Example Walkthroughs</span> + <ul class="section-nav-list"> + <li><a href="/get-started/wordcount-example/">WordCount</a></li> + <li><a href="/get-started/mobile-gaming-example/">Mobile Gaming</a></li> + </ul> +</li> +<li><a href="/get-started/downloads">Downloads</a></li> + + + </ul> + </nav> + </div> + + <nav class="page-nav clearfix" data-offset-top="90" data-offset-bottom="500"> + <!-- + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. See accompanying LICENSE file. +--> + + + +<ul class="nav"> + <li><a href="#interactive-wordcount-in-colab">Interactive WordCount in Colab</a></li> + <li><a href="#next-steps">Next Steps</a></li> +</ul> + + + </nav> + + <div class="body__contained body__section-nav"> + <!-- +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +--> + +<h1 id="try-apache-beam">Try Apache Beam</h1> + +<p>You can try Apache Beam using our interactive notebooks, which are hosted in <a href="https://colab.research.google.com">Colab</a>. The notebooks allow you to interactively play with the code and see how your changes affect the pipeline. You don’t need to install anything or modify your computer in any way to use these notebooks.</p> + +<nav class="language-switcher"> + <strong>Adapt for:</strong> + <ul> + <li data-type="language-java" class="active">Java SDK</li> + <li data-type="language-py">Python SDK</li> + <li data-type="language-go">Go SDK</li> + </ul> +</nav> + +<h2 id="interactive-wordcount-in-colab">Interactive WordCount in Colab</h2> + +<p>This interactive notebook shows you what a simple, minimal version of WordCount looks like.</p> + +<div class="language-java highlighter-rouge"><pre class="highlight"><code><span class="kn">package</span> <span class="n">samples</span><span class="o">.</span><span class="na">quickstart</span><span class="o">;</span> + +<span class="kn">import</span> <span class="nn">org.apache.beam.sdk.Pipeline</span><span class="o">;</span> +<span class="kn">import</span> <span class="nn">org.apache.beam.sdk.io.TextIO</span><span class="o">;</span> +<span class="kn">import</span> <span class="nn">org.apache.beam.sdk.options.PipelineOptions</span><span class="o">;</span> +<span class="kn">import</span> <span class="nn">org.apache.beam.sdk.options.PipelineOptionsFactory</span><span class="o">;</span> +<span class="kn">import</span> <span class="nn">org.apache.beam.sdk.transforms.Count</span><span class="o">;</span> +<span class="kn">import</span> <span class="nn">org.apache.beam.sdk.transforms.Filter</span><span class="o">;</span> +<span class="kn">import</span> <span class="nn">org.apache.beam.sdk.transforms.FlatMapElements</span><span class="o">;</span> +<span class="kn">import</span> <span class="nn">org.apache.beam.sdk.transforms.MapElements</span><span class="o">;</span> +<span class="kn">import</span> <span class="nn">org.apache.beam.sdk.values.KV</span><span class="o">;</span> +<span class="kn">import</span> <span class="nn">org.apache.beam.sdk.values.TypeDescriptors</span><span class="o">;</span> + +<span class="kn">import</span> <span class="nn">java.util.Arrays</span><span class="o">;</span> + +<span class="kd">public</span> <span class="kd">class</span> <span class="nc">WordCount</span> <span class="o">{</span> + <span class="kd">public</span> <span class="kd">static</span> <span class="kt">void</span> <span class="nf">main</span><span class="o">(</span><span class="n">String</span><span class="o">[]</span> <span class="n">args</span><span class="o">)</span> <span class="o">{</span> + <span class="n">String</span> <span class="n">inputsDir</span> <span class="o">=</span> <span class="s">"data/*"</span><span class="o">;</span> + <span class="n">String</span> <span class="n">outputsPrefix</span> <span class="o">=</span> <span class="s">"outputs/part"</span><span class="o">;</span> + + <span class="n">PipelineOptions</span> <span class="n">options</span> <span class="o">=</span> <span class="n">PipelineOptionsFactory</span><span class="o">.</span><span class="na">fromArgs</span><span class="o">(</span><span class="n">args</span><span class="o">).</span><span class="na">create</span><span class="o">();</span> + <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">pipeline</span> + <span class="o">.</span><span class="na">apply</span><span class="o">(</span><span class="s">"Read lines"</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">inputsDir</span><span class="o">))</span> + <span class="o">.</span><span class="na">apply</span><span class="o">(</span><span class="s">"Find words"</span><span class="o">,</span> <span class="n">FlatMapElements</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">strings</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">line</span><span class="o">)</span> <span class="o">-></span> <span class="n">Arrays</span><span class="o">.</span><span class="na">asList</span><span class="o">(</span><span class="n">line</span><span class="o">.</span><span class="na">split</span><span class="o">(</span><span class="s">"[^\\p{L}]+"</span><span class="o">))))</span> + <span class="o">.</span><span class="na">apply</span><span class="o">(</span><span class="s">"Filter empty words"</span><span class="o">,</span> <span class="n">Filter</span><span class="o">.</span><span class="na">by</span><span class="o">((</span><span class="n">String</span> <span class="n">word</span><span class="o">)</span> <span class="o">-></span> <span class="o">!</span><span class="n">word</span><span class="o">.</span><span class="na">isEmpty</span><span class="o">() [...] + <span class="o">.</span><span class="na">apply</span><span class="o">(</span><span class="s">"Count words"</span><span class="o">,</span> <span class="n">Count</span><span class="o">.</span><span class="na">perElement</span><span class="o">())</span> + <span class="o">.</span><span class="na">apply</span><span class="o">(</span><span class="s">"Write results"</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">strings</span><span class="o">())</span> + <span class="o">.</span><span class="na">via</span><span class="o">((</span><span class="n">KV</span><span class="o"><</span><span class="n">String</span><span class="o">,</span> <span class="n">Long</span><span class="o">></span> <span class="n">wordCount</span><span class="o">)</span> <span class="o">-></span> + <span class="n">wordCount</span><span class="o">.</span><span class="na">getKey</span><span class="o">()</span> <span class="o">+</span> <span class="s">": "</span> <span class="o">+</span> <span class="n">wordCount</span><span class="o">.</span><span class="na">getValue</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">write</span><span class="o">().</span><span class="na">to</span><span class="o">(</span><span class="n">outputsPrefix</span><span class="o">));</span> + <span class="n">pipeline</span><span class="o">.</span><span class="na">run</span><span class="o">();</span> + <span class="o">}</span> +<span class="o">}</span> +</code></pre> +</div> + +<p class="language-java"><a class="button button--primary" target="_blank" href="https://colab.sandbox.google.com/github/apache/beam/blob/master/examples/notebooks/get-started/try-apache-beam-java.ipynb"> + Run in Colab +</a> +<a class="button button--primary" target="_blank" href="https://github.com/apache/beam/blob/master/examples/notebooks/get-started/try-apache-beam-java.ipynb"> + View on GitHub +</a></p> + +<p class="language-java">To learn how to install and run the Apache Beam Java SDK on your own computer, follow the instructions in the <a href="/get-started/quickstart-java">Java Quickstart</a>.</p> + +<div class="language-py highlighter-rouge"><pre class="highlight"><code><span class="kn">import</span> <span class="nn">apache_beam</span> <span class="kn">as</span> <span class="nn">beam</span> +<span class="kn">import</span> <span class="nn">re</span> + +<span class="n">inputs_pattern</span> <span class="o">=</span> <span class="s">'data/*'</span> +<span class="n">outputs_prefix</span> <span class="o">=</span> <span class="s">'outputs/part'</span> + +<span class="k">with</span> <span class="n">beam</span><span class="o">.</span><span class="n">Pipeline</span><span class="p">()</span> <span class="k">as</span> <span class="n">pipeline</span><span class="p">:</span> + <span class="p">(</span> + <span class="n">pipeline</span> + <span class="o">|</span> <span class="s">'Read lines'</span> <span class="o">>></span> <span class="n">beam</span><span class="o">.</span><span class="n">io</span><span class="o">.</span><span class="n">ReadFromText</span><span class="p">(</span><span class="n">inputs_pattern</span><span class="p">)</span> + <span class="o">|</span> <span class="s">'Find words'</span> <span class="o">>></span> <span class="n">beam</span><span class="o">.</span><span class="n">FlatMap</span><span class="p">(</span><span class="k">lambda</span> <span class="n">line</span><span class="p">:</span> <span class="n">re</span><span class="o">.</span><span class="n">findall</span><span class="p">(</span><span class="s">r"[a-zA-Z']+"</span><span class="p">,</span> <span class="n">line</span><span class="p" [...] + <span class="o">|</span> <span class="s">'Pair words with 1'</span> <span class="o">>></span> <span class="n">beam</span><span class="o">.</span><span class="n">Map</span><span class="p">(</span><span class="k">lambda</span> <span class="n">word</span><span class="p">:</span> <span class="p">(</span><span class="n">word</span><span class="p">,</span> <span class="mi">1</span><span class="p">))</span> + <span class="o">|</span> <span class="s">'Group and sum'</span> <span class="o">>></span> <span class="n">beam</span><span class="o">.</span><span class="n">CombinePerKey</span><span class="p">(</span><span class="nb">sum</span><span class="p">)</span> + <span class="o">|</span> <span class="s">'Format results'</span> <span class="o">>></span> <span class="n">beam</span><span class="o">.</span><span class="n">Map</span><span class="p">(</span><span class="k">lambda</span> <span class="n">word_count</span><span class="p">:</span> <span class="nb">str</span><span class="p">(</span><span class="n">word_count</span><span class="p">))</span> + <span class="o">|</span> <span class="s">'Write results'</span> <span class="o">>></span> <span class="n">beam</span><span class="o">.</span><span class="n">io</span><span class="o">.</span><span class="n">WriteToText</span><span class="p">(</span><span class="n">outputs_prefix</span><span class="p">)</span> + <span class="p">)</span> +</code></pre> +</div> + +<p class="language-py"><a class="button button--primary" target="_blank" href="https://colab.sandbox.google.com/github/apache/beam/blob/master/examples/notebooks/get-started/try-apache-beam-py.ipynb"> + Run in Colab +</a> +<a class="button button--primary" target="_blank" href="https://github.com/apache/beam/blob/master/examples/notebooks/get-started/try-apache-beam-py.ipynb"> + View on GitHub +</a></p> + +<p class="language-py">To learn how to install and run the Apache Beam Python SDK on your own computer, follow the instructions in the <a href="/get-started/quickstart-py">Python Quickstart</a>.</p> + +<div class="language-go highlighter-rouge"><pre class="highlight"><code><span class="k">package</span><span class="x"> </span><span class="n">main</span><span class="x"> + +</span><span class="k">import</span><span class="x"> </span><span class="p">(</span><span class="x"> + </span><span class="s">"context"</span><span class="x"> + </span><span class="s">"flag"</span><span class="x"> + </span><span class="s">"fmt"</span><span class="x"> + </span><span class="s">"regexp"</span><span class="x"> + + </span><span class="s">"github.com/apache/beam/sdks/go/pkg/beam"</span><span class="x"> + </span><span class="s">"github.com/apache/beam/sdks/go/pkg/beam/io/textio"</span><span class="x"> + </span><span class="s">"github.com/apache/beam/sdks/go/pkg/beam/runners/direct"</span><span class="x"> + </span><span class="s">"github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"</span><span class="x"> + + </span><span class="n">_</span><span class="x"> </span><span class="s">"github.com/apache/beam/sdks/go/pkg/beam/io/filesystem/local"</span><span class="x"> +</span><span class="p">)</span><span class="x"> + +</span><span class="k">var</span><span class="x"> </span><span class="p">(</span><span class="x"> + </span><span class="n">input</span><span class="x"> </span><span class="o">=</span><span class="x"> </span><span class="n">flag</span><span class="o">.</span><span class="n">String</span><span class="p">(</span><span class="s">"input"</span><span class="p">,</span><span class="x"> </span><span class="s">"data/*"</span><span class="p">,</span><span class="x"> </span><span class="s">"File(s) to read."</span><span class="p">)</span><span class="x"> + </span><span class="n">output</span><span class="x"> </span><span class="o">=</span><span class="x"> </span><span class="n">flag</span><span class="o">.</span><span class="n">String</span><span class="p">(</span><span class="s">"output"</span><span class="p">,</span><span class="x"> </span><span class="s">"outputs/wordcounts.txt"</span><span class="p">,</span><span class="x"> </span><span class="s">"Output filename."</span><span class="p">)</span><span class="x"> +</span><span class="p">)</span><span class="x"> + +</span><span class="k">var</span><span class="x"> </span><span class="n">wordRE</span><span class="x"> </span><span class="o">=</span><span class="x"> </span><span class="n">regexp</span><span class="o">.</span><span class="n">MustCompile</span><span class="p">(</span><span class="s">`[a-zA-Z]+('[a-z])?`</span><span class="p">)</span><span class="x"> + +</span><span class="k">func</span><span class="x"> </span><span class="n">main</span><span class="p">()</span><span class="x"> </span><span class="p">{</span><span class="x"> + </span><span class="n">flag</span><span class="o">.</span><span class="n">Parse</span><span class="p">()</span><span class="x"> + + </span><span class="n">beam</span><span class="o">.</span><span class="n">Init</span><span class="p">()</span><span class="x"> + + </span><span class="n">pipeline</span><span class="x"> </span><span class="o">:=</span><span class="x"> </span><span class="n">beam</span><span class="o">.</span><span class="n">NewPipeline</span><span class="p">()</span><span class="x"> + </span><span class="n">root</span><span class="x"> </span><span class="o">:=</span><span class="x"> </span><span class="n">pipeline</span><span class="o">.</span><span class="n">Root</span><span class="p">()</span><span class="x"> + + </span><span class="n">lines</span><span class="x"> </span><span class="o">:=</span><span class="x"> </span><span class="n">textio</span><span class="o">.</span><span class="n">Read</span><span class="p">(</span><span class="n">root</span><span class="p">,</span><span class="x"> </span><span class="o">*</span><span class="n">input</span><span class="p">)</span><span class="x"> + </span><span class="n">words</span><span class="x"> </span><span class="o">:=</span><span class="x"> </span><span class="n">beam</span><span class="o">.</span><span class="n">ParDo</span><span class="p">(</span><span class="n">root</span><span class="p">,</span><span class="x"> </span><span class="k">func</span><span class="p">(</span><span class="n">line</span><span class="x"> </span><span class="kt">string</span><span class="p">,</span><span class="x"> </span><span class="n">emit</spa [...] + </span><span class="k">for</span><span class="x"> </span><span class="n">_</span><span class="p">,</span><span class="x"> </span><span class="n">word</span><span class="x"> </span><span class="o">:=</span><span class="x"> </span><span class="k">range</span><span class="x"> </span><span class="n">wordRE</span><span class="o">.</span><span class="n">FindAllString</span><span class="p">(</span><span class="n">line</span><span class="p">,</span><span class="x"> </span><span class="o">-</sp [...] + </span><span class="n">emit</span><span class="p">(</span><span class="n">word</span><span class="p">)</span><span class="x"> + </span><span class="p">}</span><span class="x"> + </span><span class="p">},</span><span class="x"> </span><span class="n">lines</span><span class="p">)</span><span class="x"> + </span><span class="n">counted</span><span class="x"> </span><span class="o">:=</span><span class="x"> </span><span class="n">stats</span><span class="o">.</span><span class="n">Count</span><span class="p">(</span><span class="n">root</span><span class="p">,</span><span class="x"> </span><span class="n">words</span><span class="p">)</span><span class="x"> + </span><span class="n">formatted</span><span class="x"> </span><span class="o">:=</span><span class="x"> </span><span class="n">beam</span><span class="o">.</span><span class="n">ParDo</span><span class="p">(</span><span class="n">root</span><span class="p">,</span><span class="x"> </span><span class="k">func</span><span class="p">(</span><span class="n">word</span><span class="x"> </span><span class="kt">string</span><span class="p">,</span><span class="x"> </span><span class="n">count [...] + </span><span class="k">return</span><span class="x"> </span><span class="n">fmt</span><span class="o">.</span><span class="n">Sprintf</span><span class="p">(</span><span class="s">"%s: %v"</span><span class="p">,</span><span class="x"> </span><span class="n">word</span><span class="p">,</span><span class="x"> </span><span class="n">count</span><span class="p">)</span><span class="x"> + </span><span class="p">},</span><span class="x"> </span><span class="n">counted</span><span class="p">)</span><span class="x"> + </span><span class="n">textio</span><span class="o">.</span><span class="n">Write</span><span class="p">(</span><span class="n">root</span><span class="p">,</span><span class="x"> </span><span class="o">*</span><span class="n">output</span><span class="p">,</span><span class="x"> </span><span class="n">formatted</span><span class="p">)</span><span class="x"> + + </span><span class="n">direct</span><span class="o">.</span><span class="n">Execute</span><span class="p">(</span><span class="n">context</span><span class="o">.</span><span class="n">Background</span><span class="p">(),</span><span class="x"> </span><span class="n">pipeline</span><span class="p">)</span><span class="x"> +</span><span class="p">}</span><span class="x"> +</span></code></pre> +</div> + +<p class="language-go"><a class="button button--primary" target="_blank" href="https://colab.sandbox.google.com/github/apache/beam/blob/master/examples/notebooks/get-started/try-apache-beam-go.ipynb"> + Run in Colab +</a> +<a class="button button--primary" target="_blank" href="https://github.com/apache/beam/blob/master/examples/notebooks/get-started/try-apache-beam-go.ipynb"> + View on GitHub +</a></p> + +<p class="language-go">To learn how to install and run the Apache Beam Go SDK on your own computer, follow the instructions in the <a href="/get-started/quickstart-go">Go Quickstart</a>.</p> + +<p>For a more detailed explanation about how WordCount works, see the <a href="/get-started/wordcount-example">WordCount Example Walkthrough</a>.</p> + +<h2 id="next-steps">Next Steps</h2> + +<ul> + <li>Walk through additional WordCount examples in the <a href="/get-started/wordcount-example">WordCount Example Walkthrough</a>.</li> + <li>Take a self-paced tour through our <a href="/documentation/resources/learning-resources">Learning Resources</a>.</li> + <li>Dive in to some of our favorite <a href="/documentation/resources/videos-and-podcasts">Videos and Podcasts</a>.</li> + <li>Join the Beam <a href="/community/contact-us">users@</a> mailing list.</li> + <li>If you’re interested in contributing to the Apache Beam codebase, see the <a href="/contribute">Contribution Guide</a>.</li> +</ul> + +<p>Please don’t hesitate to <a href="/community/contact-us">reach out</a> if you encounter any issues!</p> + + </div> + </div> + <!-- + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. See accompanying LICENSE file. +--> + +<footer class="footer"> + <div class="footer__contained"> + <div class="footer__cols"> + <div class="footer__cols__col"> + <div class="footer__cols__col__logo"> + <img src="/images/beam_logo_circle.svg" class="footer__logo" alt="Beam logo"> + </div> + <div class="footer__cols__col__logo"> + <img src="/images/apache_logo_circle.svg" class="footer__logo" alt="Apache logo"> + </div> + </div> + <div class="footer__cols__col footer__cols__col--md"> + <div class="footer__cols__col__title">Start</div> + <div class="footer__cols__col__link"><a href="/get-started/beam-overview/">Overview</a></div> + <div class="footer__cols__col__link"><a href="/get-started/quickstart-java/">Quickstart (Java)</a></div> + <div class="footer__cols__col__link"><a href="/get-started/quickstart-py/">Quickstart (Python)</a></div> + <div class="footer__cols__col__link"><a href="/get-started/quickstart-go/">Quickstart (Go)</a></div> + <div class="footer__cols__col__link"><a href="/get-started/downloads/">Downloads</a></div> + </div> + <div class="footer__cols__col footer__cols__col--md"> + <div class="footer__cols__col__title">Docs</div> + <div class="footer__cols__col__link"><a href="/documentation/programming-guide/">Concepts</a></div> + <div class="footer__cols__col__link"><a href="/documentation/pipelines/design-your-pipeline/">Pipelines</a></div> + <div class="footer__cols__col__link"><a href="/documentation/runners/capability-matrix/">Runners</a></div> + </div> + <div class="footer__cols__col footer__cols__col--md"> + <div class="footer__cols__col__title">Community</div> + <div class="footer__cols__col__link"><a href="/contribute/">Contribute</a></div> + <div class="footer__cols__col__link"><a href="https://projects.apache.org/committee.html?beam" target="_blank">Team<img src="/images/external-link-icon.png" + width="14" height="14" + alt="External link."></a></div> + <div class="footer__cols__col__link"><a href="/contribute/presentation-materials/">Media</a></div> + </div> + <div class="footer__cols__col footer__cols__col--md"> + <div class="footer__cols__col__title">Resources</div> + <div class="footer__cols__col__link"><a href="/blog/">Blog</a></div> + <div class="footer__cols__col__link"><a href="/get-started/support/">Support</a></div> + <div class="footer__cols__col__link"><a href="https://github.com/apache/beam">GitHub</a></div> + </div> + </div> + </div> + <div class="footer__bottom"> + © + <a href="http://www.apache.org">The Apache Software Foundation</a> + | <a href="/privacy_policy">Privacy Policy</a> + | <a href="/feed.xml">RSS Feed</a> + <br><br> + Apache Beam, Apache, Beam, the Beam logo, and the Apache feather logo are + either registered trademarks or trademarks of The Apache Software + Foundation. All other products or name brands are trademarks of their + respective holders, including The Apache Software Foundation. + </div> +</footer> + + </body> +</html> diff --git a/website/generated-content/get-started/wordcount-example/index.html b/website/generated-content/get-started/wordcount-example/index.html index 48ecce2..e0e95d9 100644 --- a/website/generated-content/get-started/wordcount-example/index.html +++ b/website/generated-content/get-started/wordcount-example/index.html @@ -156,6 +156,7 @@ <span class="section-nav-list-title">Quickstarts</span> <ul class="section-nav-list"> + <li><a href="/get-started/try-apache-beam/">Try Apache Beam</a></li> <li><a href="/get-started/quickstart-java/">Quickstart - Java</a></li> <li><a href="/get-started/quickstart-py/">Quickstart - Python</a></li> <li><a href="/get-started/quickstart-go/">Quickstart - Go</a></li> diff --git a/website/generated-content/index.html b/website/generated-content/index.html index c688e95..f311a56 100644 --- a/website/generated-content/index.html +++ b/website/generated-content/index.html @@ -160,12 +160,13 @@ limitations under the License. </div> <div class="hero__ctas hero__ctas--first"> <a class="button button--primary" href="/get-started/beam-overview/">Learn more</a> + <a class="button button--primary" href="/get-started/try-apache-beam/">Try Beam</a> <a class="button button--primary" href="/get-started/downloads/">Download Beam SDK 2.11.0</a> </div> <div class="hero__ctas"> <a class="button" href="/get-started/quickstart-java/">Java Quickstart</a> <a class="button" href="/get-started/quickstart-py/">Python Quickstart</a> - <a class="button" href="/get-started/quickstart-go/">Go Quickstart</a> + <a class="button" href="/get-started/quickstart-go/">Go Quickstart</a> </div> </div> </div>