blob: cee5d676f08696925c80b4e734777f515a57a5e6 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="StudySettings">
<StudyTaskManager>
<option name="VERSION" value="14" />
<option name="myUserTests">
<map />
</option>
<option name="course">
<EduCourse>
<option name="authors">
<list>
<StepikUserInfo>
<option name="firstName" value="Henry" />
<option name="id" value="48485817" />
<option name="lastName" value="Suryawirawan" />
</StepikUserInfo>
</list>
</option>
<option name="compatible" value="true" />
<option name="courseMode" value="Course Creator" />
<option name="createDate" value="1557823043901" />
<option name="customPresentableName" />
<option name="description" value="This course provides a series of katas to get familiar with Apache Beam. &#10;&#10;Apache Beam website – https://beam.apache.org/" />
<option name="environment" value="" />
<option name="fromZip" value="false" />
<option name="id" value="54530" />
<option name="index" value="-1" />
<option name="instructors">
<list>
<option value="48485817" />
</list>
</option>
<option name="language" value="JAVA 8" />
<option name="languageCode" value="en" />
<option name="name" value="Beam Katas - Java" />
<option name="public" value="true" />
<option name="sectionIds">
<list />
</option>
<option name="stepikChangeStatus" value="Content changed" />
<option name="type" value="pycharm11 JAVA 8" />
<option name="updateDate" value="1560936271000" />
<option name="items">
<list>
<Section>
<option name="courseId" value="54530" />
<option name="customPresentableName" />
<option name="id" value="85639" />
<option name="index" value="1" />
<option name="name" value="Introduction" />
<option name="position" value="1" />
<option name="stepikChangeStatus" value="Up to date" />
<option name="updateDate" value="1559325015000" />
<option name="items">
<list>
<Lesson>
<option name="customPresentableName" />
<option name="id" value="229506" />
<option name="index" value="1" />
<option name="name" value="Hello Beam" />
<option name="stepikChangeStatus" value="Content changed" />
<option name="updateDate" value="1559325015000" />
<option name="unitId" value="-1" />
<option name="items">
<list>
<EduTask>
<option name="customPresentableName" />
<option name="descriptionFormat" value="HTML" />
<option name="descriptionText" value="&lt;!--&#10; ~ Licensed to the Apache Software Foundation (ASF) under one&#10; ~ or more contributor license agreements. See the NOTICE file&#10; ~ distributed with this work for additional information&#10; ~ regarding copyright ownership. The ASF licenses this file&#10; ~ to you under the Apache License, Version 2.0 (the&#10; ~ &quot;License&quot;); you may not use this file except in compliance&#10; ~ with the License. You may obtain a copy of the License at&#10; ~&#10; ~ http://www.apache.org/licenses/LICENSE-2.0&#10; ~&#10; ~ Unless required by applicable law or agreed to in writing, software&#10; ~ distributed under the License is distributed on an &quot;AS IS&quot; BASIS,&#10; ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&#10; ~ See the License for the specific language governing permissions and&#10; ~ limitations under the License.&#10; --&gt;&#10;&#10;&lt;html&gt;&#10;&lt;h2&gt;Hello Beam Pipeline&lt;/h2&gt;&#10;&lt;p&gt;&#10; Apache Beam is an open source, unified model for defining both batch and streaming data-parallel&#10; processing pipelines. Using one of the open source Beam SDKs, you build a program that defines the&#10; pipeline. The pipeline is then executed by one of Beam’s supported distributed processing&#10; back-ends, which include Apache Apex, Apache Flink, Apache Spark, and Google Cloud Dataflow.&#10;&lt;/p&gt;&#10;&lt;p&gt;&#10; Beam is particularly useful for Embarrassingly Parallel data processing tasks, in which the&#10; problem can be decomposed into many smaller bundles of data that can be processed independently&#10; and in parallel. You can also use Beam for Extract, Transform, and Load (ETL) tasks and pure data&#10; integration. These tasks are useful for moving data between different storage media and data&#10; sources, transforming data into a more desirable format, or loading data onto a new system.&#10;&lt;/p&gt;&#10;&lt;p&gt;&#10; To learn more about Apache Beam, refer to&#10; &lt;a href=&quot;https://beam.apache.org/get-started/beam-overview/&quot;&gt;Apache Beam Overview&lt;/a&gt;.&#10;&lt;/p&gt;&#10;&lt;p&gt;&#10; &lt;b&gt;Kata:&lt;/b&gt; Your first kata is to create a simple pipeline that takes a hardcoded input element&#10; &quot;Hello Beam&quot;.&#10;&lt;/p&gt;&#10;&lt;br&gt;&#10;&lt;div class=&quot;hint&quot;&gt;&#10; Hardcoded input can be created using&#10; &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/Create.html&quot;&gt;&#10; Create&lt;/a&gt;.&#10;&lt;/div&gt;&#10;&lt;div class=&quot;hint&quot;&gt;&#10; Refer to the Beam Programming Guide&#10; &lt;a href=&quot;https://beam.apache.org/documentation/programming-guide/#creating-pcollection-in-memory&quot;&gt;&#10; &quot;Creating a PCollection from in-memory data&quot;&lt;/a&gt; section for more information.&#10;&lt;/div&gt;&#10;&lt;/html&gt;&#10;" />
<option name="feedbackLink">
<FeedbackLink>
<option name="link" />
<option name="type" value="STEPIK" />
</FeedbackLink>
</option>
<option name="id" value="713723" />
<option name="index" value="1" />
<option name="name" value="Hello Beam" />
<option name="record" value="-1" />
<option name="status" value="Unchecked" />
<option name="stepikChangeStatus" value="Info and Content changed" />
<option name="files">
<map>
<entry key="src/org/apache/beam/learning/katas/intro/hello/Task.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list>
<AnswerPlaceholder>
<option name="hints">
<list />
</option>
<option name="index" value="0" />
<option name="initialState" />
<option name="initializedFromDependency" value="false" />
<option name="length" value="6" />
<option name="offset" value="1552" />
<option name="placeholderDependency" />
<option name="placeholderText" value="TODO()" />
<option name="possibleAnswer" value="pipeline.apply(Create.of(&quot;Hello Beam&quot;))" />
<option name="selected" value="false" />
<option name="status" value="Unchecked" />
<option name="studentAnswer" />
<option name="useLength" value="false" />
</AnswerPlaceholder>
</list>
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="src/org/apache/beam/learning/katas/intro/hello/Task.java" />
<option name="text" value="class Task {&#10; //put your task here&#10;}" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="true" />
</TaskFile>
</value>
</entry>
<entry key="test/org/apache/beam/learning/katas/intro/hello/TaskTest.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list />
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="test/org/apache/beam/learning/katas/intro/hello/TaskTest.java" />
<option name="text" value="public class Test {&#10; // put your test here&#10;}" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="false" />
</TaskFile>
</value>
</entry>
</map>
</option>
<option name="updateDate" value="1560936162000" />
</EduTask>
</list>
</option>
</Lesson>
</list>
</option>
</Section>
<Section>
<option name="courseId" value="54530" />
<option name="customPresentableName" />
<option name="id" value="85640" />
<option name="index" value="2" />
<option name="name" value="Core Transforms" />
<option name="position" value="2" />
<option name="stepikChangeStatus" value="Up to date" />
<option name="updateDate" value="1559325050000" />
<option name="items">
<list>
<Lesson>
<option name="customPresentableName" />
<option name="id" value="229507" />
<option name="index" value="1" />
<option name="name" value="Map" />
<option name="stepikChangeStatus" value="Content changed" />
<option name="updateDate" value="1559325026000" />
<option name="unitId" value="-1" />
<option name="items">
<list>
<EduTask>
<option name="customPresentableName" />
<option name="descriptionFormat" value="HTML" />
<option name="descriptionText" value="&lt;!--&#10; ~ Licensed to the Apache Software Foundation (ASF) under one&#10; ~ or more contributor license agreements. See the NOTICE file&#10; ~ distributed with this work for additional information&#10; ~ regarding copyright ownership. The ASF licenses this file&#10; ~ to you under the Apache License, Version 2.0 (the&#10; ~ &quot;License&quot;); you may not use this file except in compliance&#10; ~ with the License. You may obtain a copy of the License at&#10; ~&#10; ~ http://www.apache.org/licenses/LICENSE-2.0&#10; ~&#10; ~ Unless required by applicable law or agreed to in writing, software&#10; ~ distributed under the License is distributed on an &quot;AS IS&quot; BASIS,&#10; ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&#10; ~ See the License for the specific language governing permissions and&#10; ~ limitations under the License.&#10; --&gt;&#10;&#10;&lt;html&gt;&#10;&lt;h2&gt;ParDo&lt;/h2&gt;&#10;&lt;p&gt;&#10; ParDo is a Beam transform for generic parallel processing. The ParDo processing paradigm is&#10; similar to the “Map” phase of a Map/Shuffle/Reduce-style algorithm: a ParDo transform considers&#10; each element in the input PCollection, performs some processing function (your user code) on&#10; that element, and emits zero, one, or multiple elements to an output PCollection.&#10;&lt;/p&gt;&#10;&lt;p&gt;&#10; &lt;b&gt;Kata:&lt;/b&gt; Please write a simple ParDo that maps the input element by multiplying it by 10.&#10;&lt;/p&gt;&#10;&lt;br&gt;&#10;&lt;div class=&quot;hint&quot;&gt;&#10; Use &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/ParDo.html&quot;&gt;&#10; ParDo&lt;/a&gt;&#10; with &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/DoFn.html&quot;&gt;&#10; DoFn&lt;/a&gt;.&#10;&lt;/div&gt;&#10;&lt;div class=&quot;hint&quot;&gt;&#10; Refer to the Beam Programming Guide&#10; &lt;a href=&quot;https://beam.apache.org/documentation/programming-guide/#pardo&quot;&gt;&quot;ParDo&quot;&lt;/a&gt; section for&#10; more information.&#10;&lt;/div&gt;&#10;&lt;/html&gt;&#10;" />
<option name="feedbackLink">
<FeedbackLink>
<option name="link" />
<option name="type" value="STEPIK" />
</FeedbackLink>
</option>
<option name="id" value="713724" />
<option name="index" value="1" />
<option name="name" value="ParDo" />
<option name="record" value="-1" />
<option name="status" value="Unchecked" />
<option name="stepikChangeStatus" value="Info and Content changed" />
<option name="files">
<map>
<entry key="src/org/apache/beam/learning/katas/coretransforms/map/pardo/Task.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list>
<AnswerPlaceholder>
<option name="hints">
<list />
</option>
<option name="index" value="0" />
<option name="initialState" />
<option name="initializedFromDependency" value="false" />
<option name="length" value="6" />
<option name="offset" value="1752" />
<option name="placeholderDependency" />
<option name="placeholderText" value="TODO()" />
<option name="possibleAnswer" value="input.apply(ParDo.of(new DoFn&lt;Integer, Integer&gt;() {&#10;&#10; @ProcessElement&#10; public void processElement(@Element Integer number, OutputReceiver&lt;Integer&gt; out) {&#10; out.output(number * 10);&#10; }&#10;&#10; }))" />
<option name="selected" value="false" />
<option name="status" value="Unchecked" />
<option name="studentAnswer" />
<option name="useLength" value="false" />
</AnswerPlaceholder>
</list>
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="src/org/apache/beam/learning/katas/coretransforms/map/pardo/Task.java" />
<option name="text" value="class Task {&#10; //put your task here&#10;}" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="true" />
</TaskFile>
</value>
</entry>
<entry key="test/org/apache/beam/learning/katas/coretransforms/map/pardo/TaskTest.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list />
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="test/org/apache/beam/learning/katas/coretransforms/map/pardo/TaskTest.java" />
<option name="text" value="public class Test {&#10; // put your test here&#10;}" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="false" />
</TaskFile>
</value>
</entry>
</map>
</option>
<option name="updateDate" value="1560936166000" />
</EduTask>
<EduTask>
<option name="customPresentableName" />
<option name="descriptionFormat" value="HTML" />
<option name="descriptionText" value="&lt;!--&#10; ~ Licensed to the Apache Software Foundation (ASF) under one&#10; ~ or more contributor license agreements. See the NOTICE file&#10; ~ distributed with this work for additional information&#10; ~ regarding copyright ownership. The ASF licenses this file&#10; ~ to you under the Apache License, Version 2.0 (the&#10; ~ &quot;License&quot;); you may not use this file except in compliance&#10; ~ with the License. You may obtain a copy of the License at&#10; ~&#10; ~ http://www.apache.org/licenses/LICENSE-2.0&#10; ~&#10; ~ Unless required by applicable law or agreed to in writing, software&#10; ~ distributed under the License is distributed on an &quot;AS IS&quot; BASIS,&#10; ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&#10; ~ See the License for the specific language governing permissions and&#10; ~ limitations under the License.&#10; --&gt;&#10;&#10;&lt;html&gt;&#10;&lt;h2&gt;ParDo OneToMany&lt;/h2&gt;&#10;&lt;p&gt;&#10; &lt;b&gt;Kata:&lt;/b&gt; Please write a ParDo that maps each input sentence into words tokenized by&#10; whitespace (&quot; &quot;).&#10;&lt;/p&gt;&#10;&lt;br&gt;&#10;&lt;div class=&quot;hint&quot;&gt;&#10; You can call &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/DoFn.OutputReceiver.html&quot;&gt;&#10; OutputReceiver&lt;/a&gt; multiple times in a&#10; &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/ParDo.html&quot;&gt;&#10; ParDo&lt;/a&gt;.&#10;&lt;/div&gt;&#10;&lt;div class=&quot;hint&quot;&gt;&#10; If you're using Beam version before v2.5.0, you can call&#10; &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/DoFn.WindowedContext.html#output-OutputT-&quot;&gt;&#10; DoFn.ProcessContext.output(..)&lt;/a&gt; multiple times in a&#10; &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/ParDo.html&quot;&gt;ParDo&lt;/a&gt;.&#10;&lt;/div&gt;&#10;&lt;/html&gt;" />
<option name="feedbackLink">
<FeedbackLink>
<option name="link" />
<option name="type" value="STEPIK" />
</FeedbackLink>
</option>
<option name="id" value="713725" />
<option name="index" value="2" />
<option name="name" value="ParDo OneToMany" />
<option name="record" value="-1" />
<option name="status" value="Unchecked" />
<option name="stepikChangeStatus" value="Info and Content changed" />
<option name="files">
<map>
<entry key="src/org/apache/beam/learning/katas/coretransforms/map/pardoonetomany/Task.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list>
<AnswerPlaceholder>
<option name="hints">
<list />
</option>
<option name="index" value="0" />
<option name="initialState" />
<option name="initializedFromDependency" value="false" />
<option name="length" value="6" />
<option name="offset" value="1777" />
<option name="placeholderDependency" />
<option name="placeholderText" value="TODO()" />
<option name="possibleAnswer" value="input.apply(ParDo.of(new DoFn&lt;String, String&gt;() {&#10;&#10; @ProcessElement&#10; public void processElement(@Element String sentence, OutputReceiver&lt;String&gt; out) {&#10; String[] words = sentence.split(&quot; &quot;);&#10;&#10; for (String word : words) {&#10; out.output(word);&#10; }&#10; }&#10;&#10; }))" />
<option name="selected" value="false" />
<option name="status" value="Unchecked" />
<option name="studentAnswer" />
<option name="useLength" value="false" />
</AnswerPlaceholder>
</list>
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="src/org/apache/beam/learning/katas/coretransforms/map/pardoonetomany/Task.java" />
<option name="text" value="class Task {&#10; //put your task here&#10;}" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="true" />
</TaskFile>
</value>
</entry>
<entry key="test/org/apache/beam/learning/katas/coretransforms/map/pardoonetomany/TaskTest.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list />
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="test/org/apache/beam/learning/katas/coretransforms/map/pardoonetomany/TaskTest.java" />
<option name="text" value="public class Test {&#10; // put your test here&#10;}" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="false" />
</TaskFile>
</value>
</entry>
</map>
</option>
<option name="updateDate" value="1560936169000" />
</EduTask>
<EduTask>
<option name="customPresentableName" />
<option name="descriptionFormat" value="HTML" />
<option name="descriptionText" value="&lt;!--&#10; ~ Licensed to the Apache Software Foundation (ASF) under one&#10; ~ or more contributor license agreements. See the NOTICE file&#10; ~ distributed with this work for additional information&#10; ~ regarding copyright ownership. The ASF licenses this file&#10; ~ to you under the Apache License, Version 2.0 (the&#10; ~ &quot;License&quot;); you may not use this file except in compliance&#10; ~ with the License. You may obtain a copy of the License at&#10; ~&#10; ~ http://www.apache.org/licenses/LICENSE-2.0&#10; ~&#10; ~ Unless required by applicable law or agreed to in writing, software&#10; ~ distributed under the License is distributed on an &quot;AS IS&quot; BASIS,&#10; ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&#10; ~ See the License for the specific language governing permissions and&#10; ~ limitations under the License.&#10; --&gt;&#10;&#10;&lt;html&gt;&#10;&lt;h2&gt;MapElements&lt;/h2&gt;&#10;&lt;p&gt;&#10; The Beam SDKs provide language-specific ways to simplify how you provide your DoFn implementation.&#10;&lt;/p&gt;&#10;&lt;p&gt;&#10; MapElements can be used to simplify DoFn that maps an element to another element (one to one).&#10;&lt;/p&gt;&#10;&lt;p&gt;&#10; &lt;b&gt;Kata:&lt;/b&gt; Implement a simple map function that multiplies all input elements by 5 using&#10; &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/MapElements.html&quot;&gt;&#10; MapElements.into(...).via(...)&lt;/a&gt;.&#10;&lt;/p&gt;&#10;&lt;br&gt;&#10;&lt;div class=&quot;hint&quot;&gt;&#10; Use &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/MapElements.html&quot;&gt;&#10; MapElements.into(...).via(...)&lt;/a&gt;.&#10;&lt;/div&gt;&#10;&lt;div class=&quot;hint&quot;&gt;&#10; Refer to the Beam Programming Guide&#10; &lt;a href=&quot;https://beam.apache.org/documentation/programming-guide/#lightweight-dofns&quot;&gt;&#10; &quot;Lightweight DoFns and other abstractions&quot;&lt;/a&gt; section for more information.&#10;&lt;/div&gt;&#10;&lt;/html&gt;&#10;" />
<option name="feedbackLink">
<FeedbackLink>
<option name="link" />
<option name="type" value="STEPIK" />
</FeedbackLink>
</option>
<option name="id" value="713726" />
<option name="index" value="3" />
<option name="name" value="MapElements" />
<option name="record" value="-1" />
<option name="status" value="Unchecked" />
<option name="stepikChangeStatus" value="Info and Content changed" />
<option name="files">
<map>
<entry key="src/org/apache/beam/learning/katas/coretransforms/map/mapelements/Task.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list>
<AnswerPlaceholder>
<option name="hints">
<list />
</option>
<option name="index" value="0" />
<option name="initialState" />
<option name="initializedFromDependency" value="false" />
<option name="length" value="6" />
<option name="offset" value="1776" />
<option name="placeholderDependency" />
<option name="placeholderText" value="TODO()" />
<option name="possibleAnswer" value="input.apply(&#10; MapElements.into(TypeDescriptors.integers())&#10; .via(number -&gt; number * 5)&#10; )" />
<option name="selected" value="false" />
<option name="status" value="Unchecked" />
<option name="studentAnswer" />
<option name="useLength" value="false" />
</AnswerPlaceholder>
</list>
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="src/org/apache/beam/learning/katas/coretransforms/map/mapelements/Task.java" />
<option name="text" value="" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="true" />
</TaskFile>
</value>
</entry>
<entry key="test/org/apache/beam/learning/katas/coretransforms/map/mapelements/TaskTest.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list />
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="test/org/apache/beam/learning/katas/coretransforms/map/mapelements/TaskTest.java" />
<option name="text" value="" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="false" />
</TaskFile>
</value>
</entry>
</map>
</option>
<option name="updateDate" value="1560936172000" />
</EduTask>
<EduTask>
<option name="customPresentableName" />
<option name="descriptionFormat" value="HTML" />
<option name="descriptionText" value="&lt;!--&#10; ~ Licensed to the Apache Software Foundation (ASF) under one&#10; ~ or more contributor license agreements. See the NOTICE file&#10; ~ distributed with this work for additional information&#10; ~ regarding copyright ownership. The ASF licenses this file&#10; ~ to you under the Apache License, Version 2.0 (the&#10; ~ &quot;License&quot;); you may not use this file except in compliance&#10; ~ with the License. You may obtain a copy of the License at&#10; ~&#10; ~ http://www.apache.org/licenses/LICENSE-2.0&#10; ~&#10; ~ Unless required by applicable law or agreed to in writing, software&#10; ~ distributed under the License is distributed on an &quot;AS IS&quot; BASIS,&#10; ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&#10; ~ See the License for the specific language governing permissions and&#10; ~ limitations under the License.&#10; --&gt;&#10;&#10;&lt;html&gt;&#10;&lt;h2&gt;FlatMapElements&lt;/h2&gt;&#10;&lt;p&gt;&#10; The Beam SDKs provide language-specific ways to simplify how you provide your DoFn implementation.&#10;&lt;/p&gt;&#10;&lt;p&gt;&#10; FlatMapElements can be used to simplify DoFn that maps an element to multiple elements (one to&#10; many).&#10;&lt;/p&gt;&#10;&lt;p&gt;&#10; &lt;b&gt;Kata:&lt;/b&gt; Implement a function that maps each input sentence into words tokenized by whitespace&#10; (&quot; &quot;) using&#10; &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/FlatMapElements.html&quot;&gt;&#10; FlatMapElements.into(...).via(...)&lt;/a&gt;.&#10;&lt;/p&gt;&#10;&lt;br&gt;&#10;&lt;div class=&quot;hint&quot;&gt;&#10; Use &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/FlatMapElements.html&quot;&gt;&#10; FlatMapElements.into(...).via(...)&lt;/a&gt;.&#10;&lt;/div&gt;&#10;&lt;div class=&quot;hint&quot;&gt;&#10; Refer to the Beam Programming Guide&#10; &lt;a href=&quot;https://beam.apache.org/documentation/programming-guide/#lightweight-dofns&quot;&gt;&#10; &quot;Lightweight DoFns and other abstractions&quot;&lt;/a&gt; section for more information.&#10;&lt;/div&gt;&#10;&lt;/html&gt;&#10;" />
<option name="feedbackLink">
<FeedbackLink>
<option name="link" />
<option name="type" value="STEPIK" />
</FeedbackLink>
</option>
<option name="id" value="713727" />
<option name="index" value="4" />
<option name="name" value="FlatMapElements" />
<option name="record" value="-1" />
<option name="status" value="Unchecked" />
<option name="stepikChangeStatus" value="Info and Content changed" />
<option name="files">
<map>
<entry key="src/org/apache/beam/learning/katas/coretransforms/map/flatmapelements/Task.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list>
<AnswerPlaceholder>
<option name="hints">
<list />
</option>
<option name="index" value="0" />
<option name="initialState" />
<option name="initializedFromDependency" value="false" />
<option name="length" value="6" />
<option name="offset" value="1835" />
<option name="placeholderDependency" />
<option name="placeholderText" value="TODO()" />
<option name="possibleAnswer" value="input.apply(&#10; FlatMapElements.into(TypeDescriptors.strings())&#10; .via(sentence -&gt; Arrays.asList(sentence.split(&quot; &quot;)))&#10; )" />
<option name="selected" value="false" />
<option name="status" value="Unchecked" />
<option name="studentAnswer" />
<option name="useLength" value="false" />
</AnswerPlaceholder>
</list>
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="src/org/apache/beam/learning/katas/coretransforms/map/flatmapelements/Task.java" />
<option name="text" value="" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="true" />
</TaskFile>
</value>
</entry>
<entry key="test/org/apache/beam/learning/katas/coretransforms/map/flatmapelements/TaskTest.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list />
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="test/org/apache/beam/learning/katas/coretransforms/map/flatmapelements/TaskTest.java" />
<option name="text" value="" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="false" />
</TaskFile>
</value>
</entry>
</map>
</option>
<option name="updateDate" value="1560791586000" />
</EduTask>
</list>
</option>
</Lesson>
<Lesson>
<option name="customPresentableName" />
<option name="id" value="229508" />
<option name="index" value="2" />
<option name="name" value="GroupByKey" />
<option name="stepikChangeStatus" value="Content changed" />
<option name="updateDate" value="1559325029000" />
<option name="unitId" value="-1" />
<option name="items">
<list>
<EduTask>
<option name="customPresentableName" />
<option name="descriptionFormat" value="HTML" />
<option name="descriptionText" value="&lt;!--&#10; ~ Licensed to the Apache Software Foundation (ASF) under one&#10; ~ or more contributor license agreements. See the NOTICE file&#10; ~ distributed with this work for additional information&#10; ~ regarding copyright ownership. The ASF licenses this file&#10; ~ to you under the Apache License, Version 2.0 (the&#10; ~ &quot;License&quot;); you may not use this file except in compliance&#10; ~ with the License. You may obtain a copy of the License at&#10; ~&#10; ~ http://www.apache.org/licenses/LICENSE-2.0&#10; ~&#10; ~ Unless required by applicable law or agreed to in writing, software&#10; ~ distributed under the License is distributed on an &quot;AS IS&quot; BASIS,&#10; ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&#10; ~ See the License for the specific language governing permissions and&#10; ~ limitations under the License.&#10; --&gt;&#10;&#10;&lt;html&gt;&#10;&lt;h2&gt;GroupByKey&lt;/h2&gt;&#10;&lt;p&gt;&#10; GroupByKey is a Beam transform for processing collections of key/value pairs. It’s a parallel&#10; reduction operation, analogous to the Shuffle phase of a Map/Shuffle/Reduce-style algorithm. The&#10; input to GroupByKey is a collection of key/value pairs that represents a multimap, where the&#10; collection contains multiple pairs that have the same key, but different values. Given such a&#10; collection, you use GroupByKey to collect all of the values associated with each unique key.&#10;&lt;/p&gt;&#10;&lt;p&gt;&#10; &lt;b&gt;Kata:&lt;/b&gt; Implement a&#10; &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/GroupByKey.html&quot;&gt;&#10; GroupByKey&lt;/a&gt; transform that groups words by its first letter.&#10;&lt;/p&gt;&#10;&lt;br&gt;&#10;&lt;div class=&quot;hint&quot;&gt;&#10; Refer to &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/values/KV.html&quot;&gt;&#10; KV&lt;/a&gt; and&#10; &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/GroupByKey.html&quot;&gt;&#10; GroupByKey&lt;/a&gt; to solve this problem.&#10;&lt;/div&gt;&#10;&lt;div class=&quot;hint&quot;&gt;&#10; Refer to the Beam Programming Guide&#10; &lt;a href=&quot;https://beam.apache.org/documentation/programming-guide/#groupbykey&quot;&gt;&#10; &quot;GroupByKey&quot;&lt;/a&gt; section for more information.&#10;&lt;/div&gt;&#10;&lt;/html&gt;&#10;" />
<option name="feedbackLink">
<FeedbackLink>
<option name="link" />
<option name="type" value="STEPIK" />
</FeedbackLink>
</option>
<option name="id" value="713728" />
<option name="index" value="1" />
<option name="name" value="GroupByKey" />
<option name="record" value="-1" />
<option name="status" value="Unchecked" />
<option name="stepikChangeStatus" value="Info and Content changed" />
<option name="files">
<map>
<entry key="src/org/apache/beam/learning/katas/coretransforms/groupbykey/Task.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list>
<AnswerPlaceholder>
<option name="hints">
<list />
</option>
<option name="index" value="0" />
<option name="initialState" />
<option name="initializedFromDependency" value="false" />
<option name="length" value="6" />
<option name="offset" value="2025" />
<option name="placeholderDependency" />
<option name="placeholderText" value="TODO()" />
<option name="possibleAnswer" value="input&#10; .apply(MapElements.into(kvs(strings(), strings()))&#10; .via(word -&gt; KV.of(word.substring(0, 1), word)))&#10;&#10; .apply(GroupByKey.create())" />
<option name="selected" value="false" />
<option name="status" value="Unchecked" />
<option name="studentAnswer" />
<option name="useLength" value="false" />
</AnswerPlaceholder>
</list>
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="src/org/apache/beam/learning/katas/coretransforms/groupbykey/Task.java" />
<option name="text" value="" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="true" />
</TaskFile>
</value>
</entry>
<entry key="test/org/apache/beam/learning/katas/coretransforms/groupbykey/TaskTest.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list />
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="test/org/apache/beam/learning/katas/coretransforms/groupbykey/TaskTest.java" />
<option name="text" value="" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="false" />
</TaskFile>
</value>
</entry>
</map>
</option>
<option name="updateDate" value="1560936177000" />
</EduTask>
</list>
</option>
</Lesson>
<Lesson>
<option name="customPresentableName" />
<option name="id" value="229509" />
<option name="index" value="3" />
<option name="name" value="CoGroupByKey" />
<option name="stepikChangeStatus" value="Content changed" />
<option name="updateDate" value="1559325032000" />
<option name="unitId" value="-1" />
<option name="items">
<list>
<EduTask>
<option name="customPresentableName" />
<option name="descriptionFormat" value="HTML" />
<option name="descriptionText" value="&lt;!--&#10; ~ Licensed to the Apache Software Foundation (ASF) under one&#10; ~ or more contributor license agreements. See the NOTICE file&#10; ~ distributed with this work for additional information&#10; ~ regarding copyright ownership. The ASF licenses this file&#10; ~ to you under the Apache License, Version 2.0 (the&#10; ~ &quot;License&quot;); you may not use this file except in compliance&#10; ~ with the License. You may obtain a copy of the License at&#10; ~&#10; ~ http://www.apache.org/licenses/LICENSE-2.0&#10; ~&#10; ~ Unless required by applicable law or agreed to in writing, software&#10; ~ distributed under the License is distributed on an &quot;AS IS&quot; BASIS,&#10; ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&#10; ~ See the License for the specific language governing permissions and&#10; ~ limitations under the License.&#10; --&gt;&#10;&#10;&lt;html&gt;&#10;&lt;h2&gt;CoGroupByKey&lt;/h2&gt;&#10;&lt;p&gt;&#10; CoGroupByKey performs a relational join of two or more key/value PCollections that have the same&#10; key type.&#10;&lt;/p&gt;&#10;&lt;p&gt;&#10; &lt;b&gt;Kata:&lt;/b&gt; Implement a&#10; &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/join/CoGroupByKey.html&quot;&gt;&#10; CoGroupByKey&lt;/a&gt; transform that join words by its first alphabetical letter, and then produces&#10; the toString() representation of the WordsAlphabet model.&#10;&lt;/p&gt;&#10;&lt;br&gt;&#10;&lt;div class=&quot;hint&quot;&gt;&#10; Refer to &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/join/CoGroupByKey.html&quot;&gt;&#10; CoGroupByKey&lt;/a&gt;,&#10; &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/values/TupleTag.html&quot;&gt;&#10; TupleTag&lt;/a&gt;, and&#10; &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/join/CoGbkResult.html&quot;&gt;&#10; CoGbkResult&lt;/a&gt;.&#10;&lt;/div&gt;&#10;&lt;div class=&quot;hint&quot;&gt;&#10; Refer to the Beam Programming Guide&#10; &lt;a href=&quot;https://beam.apache.org/documentation/programming-guide/#cogroupbykey&quot;&gt;&#10; &quot;CoGroupByKey&quot;&lt;/a&gt; section for more information.&#10;&lt;/div&gt;&#10;&lt;/html&gt;&#10;" />
<option name="feedbackLink">
<FeedbackLink>
<option name="link" />
<option name="type" value="STEPIK" />
</FeedbackLink>
</option>
<option name="id" value="713729" />
<option name="index" value="1" />
<option name="name" value="CoGroupByKey" />
<option name="record" value="-1" />
<option name="status" value="Unchecked" />
<option name="stepikChangeStatus" value="Info and Content changed" />
<option name="files">
<map>
<entry key="src/org/apache/beam/learning/katas/coretransforms/cogroupbykey/Task.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list>
<AnswerPlaceholder>
<option name="hints">
<list />
</option>
<option name="index" value="0" />
<option name="initialState" />
<option name="initializedFromDependency" value="false" />
<option name="length" value="6" />
<option name="offset" value="2418" />
<option name="placeholderDependency" />
<option name="placeholderText" value="TODO()" />
<option name="possibleAnswer" value="TupleTag&lt;String&gt; fruitsTag = new TupleTag&lt;&gt;();&#10; TupleTag&lt;String&gt; countriesTag = new TupleTag&lt;&gt;();&#10;&#10; MapElements&lt;String, KV&lt;String, String&gt;&gt; mapToAlphabetKv =&#10; MapElements.into(kvs(strings(), strings()))&#10; .via(word -&gt; KV.of(word.substring(0, 1), word));&#10;&#10; PCollection&lt;KV&lt;String, String&gt;&gt; fruitsPColl = fruits.apply(&quot;Fruit to KV&quot;, mapToAlphabetKv);&#10; PCollection&lt;KV&lt;String, String&gt;&gt; countriesPColl = countries&#10; .apply(&quot;Country to KV&quot;, mapToAlphabetKv);&#10;&#10; return KeyedPCollectionTuple&#10; .of(fruitsTag, fruitsPColl)&#10; .and(countriesTag, countriesPColl)&#10;&#10; .apply(CoGroupByKey.create())&#10;&#10; .apply(ParDo.of(new DoFn&lt;KV&lt;String, CoGbkResult&gt;, String&gt;() {&#10;&#10; @ProcessElement&#10; public void processElement(&#10; @Element KV&lt;String, CoGbkResult&gt; element, OutputReceiver&lt;String&gt; out) {&#10;&#10; String alphabet = element.getKey();&#10; CoGbkResult coGbkResult = element.getValue();&#10;&#10; String fruit = coGbkResult.getOnly(fruitsTag);&#10; String country = coGbkResult.getOnly(countriesTag);&#10;&#10; out.output(new WordsAlphabet(alphabet, fruit, country).toString());&#10; }&#10;&#10; }));" />
<option name="selected" value="false" />
<option name="status" value="Unchecked" />
<option name="studentAnswer" />
<option name="useLength" value="false" />
</AnswerPlaceholder>
</list>
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="src/org/apache/beam/learning/katas/coretransforms/cogroupbykey/Task.java" />
<option name="text" value="" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="true" />
</TaskFile>
</value>
</entry>
<entry key="src/org/apache/beam/learning/katas/coretransforms/cogroupbykey/WordsAlphabet.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list />
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="src/org/apache/beam/learning/katas/coretransforms/cogroupbykey/WordsAlphabet.java" />
<option name="text" value="" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="true" />
</TaskFile>
</value>
</entry>
<entry key="test/org/apache/beam/learning/katas/coretransforms/cogroupbykey/TaskTest.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list />
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="test/org/apache/beam/learning/katas/coretransforms/cogroupbykey/TaskTest.java" />
<option name="text" value="" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="false" />
</TaskFile>
</value>
</entry>
</map>
</option>
<option name="updateDate" value="1560936180000" />
</EduTask>
</list>
</option>
</Lesson>
<Lesson>
<option name="customPresentableName" />
<option name="id" value="229510" />
<option name="index" value="4" />
<option name="name" value="Combine" />
<option name="stepikChangeStatus" value="Content changed" />
<option name="updateDate" value="1559325044000" />
<option name="unitId" value="-1" />
<option name="items">
<list>
<EduTask>
<option name="customPresentableName" />
<option name="descriptionFormat" value="HTML" />
<option name="descriptionText" value="&lt;!--&#10; ~ Licensed to the Apache Software Foundation (ASF) under one&#10; ~ or more contributor license agreements. See the NOTICE file&#10; ~ distributed with this work for additional information&#10; ~ regarding copyright ownership. The ASF licenses this file&#10; ~ to you under the Apache License, Version 2.0 (the&#10; ~ &quot;License&quot;); you may not use this file except in compliance&#10; ~ with the License. You may obtain a copy of the License at&#10; ~&#10; ~ http://www.apache.org/licenses/LICENSE-2.0&#10; ~&#10; ~ Unless required by applicable law or agreed to in writing, software&#10; ~ distributed under the License is distributed on an &quot;AS IS&quot; BASIS,&#10; ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&#10; ~ See the License for the specific language governing permissions and&#10; ~ limitations under the License.&#10; --&gt;&#10;&#10;&lt;html&gt;&#10;&lt;h2&gt;Combine - Simple Function&lt;/h2&gt;&#10;&lt;p&gt;&#10; Combine is a Beam transform for combining collections of elements or values in your data.&#10; When you apply a Combine transform, you must provide the function that contains the logic for&#10; combining the elements or values. The combining function should be commutative and associative,&#10; as the function is not necessarily invoked exactly once on all values with a given key. Because&#10; the input data (including the value collection) may be distributed across multiple workers, the&#10; combining function might be called multiple times to perform partial combining on subsets of&#10; the value collection.&#10;&lt;/p&gt;&#10;&lt;p&gt;&#10; Simple combine operations, such as sums, can usually be implemented as a simple function.&#10;&lt;/p&gt;&#10;&lt;p&gt;&#10; &lt;b&gt;Kata:&lt;/b&gt; Implement the summation of numbers using&#10; &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/SerializableFunction.html&quot;&gt;&#10; Combine.globally(SerializableFunction)&lt;/a&gt;.&#10;&lt;/p&gt;&#10;&lt;br&gt;&#10;&lt;div class=&quot;hint&quot;&gt;&#10; Implement the&#10; &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/SerializableFunction.html#apply-InputT-&quot;&gt;&#10; SerializableFunction.apply&lt;/a&gt; method that performs the summation of the Iterable.&#10;&lt;/div&gt;&#10;&lt;div class=&quot;hint&quot;&gt;&#10; Refer to the Beam Programming Guide&#10; &lt;a href=&quot;https://beam.apache.org/documentation/programming-guide/#simple-combines&quot;&gt;&#10; &quot;Simple combinations using simple functions&quot;&lt;/a&gt; section for more information.&#10;&lt;/div&gt;&#10;&lt;/html&gt;&#10;" />
<option name="feedbackLink">
<FeedbackLink>
<option name="link" />
<option name="type" value="STEPIK" />
</FeedbackLink>
</option>
<option name="id" value="713730" />
<option name="index" value="1" />
<option name="name" value="Simple Function" />
<option name="record" value="-1" />
<option name="status" value="Unchecked" />
<option name="stepikChangeStatus" value="Info and Content changed" />
<option name="files">
<map>
<entry key="src/org/apache/beam/learning/katas/coretransforms/combine/simple/Task.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list>
<AnswerPlaceholder>
<option name="hints">
<list />
</option>
<option name="index" value="0" />
<option name="initialState" />
<option name="initializedFromDependency" value="false" />
<option name="length" value="6" />
<option name="offset" value="1923" />
<option name="placeholderDependency" />
<option name="placeholderText" value="TODO()" />
<option name="possibleAnswer" value="@Override&#10; public Integer apply(Iterable&lt;Integer&gt; input) {&#10; int sum = 0;&#10;&#10; for (int item : input) {&#10; sum += item;&#10; }&#10;&#10; return sum;&#10; }" />
<option name="selected" value="false" />
<option name="status" value="Unchecked" />
<option name="studentAnswer" />
<option name="useLength" value="false" />
</AnswerPlaceholder>
</list>
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="src/org/apache/beam/learning/katas/coretransforms/combine/simple/Task.java" />
<option name="text" value="class Task {&#10; //put your task here&#10;}" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="true" />
</TaskFile>
</value>
</entry>
<entry key="test/org/apache/beam/learning/katas/coretransforms/combine/simple/TaskTest.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list />
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="test/org/apache/beam/learning/katas/coretransforms/combine/simple/TaskTest.java" />
<option name="text" value="public class Test {&#10; // put your test here&#10;}" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="false" />
</TaskFile>
</value>
</entry>
</map>
</option>
<option name="updateDate" value="1560936184000" />
</EduTask>
<EduTask>
<option name="customPresentableName" />
<option name="descriptionFormat" value="HTML" />
<option name="descriptionText" value="&lt;!--&#10; ~ Licensed to the Apache Software Foundation (ASF) under one&#10; ~ or more contributor license agreements. See the NOTICE file&#10; ~ distributed with this work for additional information&#10; ~ regarding copyright ownership. The ASF licenses this file&#10; ~ to you under the Apache License, Version 2.0 (the&#10; ~ &quot;License&quot;); you may not use this file except in compliance&#10; ~ with the License. You may obtain a copy of the License at&#10; ~&#10; ~ http://www.apache.org/licenses/LICENSE-2.0&#10; ~&#10; ~ Unless required by applicable law or agreed to in writing, software&#10; ~ distributed under the License is distributed on an &quot;AS IS&quot; BASIS,&#10; ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&#10; ~ See the License for the specific language governing permissions and&#10; ~ limitations under the License.&#10; --&gt;&#10;&#10;&lt;html&gt;&#10;&lt;h2&gt;Combine - CombineFn&lt;/h2&gt;&#10;&lt;p&gt;&#10; Combine is a Beam transform for combining collections of elements or values in your data.&#10; When you apply a Combine transform, you must provide the function that contains the logic for&#10; combining the elements or values. The combining function should be commutative and associative,&#10; as the function is not necessarily invoked exactly once on all values with a given key. Because&#10; the input data (including the value collection) may be distributed across multiple workers, the&#10; combining function might be called multiple times to perform partial combining on subsets of&#10; the value collection.&#10;&lt;/p&gt;&#10;&lt;p&gt;&#10; Complex combination operations might require you to create a subclass of CombineFn that has an&#10; accumulation type distinct from the input/output type. You should use CombineFn if the combine&#10; function requires a more sophisticated accumulator, must perform additional pre- or&#10; post-processing, might change the output type, or takes the key into account.&#10;&lt;/p&gt;&#10;&lt;p&gt;&#10; &lt;b&gt;Kata:&lt;/b&gt; Implement the average of numbers using&#10; &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/Combine.CombineFn.html&quot;&gt;&#10; Combine.CombineFn&lt;/a&gt;.&#10;&lt;/p&gt;&#10;&lt;br&gt;&#10;&lt;div class=&quot;hint&quot;&gt;&#10; Extend the&#10; &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/Combine.CombineFn.html&quot;&gt;&#10; Combine.CombineFn&lt;/a&gt; class that counts the average of the number.&#10;&lt;/div&gt;&#10;&lt;div class=&quot;hint&quot;&gt;&#10; Refer to the Beam Programming Guide&#10; &lt;a href=&quot;https://beam.apache.org/documentation/programming-guide/#advanced-combines&quot;&gt;&#10; &quot;Advanced combinations using CombineFn&quot;&lt;/a&gt; section for more information.&#10;&lt;/div&gt;&#10;&lt;/html&gt;&#10;" />
<option name="feedbackLink">
<FeedbackLink>
<option name="link" />
<option name="type" value="STEPIK" />
</FeedbackLink>
</option>
<option name="id" value="713731" />
<option name="index" value="2" />
<option name="name" value="CombineFn" />
<option name="record" value="-1" />
<option name="status" value="Unchecked" />
<option name="stepikChangeStatus" value="Info and Content changed" />
<option name="files">
<map>
<entry key="src/org/apache/beam/learning/katas/coretransforms/combine/combinefn/Task.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list>
<AnswerPlaceholder>
<option name="hints">
<list />
</option>
<option name="index" value="0" />
<option name="initialState" />
<option name="initializedFromDependency" value="false" />
<option name="length" value="6" />
<option name="offset" value="1962" />
<option name="placeholderDependency" />
<option name="placeholderText" value="TODO()" />
<option name="possibleAnswer" value="class Accum implements Serializable {&#10; int sum = 0;&#10; int count = 0;&#10;&#10; @Override&#10; public boolean equals(Object o) {&#10; if (this == o) {&#10; return true;&#10; }&#10; if (o == null || getClass() != o.getClass()) {&#10; return false;&#10; }&#10; Accum accum = (Accum) o;&#10; return sum == accum.sum &amp;&amp;&#10; count == accum.count;&#10; }&#10;&#10; @Override&#10; public int hashCode() {&#10; return Objects.hash(sum, count);&#10; }&#10; }&#10;&#10; @Override&#10; public Accum createAccumulator() {&#10; return new Accum();&#10; }&#10;&#10; @Override&#10; public Accum addInput(Accum accumulator, Integer input) {&#10; accumulator.sum += input;&#10; accumulator.count++;&#10;&#10; return accumulator;&#10; }&#10;&#10; @Override&#10; public Accum mergeAccumulators(Iterable&lt;Accum&gt; accumulators) {&#10; Accum merged = createAccumulator();&#10;&#10; for (Accum accumulator : accumulators) {&#10; merged.sum += accumulator.sum;&#10; merged.count += accumulator.count;&#10; }&#10;&#10; return merged;&#10; }&#10;&#10; @Override&#10; public Double extractOutput(Accum accumulator) {&#10; return ((double) accumulator.sum) / accumulator.count;&#10; }" />
<option name="selected" value="false" />
<option name="status" value="Unchecked" />
<option name="studentAnswer" />
<option name="useLength" value="false" />
</AnswerPlaceholder>
</list>
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="src/org/apache/beam/learning/katas/coretransforms/combine/combinefn/Task.java" />
<option name="text" value="class Task {&#10; //put your task here&#10;}" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="true" />
</TaskFile>
</value>
</entry>
<entry key="test/org/apache/beam/learning/katas/coretransforms/combine/combinefn/TaskTest.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list />
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="test/org/apache/beam/learning/katas/coretransforms/combine/combinefn/TaskTest.java" />
<option name="text" value="public class Test {&#10; // put your test here&#10;}" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="false" />
</TaskFile>
</value>
</entry>
</map>
</option>
<option name="updateDate" value="1560936188000" />
</EduTask>
<EduTask>
<option name="customPresentableName" />
<option name="descriptionFormat" value="HTML" />
<option name="descriptionText" value="&lt;!--&#10; ~ Licensed to the Apache Software Foundation (ASF) under one&#10; ~ or more contributor license agreements. See the NOTICE file&#10; ~ distributed with this work for additional information&#10; ~ regarding copyright ownership. The ASF licenses this file&#10; ~ to you under the Apache License, Version 2.0 (the&#10; ~ &quot;License&quot;); you may not use this file except in compliance&#10; ~ with the License. You may obtain a copy of the License at&#10; ~&#10; ~ http://www.apache.org/licenses/LICENSE-2.0&#10; ~&#10; ~ Unless required by applicable law or agreed to in writing, software&#10; ~ distributed under the License is distributed on an &quot;AS IS&quot; BASIS,&#10; ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&#10; ~ See the License for the specific language governing permissions and&#10; ~ limitations under the License.&#10; --&gt;&#10;&#10;&lt;html&gt;&#10;&lt;h2&gt;Combine - BinaryCombineFn&lt;/h2&gt;&#10;&lt;p&gt;&#10; Combine is a Beam transform for combining collections of elements or values in your data.&#10; When you apply a Combine transform, you must provide the function that contains the logic for&#10; combining the elements or values. The combining function should be commutative and associative,&#10; as the function is not necessarily invoked exactly once on all values with a given key. Because&#10; the input data (including the value collection) may be distributed across multiple workers, the&#10; combining function might be called multiple times to perform partial combining on subsets of&#10; the value collection.&#10;&lt;/p&gt;&#10;&lt;p&gt;&#10; BinaryCombineFn is used for implementing combiners that are more easily expressed as binary&#10; operations.&#10;&lt;/p&gt;&#10;&lt;p&gt;&#10; &lt;b&gt;Kata:&lt;/b&gt; Implement the summation of BigInteger using&#10; &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/Combine.BinaryCombineFn.html&quot;&gt;&#10; Combine.BinaryCombineFn&lt;/a&gt;.&#10;&lt;/p&gt;&#10;&lt;br&gt;&#10;&lt;div class=&quot;hint&quot;&gt;&#10; Extend the&#10; &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/Combine.BinaryCombineFn.html&quot;&gt;&#10; Combine.BinaryCombineFn&lt;/a&gt; class that counts the sum of the number.&#10;&lt;/div&gt;&#10;&lt;div class=&quot;hint&quot;&gt;&#10; Refer to the Beam Programming Guide&#10; &lt;a href=&quot;https://beam.apache.org/documentation/programming-guide/#combine&quot;&gt;&#10; &quot;Combine&quot;&lt;/a&gt; section for more information.&#10;&lt;/div&gt;&#10;&lt;/html&gt;&#10;" />
<option name="feedbackLink">
<FeedbackLink>
<option name="link" />
<option name="type" value="STEPIK" />
</FeedbackLink>
</option>
<option name="id" value="713732" />
<option name="index" value="3" />
<option name="name" value="BinaryCombineFn" />
<option name="record" value="-1" />
<option name="status" value="Unchecked" />
<option name="stepikChangeStatus" value="Info and Content changed" />
<option name="files">
<map>
<entry key="src/org/apache/beam/learning/katas/coretransforms/combine/binarycombinefn/Task.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list>
<AnswerPlaceholder>
<option name="hints">
<list />
</option>
<option name="index" value="0" />
<option name="initialState" />
<option name="initializedFromDependency" value="false" />
<option name="length" value="6" />
<option name="offset" value="2125" />
<option name="placeholderDependency" />
<option name="placeholderText" value="TODO()" />
<option name="possibleAnswer" value="@Override&#10; public BigInteger apply(BigInteger left, BigInteger right) {&#10; return left.add(right);&#10; }" />
<option name="selected" value="false" />
<option name="status" value="Unchecked" />
<option name="studentAnswer" />
<option name="useLength" value="false" />
</AnswerPlaceholder>
</list>
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="src/org/apache/beam/learning/katas/coretransforms/combine/binarycombinefn/Task.java" />
<option name="text" value="class Task {&#10; //put your task here&#10;}" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="true" />
</TaskFile>
</value>
</entry>
<entry key="test/org/apache/beam/learning/katas/coretransforms/combine/binarycombinefn/TaskTest.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list />
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="test/org/apache/beam/learning/katas/coretransforms/combine/binarycombinefn/TaskTest.java" />
<option name="text" value="public class Test {&#10; // put your test here&#10;}" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="false" />
</TaskFile>
</value>
</entry>
</map>
</option>
<option name="updateDate" value="1560936191000" />
</EduTask>
<EduTask>
<option name="customPresentableName" />
<option name="descriptionFormat" value="HTML" />
<option name="descriptionText" value="&lt;!--&#10; ~ Licensed to the Apache Software Foundation (ASF) under one&#10; ~ or more contributor license agreements. See the NOTICE file&#10; ~ distributed with this work for additional information&#10; ~ regarding copyright ownership. The ASF licenses this file&#10; ~ to you under the Apache License, Version 2.0 (the&#10; ~ &quot;License&quot;); you may not use this file except in compliance&#10; ~ with the License. You may obtain a copy of the License at&#10; ~&#10; ~ http://www.apache.org/licenses/LICENSE-2.0&#10; ~&#10; ~ Unless required by applicable law or agreed to in writing, software&#10; ~ distributed under the License is distributed on an &quot;AS IS&quot; BASIS,&#10; ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&#10; ~ See the License for the specific language governing permissions and&#10; ~ limitations under the License.&#10; --&gt;&#10;&#10;&lt;html&gt;&#10;&lt;h2&gt;Combine - BinaryCombineFn Lambda&lt;/h2&gt;&#10;&lt;p&gt;&#10; BinaryCombineFn is used for implementing combiners that are more easily expressed as binary&#10; operations.&#10;&lt;/p&gt;&#10;&lt;p&gt;&#10; Since Beam v2.13.0, you can also use lambda or method reference in order to create the&#10; BinaryCombineFn.&#10;&lt;/p&gt;&#10;&lt;p&gt;&#10; &lt;b&gt;Kata:&lt;/b&gt; Implement the summation of BigInteger using lambda or method reference.&#10;&lt;/p&gt;&#10;&lt;br&gt;&#10;&lt;div class=&quot;hint&quot;&gt;&#10; Refer to&#10; &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/SerializableBiFunction.html&quot;&gt;&#10; SerializableBiFunction&lt;/a&gt;.&#10;&lt;/div&gt;&#10;&lt;div class=&quot;hint&quot;&gt;&#10; Refer to the Beam Programming Guide&#10; &lt;a href=&quot;https://beam.apache.org/documentation/programming-guide/#combine&quot;&gt;&#10; &quot;Combine&quot;&lt;/a&gt; section for more information.&#10;&lt;/div&gt;&#10;&lt;/html&gt;&#10;" />
<option name="feedbackLink">
<FeedbackLink>
<option name="link" />
<option name="type" value="STEPIK" />
</FeedbackLink>
</option>
<option name="id" value="750324" />
<option name="index" value="4" />
<option name="name" value="BinaryCombineFn Lambda" />
<option name="record" value="-1" />
<option name="status" value="Unchecked" />
<option name="stepikChangeStatus" value="Info and Content changed" />
<option name="files">
<map>
<entry key="src/org/apache/beam/learning/katas/coretransforms/combine/binarycombinefnlambda/Task.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list>
<AnswerPlaceholder>
<option name="hints">
<list />
</option>
<option name="index" value="0" />
<option name="initialState" />
<option name="initializedFromDependency" value="false" />
<option name="length" value="6" />
<option name="offset" value="1922" />
<option name="placeholderDependency" />
<option name="placeholderText" value="TODO()" />
<option name="possibleAnswer" value="input.apply(Combine.globally(BigInteger::add))" />
<option name="selected" value="false" />
<option name="status" value="Unchecked" />
<option name="studentAnswer" />
<option name="useLength" value="false" />
</AnswerPlaceholder>
</list>
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="src/org/apache/beam/learning/katas/coretransforms/combine/binarycombinefnlambda/Task.java" />
<option name="text" value="public class Task {&#10; //put your task here&#10;}" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="true" />
</TaskFile>
</value>
</entry>
<entry key="test/org/apache/beam/learning/katas/coretransforms/combine/binarycombinefnlambda/TaskTest.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list />
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="test/org/apache/beam/learning/katas/coretransforms/combine/binarycombinefnlambda/TaskTest.java" />
<option name="text" value="import org.junit.Assert;&#10;import org.junit.Test;&#10;&#10;public class Tests {&#10; @Test&#10; public void testSolution() {&#10; // put your test here&#10; Assert.fail(&quot;Tests not implemented for the task&quot;);&#10; }&#10;}" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="false" />
</TaskFile>
</value>
</entry>
</map>
</option>
<option name="updateDate" value="1560936195000" />
</EduTask>
<EduTask>
<option name="customPresentableName" />
<option name="descriptionFormat" value="HTML" />
<option name="descriptionText" value="&lt;!--&#10; ~ Licensed to the Apache Software Foundation (ASF) under one&#10; ~ or more contributor license agreements. See the NOTICE file&#10; ~ distributed with this work for additional information&#10; ~ regarding copyright ownership. The ASF licenses this file&#10; ~ to you under the Apache License, Version 2.0 (the&#10; ~ &quot;License&quot;); you may not use this file except in compliance&#10; ~ with the License. You may obtain a copy of the License at&#10; ~&#10; ~ http://www.apache.org/licenses/LICENSE-2.0&#10; ~&#10; ~ Unless required by applicable law or agreed to in writing, software&#10; ~ distributed under the License is distributed on an &quot;AS IS&quot; BASIS,&#10; ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&#10; ~ See the License for the specific language governing permissions and&#10; ~ limitations under the License.&#10; --&gt;&#10;&#10;&lt;html&gt;&#10;&lt;h2&gt;Combine - Combine PerKey&lt;/h2&gt;&#10;&lt;p&gt;&#10; After creating a keyed PCollection (for example, by using a GroupByKey transform), a common&#10; pattern is to combine the collection of values associated with each key into a single, merged&#10; value. This pattern of a GroupByKey followed by merging the collection of values is equivalent to&#10; Combine PerKey transform. The combine function you supply to Combine PerKey must be an associative&#10; reduction function or a subclass of CombineFn.&#10;&lt;/p&gt;&#10;&lt;p&gt;&#10; &lt;b&gt;Kata:&lt;/b&gt; Implement the sum of scores per player using&#10; &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/CombineFnBase.GlobalCombineFn.html&quot;&gt;&#10; Combine.perKey&lt;/a&gt;.&#10;&lt;/p&gt;&#10;&lt;br&gt;&#10;&lt;div class=&quot;hint&quot;&gt;&#10; Use &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/CombineFnBase.GlobalCombineFn.html&quot;&gt;&#10; Combine.perKey(GlobalCombineFn)&lt;/a&gt;.&#10;&lt;/div&gt;&#10;&lt;div class=&quot;hint&quot;&gt;&#10; Extend the&#10; &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/Combine.BinaryCombineFn.html&quot;&gt;&#10; Combine.BinaryCombineFn&lt;/a&gt; class that counts the sum of the number.&#10;&lt;/div&gt;&#10;&lt;div class=&quot;hint&quot;&gt;&#10; Refer to the Beam Programming Guide&#10; &lt;a href=&quot;https://beam.apache.org/documentation/programming-guide/#combining-values-in-a-keyed-pcollection&quot;&gt;&#10; &quot;Combining values in a keyed PCollection&quot;&lt;/a&gt; section for more information.&#10;&lt;/div&gt;&#10;&lt;/html&gt;&#10;" />
<option name="feedbackLink">
<FeedbackLink>
<option name="link" />
<option name="type" value="STEPIK" />
</FeedbackLink>
</option>
<option name="id" value="713733" />
<option name="index" value="5" />
<option name="name" value="Combine PerKey" />
<option name="record" value="-1" />
<option name="status" value="Unchecked" />
<option name="stepikChangeStatus" value="Info and Content changed" />
<option name="files">
<map>
<entry key="src/org/apache/beam/learning/katas/coretransforms/combine/combineperkey/Task.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list>
<AnswerPlaceholder>
<option name="hints">
<list />
</option>
<option name="index" value="0" />
<option name="initialState" />
<option name="initializedFromDependency" value="false" />
<option name="length" value="6" />
<option name="offset" value="2155" />
<option name="placeholderDependency" />
<option name="placeholderText" value="TODO()" />
<option name="possibleAnswer" value="input.apply(Combine.perKey(new SumIntBinaryCombineFn()))" />
<option name="selected" value="false" />
<option name="status" value="Unchecked" />
<option name="studentAnswer" />
<option name="useLength" value="false" />
</AnswerPlaceholder>
<AnswerPlaceholder>
<option name="hints">
<list />
</option>
<option name="index" value="1" />
<option name="initialState" />
<option name="initializedFromDependency" value="false" />
<option name="length" value="6" />
<option name="offset" value="2295" />
<option name="placeholderDependency" />
<option name="placeholderText" value="TODO()" />
<option name="possibleAnswer" value="@Override&#10; public Integer apply(Integer left, Integer right) {&#10; return left + right;&#10; }" />
<option name="selected" value="false" />
<option name="status" value="Unchecked" />
<option name="studentAnswer" />
<option name="useLength" value="false" />
</AnswerPlaceholder>
</list>
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="src/org/apache/beam/learning/katas/coretransforms/combine/combineperkey/Task.java" />
<option name="text" value="class Task {&#10; //put your task here&#10;}" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="true" />
</TaskFile>
</value>
</entry>
<entry key="test/org/apache/beam/learning/katas/coretransforms/combine/combineperkey/TaskTest.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list />
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="test/org/apache/beam/learning/katas/coretransforms/combine/combineperkey/TaskTest.java" />
<option name="text" value="public class Test {&#10; // put your test here&#10;}" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="false" />
</TaskFile>
</value>
</entry>
</map>
</option>
<option name="updateDate" value="1560936199000" />
</EduTask>
</list>
</option>
</Lesson>
<Lesson>
<option name="customPresentableName" />
<option name="id" value="229511" />
<option name="index" value="5" />
<option name="name" value="Flatten" />
<option name="stepikChangeStatus" value="Content changed" />
<option name="updateDate" value="1559325047000" />
<option name="unitId" value="-1" />
<option name="items">
<list>
<EduTask>
<option name="customPresentableName" />
<option name="descriptionFormat" value="HTML" />
<option name="descriptionText" value="&lt;!--&#10; ~ Licensed to the Apache Software Foundation (ASF) under one&#10; ~ or more contributor license agreements. See the NOTICE file&#10; ~ distributed with this work for additional information&#10; ~ regarding copyright ownership. The ASF licenses this file&#10; ~ to you under the Apache License, Version 2.0 (the&#10; ~ &quot;License&quot;); you may not use this file except in compliance&#10; ~ with the License. You may obtain a copy of the License at&#10; ~&#10; ~ http://www.apache.org/licenses/LICENSE-2.0&#10; ~&#10; ~ Unless required by applicable law or agreed to in writing, software&#10; ~ distributed under the License is distributed on an &quot;AS IS&quot; BASIS,&#10; ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&#10; ~ See the License for the specific language governing permissions and&#10; ~ limitations under the License.&#10; --&gt;&#10;&#10;&lt;html&gt;&#10;&lt;h2&gt;Flatten&lt;/h2&gt;&#10;&lt;p&gt;&#10; Flatten is a Beam transform for PCollection objects that store the same data type.&#10; Flatten merges multiple PCollection objects into a single logical PCollection.&#10;&lt;/p&gt;&#10;&lt;p&gt;&#10; &lt;b&gt;Kata:&lt;/b&gt; Implement a&#10; &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/Flatten.html&quot;&gt;&#10; Flatten&lt;/a&gt; transform that merges two PCollection of words into a single PCollection.&#10;&lt;/p&gt;&#10;&lt;br&gt;&#10;&lt;div class=&quot;hint&quot;&gt;&#10; Refer to&#10; &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/Flatten.html&quot;&gt;&#10; Flatten&lt;/a&gt; to solve this problem.&#10;&lt;/div&gt;&#10;&lt;div class=&quot;hint&quot;&gt;&#10; Refer to the Beam Programming Guide&#10; &lt;a href=&quot;https://beam.apache.org/documentation/programming-guide/#flatten&quot;&gt;&#10; &quot;Flatten&quot;&lt;/a&gt; section for more information.&#10;&lt;/div&gt;&#10;&lt;/html&gt;&#10;" />
<option name="feedbackLink">
<FeedbackLink>
<option name="link" />
<option name="type" value="STEPIK" />
</FeedbackLink>
</option>
<option name="id" value="713734" />
<option name="index" value="1" />
<option name="name" value="Flatten" />
<option name="record" value="-1" />
<option name="status" value="Unchecked" />
<option name="stepikChangeStatus" value="Info and Content changed" />
<option name="files">
<map>
<entry key="src/org/apache/beam/learning/katas/coretransforms/flatten/Task.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list>
<AnswerPlaceholder>
<option name="hints">
<list />
</option>
<option name="index" value="0" />
<option name="initialState" />
<option name="initializedFromDependency" value="false" />
<option name="length" value="6" />
<option name="offset" value="2040" />
<option name="placeholderDependency" />
<option name="placeholderText" value="TODO()" />
<option name="possibleAnswer" value="PCollectionList.of(words1).and(words2)&#10; .apply(Flatten.pCollections())" />
<option name="selected" value="false" />
<option name="status" value="Unchecked" />
<option name="studentAnswer" />
<option name="useLength" value="false" />
</AnswerPlaceholder>
</list>
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="src/org/apache/beam/learning/katas/coretransforms/flatten/Task.java" />
<option name="text" value="class Task {&#10; //put your task here&#10;}" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="true" />
</TaskFile>
</value>
</entry>
<entry key="test/org/apache/beam/learning/katas/coretransforms/flatten/TaskTest.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list />
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="test/org/apache/beam/learning/katas/coretransforms/flatten/TaskTest.java" />
<option name="text" value="public class Test {&#10; // put your test here&#10;}" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="false" />
</TaskFile>
</value>
</entry>
</map>
</option>
<option name="updateDate" value="1560936202000" />
</EduTask>
</list>
</option>
</Lesson>
<Lesson>
<option name="customPresentableName" />
<option name="id" value="229512" />
<option name="index" value="6" />
<option name="name" value="Partition" />
<option name="stepikChangeStatus" value="Content changed" />
<option name="updateDate" value="1559325050000" />
<option name="unitId" value="-1" />
<option name="items">
<list>
<EduTask>
<option name="customPresentableName" />
<option name="descriptionFormat" value="HTML" />
<option name="descriptionText" value="&lt;!--&#10; ~ Licensed to the Apache Software Foundation (ASF) under one&#10; ~ or more contributor license agreements. See the NOTICE file&#10; ~ distributed with this work for additional information&#10; ~ regarding copyright ownership. The ASF licenses this file&#10; ~ to you under the Apache License, Version 2.0 (the&#10; ~ &quot;License&quot;); you may not use this file except in compliance&#10; ~ with the License. You may obtain a copy of the License at&#10; ~&#10; ~ http://www.apache.org/licenses/LICENSE-2.0&#10; ~&#10; ~ Unless required by applicable law or agreed to in writing, software&#10; ~ distributed under the License is distributed on an &quot;AS IS&quot; BASIS,&#10; ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&#10; ~ See the License for the specific language governing permissions and&#10; ~ limitations under the License.&#10; --&gt;&#10;&#10;&lt;html&gt;&#10;&lt;h2&gt;Partition&lt;/h2&gt;&#10;&lt;p&gt;&#10; Partition is a Beam transform for PCollection objects that store the same data type.&#10; Partition splits a single PCollection into a fixed number of smaller collections.&#10;&lt;/p&gt;&#10;&lt;p&gt;&#10; Partition divides the elements of a PCollection according to a partitioning function&#10; that you provide. The partitioning function contains the logic that determines how to split up&#10; the elements of the input PCollection into each resulting partition PCollection.&#10;&lt;/p&gt;&#10;&lt;p&gt;&#10; &lt;b&gt;Kata:&lt;/b&gt; Implement a&#10; &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/Partition.html&quot;&gt;&#10; Partition&lt;/a&gt; transform that splits a PCollection of numbers into two PCollections.&#10; The first PCollection contains numbers greater than 100, and the second PCollection contains&#10; the remaining numbers.&#10;&lt;/p&gt;&#10;&lt;br&gt;&#10;&lt;div class=&quot;hint&quot;&gt;&#10; Refer to&#10; &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/Partition.html&quot;&gt;&#10; Partition&lt;/a&gt; to solve this problem.&#10;&lt;/div&gt;&#10;&lt;div class=&quot;hint&quot;&gt;&#10; Refer to the Beam Programming Guide&#10; &lt;a href=&quot;https://beam.apache.org/documentation/programming-guide/#partition&quot;&gt;&#10; &quot;Partition&quot;&lt;/a&gt; section for more information.&#10;&lt;/div&gt;&#10;&lt;/html&gt;&#10;" />
<option name="feedbackLink">
<FeedbackLink>
<option name="link" />
<option name="type" value="STEPIK" />
</FeedbackLink>
</option>
<option name="id" value="713735" />
<option name="index" value="1" />
<option name="name" value="Partition" />
<option name="record" value="-1" />
<option name="status" value="Unchecked" />
<option name="stepikChangeStatus" value="Info and Content changed" />
<option name="files">
<map>
<entry key="src/org/apache/beam/learning/katas/coretransforms/partition/Task.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list>
<AnswerPlaceholder>
<option name="hints">
<list />
</option>
<option name="index" value="0" />
<option name="initialState" />
<option name="initializedFromDependency" value="false" />
<option name="length" value="6" />
<option name="offset" value="1966" />
<option name="placeholderDependency" />
<option name="placeholderText" value="TODO()" />
<option name="possibleAnswer" value="input&#10; .apply(Partition.of(2,&#10; (PartitionFn&lt;Integer&gt;) (number, numPartitions) -&gt; {&#10; if (number &gt; 100) {&#10; return 0;&#10; } else {&#10; return 1;&#10; }&#10; }))" />
<option name="selected" value="false" />
<option name="status" value="Unchecked" />
<option name="studentAnswer" />
<option name="useLength" value="false" />
</AnswerPlaceholder>
</list>
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="src/org/apache/beam/learning/katas/coretransforms/partition/Task.java" />
<option name="text" value="class Task {&#10; //put your task here&#10;}" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="true" />
</TaskFile>
</value>
</entry>
<entry key="test/org/apache/beam/learning/katas/coretransforms/partition/TaskTest.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list />
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="test/org/apache/beam/learning/katas/coretransforms/partition/TaskTest.java" />
<option name="text" value="public class Test {&#10; // put your test here&#10;}" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="false" />
</TaskFile>
</value>
</entry>
</map>
</option>
<option name="updateDate" value="1560936206000" />
</EduTask>
</list>
</option>
</Lesson>
<Lesson>
<option name="customPresentableName" />
<option name="id" value="237989" />
<option name="index" value="7" />
<option name="name" value="Side Input" />
<option name="stepikChangeStatus" value="Content changed" />
<option name="updateDate" value="1560791406453" />
<option name="unitId" value="-1" />
<option name="items">
<list>
<EduTask>
<option name="customPresentableName" />
<option name="descriptionFormat" value="HTML" />
<option name="descriptionText" value="&lt;!--&#10; ~ Licensed to the Apache Software Foundation (ASF) under one&#10; ~ or more contributor license agreements. See the NOTICE file&#10; ~ distributed with this work for additional information&#10; ~ regarding copyright ownership. The ASF licenses this file&#10; ~ to you under the Apache License, Version 2.0 (the&#10; ~ &quot;License&quot;); you may not use this file except in compliance&#10; ~ with the License. You may obtain a copy of the License at&#10; ~&#10; ~ http://www.apache.org/licenses/LICENSE-2.0&#10; ~&#10; ~ Unless required by applicable law or agreed to in writing, software&#10; ~ distributed under the License is distributed on an &quot;AS IS&quot; BASIS,&#10; ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&#10; ~ See the License for the specific language governing permissions and&#10; ~ limitations under the License.&#10; --&gt;&#10;&#10;&lt;html&gt;&#10;&lt;h2&gt;Side Input&lt;/h2&gt;&#10;&lt;p&gt;&#10; In addition to the main input PCollection, you can provide additional inputs to a ParDo transform&#10; in the form of side inputs. A side input is an additional input that your DoFn can access each&#10; time it processes an element in the input PCollection. When you specify a side input, you create&#10; a view of some other data that can be read from within the ParDo transform’s DoFn while&#10; processing each element.&#10;&lt;/p&gt;&#10;&lt;p&gt;&#10; Side inputs are useful if your ParDo needs to inject additional data when processing each element&#10; in the input PCollection, but the additional data needs to be determined at runtime (and not&#10; hard-coded). Such values might be determined by the input data, or depend on a different branch&#10; of your pipeline.&#10;&lt;/p&gt;&#10;&lt;p&gt;&#10; &lt;b&gt;Kata:&lt;/b&gt; Please enrich each Person with the country based on the city he/she lives in.&#10;&lt;/p&gt;&#10;&lt;br&gt;&#10;&lt;div class=&quot;hint&quot;&gt;&#10; Use &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/View.html&quot;&gt;&#10; View&lt;/a&gt; to create PCollectionView of citiesToCountries.&#10;&lt;/div&gt;&#10;&lt;div class=&quot;hint&quot;&gt;&#10; Use &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/ParDo.html&quot;&gt;&#10; ParDo&lt;/a&gt; with &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/DoFn.html&quot;&gt;&#10; DoFn&lt;/a&gt; that accepts&#10; &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/ParDo.SingleOutput.html#withSideInputs-org.apache.beam.sdk.values.PCollectionView...-&quot;&gt;&#10; side input&lt;/a&gt;.&#10;&lt;/div&gt;&#10;&lt;div class=&quot;hint&quot;&gt;&#10; Refer to the Beam Programming Guide&#10; &lt;a href=&quot;https://beam.apache.org/documentation/programming-guide/#side-inputs&quot;&gt;&quot;Side inputs&quot;&lt;/a&gt;&#10; section for more information.&#10;&lt;/div&gt;&#10;&lt;/html&gt;&#10;" />
<option name="feedbackLink">
<FeedbackLink>
<option name="link" />
<option name="type" value="STEPIK" />
</FeedbackLink>
</option>
<option name="id" value="754085" />
<option name="index" value="1" />
<option name="name" value="Side Input" />
<option name="record" value="-1" />
<option name="status" value="Unchecked" />
<option name="stepikChangeStatus" value="Info and Content changed" />
<option name="files">
<map>
<entry key="src/org/apache/beam/learning/katas/coretransforms/sideinput/Task.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list>
<AnswerPlaceholder>
<option name="hints">
<list />
</option>
<option name="index" value="0" />
<option name="initialState" />
<option name="initializedFromDependency" value="false" />
<option name="length" value="6" />
<option name="offset" value="2716" />
<option name="placeholderDependency" />
<option name="placeholderText" value="TODO()" />
<option name="possibleAnswer" value="citiesToCountries.apply(View.asMap())" />
<option name="selected" value="false" />
<option name="status" value="Unchecked" />
<option name="studentAnswer" />
<option name="useLength" value="false" />
</AnswerPlaceholder>
<AnswerPlaceholder>
<option name="hints">
<list />
</option>
<option name="index" value="1" />
<option name="initialState" />
<option name="initializedFromDependency" value="false" />
<option name="length" value="6" />
<option name="offset" value="2914" />
<option name="placeholderDependency" />
<option name="placeholderText" value="TODO()" />
<option name="possibleAnswer" value="persons.apply(ParDo.of(new DoFn&lt;Person, Person&gt;() {&#10;&#10; @ProcessElement&#10; public void processElement(@Element Person person, OutputReceiver&lt;Person&gt; out,&#10; ProcessContext context) {&#10; Map&lt;String, String&gt; citiesToCountries = context.sideInput(citiesToCountriesView);&#10; String city = person.getCity();&#10; String country = citiesToCountries.get(city);&#10;&#10; out.output(new Person(person.getName(), city, country));&#10; }&#10;&#10; }).withSideInputs(citiesToCountriesView))" />
<option name="selected" value="false" />
<option name="status" value="Unchecked" />
<option name="studentAnswer" />
<option name="useLength" value="false" />
</AnswerPlaceholder>
</list>
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="src/org/apache/beam/learning/katas/coretransforms/sideinput/Task.java" />
<option name="text" value="public class Task {&#10; //put your task here&#10;}" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="true" />
</TaskFile>
</value>
</entry>
<entry key="src/org/apache/beam/learning/katas/coretransforms/sideinput/Person.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list />
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="src/org/apache/beam/learning/katas/coretransforms/sideinput/Person.java" />
<option name="text" value="" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="true" />
</TaskFile>
</value>
</entry>
<entry key="test/org/apache/beam/learning/katas/coretransforms/sideinput/TaskTest.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list />
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="test/org/apache/beam/learning/katas/coretransforms/sideinput/TaskTest.java" />
<option name="text" value="import org.junit.Assert;&#10;import org.junit.Test;&#10;&#10;public class Tests {&#10; @Test&#10; public void testSolution() {&#10; // put your test here&#10; Assert.fail(&quot;Tests not implemented for the task&quot;);&#10; }&#10;}" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="false" />
</TaskFile>
</value>
</entry>
</map>
</option>
<option name="updateDate" value="1560936210000" />
</EduTask>
</list>
</option>
</Lesson>
<Lesson>
<option name="customPresentableName" />
<option name="id" value="237990" />
<option name="index" value="8" />
<option name="name" value="Side Output" />
<option name="stepikChangeStatus" value="Content changed" />
<option name="updateDate" value="1560791445676" />
<option name="unitId" value="-1" />
<option name="items">
<list>
<EduTask>
<option name="customPresentableName" />
<option name="descriptionFormat" value="HTML" />
<option name="descriptionText" value="&lt;!--&#10; ~ Licensed to the Apache Software Foundation (ASF) under one&#10; ~ or more contributor license agreements. See the NOTICE file&#10; ~ distributed with this work for additional information&#10; ~ regarding copyright ownership. The ASF licenses this file&#10; ~ to you under the Apache License, Version 2.0 (the&#10; ~ &quot;License&quot;); you may not use this file except in compliance&#10; ~ with the License. You may obtain a copy of the License at&#10; ~&#10; ~ http://www.apache.org/licenses/LICENSE-2.0&#10; ~&#10; ~ Unless required by applicable law or agreed to in writing, software&#10; ~ distributed under the License is distributed on an &quot;AS IS&quot; BASIS,&#10; ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&#10; ~ See the License for the specific language governing permissions and&#10; ~ limitations under the License.&#10; --&gt;&#10;&#10;&lt;html&gt;&#10;&lt;h2&gt;Side Output&lt;/h2&gt;&#10;&lt;p&gt;&#10; While ParDo always produces a main output PCollection (as the return value from apply), you can&#10; also have your ParDo produce any number of additional output PCollections. If you choose to have&#10; multiple outputs, your ParDo returns all of the output PCollections (including the main output)&#10; bundled together.&#10;&lt;/p&gt;&#10;&lt;p&gt;&#10; &lt;b&gt;Kata:&lt;/b&gt; Implement additional output to your ParDo for numbers bigger than 100.&#10;&lt;/p&gt;&#10;&lt;br&gt;&#10;&lt;div class=&quot;hint&quot;&gt;&#10; Use &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/DoFn.MultiOutputReceiver.html&quot;&gt;&#10; MultiOutputReceiver&lt;/a&gt; and&#10; &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/ParDo.SingleOutput.html#withOutputTags-org.apache.beam.sdk.values.TupleTag-org.apache.beam.sdk.values.TupleTagList-&quot;&gt;&#10; .withOutputTags&lt;/a&gt; to output multiple tagged-outputs in a&#10; &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/ParDo.html&quot;&gt;&#10; ParDo.&lt;/a&gt;&#10;&lt;/div&gt;&#10;&lt;div class=&quot;hint&quot;&gt;&#10; Refer to the Beam Programming Guide&#10; &lt;a href=&quot;https://beam.apache.org/documentation/programming-guide/#additional-outputs&quot;&gt;&#10; &quot;Additional outputs&quot;&lt;/a&gt; section for more information.&#10;&lt;/div&gt;&#10;&lt;/html&gt;&#10;" />
<option name="feedbackLink">
<FeedbackLink>
<option name="link" />
<option name="type" value="STEPIK" />
</FeedbackLink>
</option>
<option name="id" value="754087" />
<option name="index" value="1" />
<option name="name" value="Side Output" />
<option name="record" value="-1" />
<option name="status" value="Unchecked" />
<option name="stepikChangeStatus" value="Info and Content changed" />
<option name="files">
<map>
<entry key="src/org/apache/beam/learning/katas/coretransforms/sideoutput/Task.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list>
<AnswerPlaceholder>
<option name="hints">
<list />
</option>
<option name="index" value="0" />
<option name="initialState" />
<option name="initializedFromDependency" value="false" />
<option name="length" value="6" />
<option name="offset" value="2253" />
<option name="placeholderDependency" />
<option name="placeholderText" value="TODO()" />
<option name="possibleAnswer" value="numbers.apply(ParDo.of(new DoFn&lt;Integer, Integer&gt;() {&#10;&#10; @ProcessElement&#10; public void processElement(@Element Integer number, MultiOutputReceiver out) {&#10; if (number &lt;= 100) {&#10; out.get(numBelow100Tag).output(number);&#10; } else {&#10; out.get(numAbove100Tag).output(number);&#10; }&#10; }&#10;&#10; }).withOutputTags(numBelow100Tag, TupleTagList.of(numAbove100Tag)))" />
<option name="selected" value="false" />
<option name="status" value="Unchecked" />
<option name="studentAnswer" />
<option name="useLength" value="false" />
</AnswerPlaceholder>
</list>
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="src/org/apache/beam/learning/katas/coretransforms/sideoutput/Task.java" />
<option name="text" value="public class Task {&#10; //put your task here&#10;}" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="true" />
</TaskFile>
</value>
</entry>
<entry key="test/org/apache/beam/learning/katas/coretransforms/sideoutput/TaskTest.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list />
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="test/org/apache/beam/learning/katas/coretransforms/sideoutput/TaskTest.java" />
<option name="text" value="import org.junit.Assert;&#10;import org.junit.Test;&#10;&#10;public class Tests {&#10; @Test&#10; public void testSolution() {&#10; // put your test here&#10; Assert.fail(&quot;Tests not implemented for the task&quot;);&#10; }&#10;}" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="false" />
</TaskFile>
</value>
</entry>
</map>
</option>
<option name="updateDate" value="1560936215000" />
</EduTask>
</list>
</option>
</Lesson>
<Lesson>
<option name="customPresentableName" />
<option name="id" value="237991" />
<option name="index" value="9" />
<option name="name" value="Branching" />
<option name="stepikChangeStatus" value="Content changed" />
<option name="updateDate" value="1560791458069" />
<option name="unitId" value="-1" />
<option name="items">
<list>
<EduTask>
<option name="customPresentableName" />
<option name="descriptionFormat" value="HTML" />
<option name="descriptionText" value="&lt;!--&#10; ~ Licensed to the Apache Software Foundation (ASF) under one&#10; ~ or more contributor license agreements. See the NOTICE file&#10; ~ distributed with this work for additional information&#10; ~ regarding copyright ownership. The ASF licenses this file&#10; ~ to you under the Apache License, Version 2.0 (the&#10; ~ &quot;License&quot;); you may not use this file except in compliance&#10; ~ with the License. You may obtain a copy of the License at&#10; ~&#10; ~ http://www.apache.org/licenses/LICENSE-2.0&#10; ~&#10; ~ Unless required by applicable law or agreed to in writing, software&#10; ~ distributed under the License is distributed on an &quot;AS IS&quot; BASIS,&#10; ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&#10; ~ See the License for the specific language governing permissions and&#10; ~ limitations under the License.&#10; --&gt;&#10;&#10;&lt;html&gt;&#10;&lt;h2&gt;Branching&lt;/h2&gt;&#10;&lt;p&gt;&#10; You can use the same PCollection as input for multiple transforms without consuming the input&#10; or altering it.&#10;&lt;/p&gt;&#10;&lt;p&gt;&#10; &lt;b&gt;Kata:&lt;/b&gt; Branch out the numbers to two different transforms: one transform is multiplying&#10; each number by 5 and the other transform is multiplying each number by 10.&#10;&lt;/p&gt;&#10;&lt;br&gt;&#10;&lt;div class=&quot;hint&quot;&gt;&#10; Refer to the Beam Design Your Pipeline Guide&#10; &lt;a href=&quot;https://beam.apache.org/documentation/pipelines/design-your-pipeline/#multiple-transforms-process-the-same-pcollection&quot;&gt;&#10; &quot;Multiple transforms process the same PCollection&quot;&lt;/a&gt; section for more information.&#10;&lt;/div&gt;&#10;&lt;/html&gt;&#10;" />
<option name="feedbackLink">
<FeedbackLink>
<option name="link" />
<option name="type" value="STEPIK" />
</FeedbackLink>
</option>
<option name="id" value="754088" />
<option name="index" value="1" />
<option name="name" value="Branching" />
<option name="record" value="-1" />
<option name="status" value="Unchecked" />
<option name="stepikChangeStatus" value="Info and Content changed" />
<option name="files">
<map>
<entry key="src/org/apache/beam/learning/katas/coretransforms/branching/Task.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list>
<AnswerPlaceholder>
<option name="hints">
<list />
</option>
<option name="index" value="0" />
<option name="initialState" />
<option name="initializedFromDependency" value="false" />
<option name="length" value="6" />
<option name="offset" value="1994" />
<option name="placeholderDependency" />
<option name="placeholderText" value="TODO()" />
<option name="possibleAnswer" value="input.apply(&quot;Multiply by 5&quot;, MapElements.into(integers()).via(num -&gt; num * 5))" />
<option name="selected" value="false" />
<option name="status" value="Unchecked" />
<option name="studentAnswer" />
<option name="useLength" value="false" />
</AnswerPlaceholder>
<AnswerPlaceholder>
<option name="hints">
<list />
</option>
<option name="index" value="1" />
<option name="initialState" />
<option name="initializedFromDependency" value="false" />
<option name="length" value="6" />
<option name="offset" value="2175" />
<option name="placeholderDependency" />
<option name="placeholderText" value="TODO()" />
<option name="possibleAnswer" value="input.apply(&quot;Multiply by 10&quot;, MapElements.into(integers()).via(num -&gt; num * 10))" />
<option name="selected" value="false" />
<option name="status" value="Unchecked" />
<option name="studentAnswer" />
<option name="useLength" value="false" />
</AnswerPlaceholder>
</list>
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="src/org/apache/beam/learning/katas/coretransforms/branching/Task.java" />
<option name="text" value="public class Task {&#10; //put your task here&#10;}" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="true" />
</TaskFile>
</value>
</entry>
<entry key="test/org/apache/beam/learning/katas/coretransforms/branching/TaskTest.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list />
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="test/org/apache/beam/learning/katas/coretransforms/branching/TaskTest.java" />
<option name="text" value="import org.junit.Assert;&#10;import org.junit.Test;&#10;&#10;public class Tests {&#10; @Test&#10; public void testSolution() {&#10; // put your test here&#10; Assert.fail(&quot;Tests not implemented for the task&quot;);&#10; }&#10;}" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="false" />
</TaskFile>
</value>
</entry>
</map>
</option>
<option name="updateDate" value="1560936219000" />
</EduTask>
</list>
</option>
</Lesson>
<Lesson>
<option name="customPresentableName" />
<option name="id" value="237192" />
<option name="index" value="10" />
<option name="name" value="Composite Transform" />
<option name="stepikChangeStatus" value="Content changed" />
<option name="updateDate" value="1560431460000" />
<option name="unitId" value="-1" />
<option name="items">
<list>
<EduTask>
<option name="customPresentableName" />
<option name="descriptionFormat" value="HTML" />
<option name="descriptionText" value="&lt;!--&#10; ~ Licensed to the Apache Software Foundation (ASF) under one&#10; ~ or more contributor license agreements. See the NOTICE file&#10; ~ distributed with this work for additional information&#10; ~ regarding copyright ownership. The ASF licenses this file&#10; ~ to you under the Apache License, Version 2.0 (the&#10; ~ &quot;License&quot;); you may not use this file except in compliance&#10; ~ with the License. You may obtain a copy of the License at&#10; ~&#10; ~ http://www.apache.org/licenses/LICENSE-2.0&#10; ~&#10; ~ Unless required by applicable law or agreed to in writing, software&#10; ~ distributed under the License is distributed on an &quot;AS IS&quot; BASIS,&#10; ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&#10; ~ See the License for the specific language governing permissions and&#10; ~ limitations under the License.&#10; --&gt;&#10;&#10;&lt;html&gt;&#10;&lt;h2&gt;Composite Transform&lt;/h2&gt;&#10;&lt;p&gt;&#10; Transforms can have a nested structure, where a complex transform performs multiple simpler&#10; transforms (such as more than one ParDo, Combine, GroupByKey, or even other composite transforms).&#10; These transforms are called composite transforms. Nesting multiple transforms inside a single&#10; composite transform can make your code more modular and easier to understand.&#10;&lt;/p&gt;&#10;&lt;p&gt;&#10; To create your own composite transform, create a subclass of the PTransform class and override&#10; the expand method to specify the actual processing logic. You can then use this transform just as&#10; you would a built-in transform from the Beam SDK. For the PTransform class type parameters, you&#10; pass the PCollection types that your transform takes as input, and produces as output. Within&#10; your PTransform subclass, you’ll need to override the expand method. The expand method is where&#10; you add the processing logic for the PTransform. Your override of expand must accept the&#10; appropriate type of input PCollection as a parameter, and specify the output PCollection as the&#10; return value.&#10;&lt;/p&gt;&#10;&lt;p&gt;&#10; &lt;b&gt;Kata:&lt;/b&gt; Please implement a composite transform &quot;ExtractAndMultiplyNumbers&quot; that extracts&#10; numbers from comma separated line and then multiplies each number by 10.&#10;&lt;/p&gt;&#10;&lt;br&gt;&#10;&lt;div class=&quot;hint&quot;&gt;&#10; Refer to &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/PTransform.html&quot;&gt;&#10; PTransform&lt;/a&gt;.&#10;&lt;/div&gt;&#10;&lt;div class=&quot;hint&quot;&gt;&#10; Refer to the Beam Programming Guide&#10; &lt;a href=&quot;https://beam.apache.org/documentation/programming-guide/#composite-transforms&quot;&gt;&#10; &quot;Composite transforms&quot;&lt;/a&gt; section for more information.&#10;&lt;/div&gt;&#10;&lt;/html&gt;&#10;" />
<option name="feedbackLink">
<FeedbackLink>
<option name="link" />
<option name="type" value="STEPIK" />
</FeedbackLink>
</option>
<option name="id" value="750323" />
<option name="index" value="1" />
<option name="name" value="Composite Transform" />
<option name="record" value="-1" />
<option name="status" value="Unchecked" />
<option name="stepikChangeStatus" value="Info and Content changed" />
<option name="files">
<map>
<entry key="src/org/apache/beam/learning/katas/coretransforms/composite/Task.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list>
<AnswerPlaceholder>
<option name="hints">
<list />
</option>
<option name="index" value="0" />
<option name="initialState" />
<option name="initializedFromDependency" value="false" />
<option name="length" value="6" />
<option name="offset" value="1929" />
<option name="placeholderDependency" />
<option name="placeholderText" value="TODO()" />
<option name="possibleAnswer" value="@Override&#10; public PCollection&lt;Integer&gt; expand(PCollection&lt;String&gt; input) {&#10; return input&#10; .apply(ParDo.of(new DoFn&lt;String, Integer&gt;() {&#10;&#10; @ProcessElement&#10; public void processElement(@Element String numbers, OutputReceiver&lt;Integer&gt; out) {&#10; Arrays.stream(numbers.split(&quot;,&quot;))&#10; .forEach(numStr -&gt; out.output(Integer.parseInt(numStr)));&#10; }&#10;&#10; }))&#10;&#10; .apply(MapElements.into(integers()).via(number -&gt; number * 10));&#10; }" />
<option name="selected" value="false" />
<option name="status" value="Unchecked" />
<option name="studentAnswer" />
<option name="useLength" value="false" />
</AnswerPlaceholder>
</list>
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="src/org/apache/beam/learning/katas/coretransforms/composite/Task.java" />
<option name="text" value="public class Task {&#10; //put your task here&#10;}" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="true" />
</TaskFile>
</value>
</entry>
<entry key="test/org/apache/beam/learning/katas/coretransforms/composite/TaskTest.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list />
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="test/org/apache/beam/learning/katas/coretransforms/composite/TaskTest.java" />
<option name="text" value="import org.junit.Assert;&#10;import org.junit.Test;&#10;&#10;public class Tests {&#10; @Test&#10; public void testSolution() {&#10; // put your test here&#10; Assert.fail(&quot;Tests not implemented for the task&quot;);&#10; }&#10;}" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="false" />
</TaskFile>
</value>
</entry>
</map>
</option>
<option name="updateDate" value="1560791618000" />
</EduTask>
</list>
</option>
</Lesson>
<Lesson>
<option name="customPresentableName" />
<option name="id" value="237765" />
<option name="index" value="11" />
<option name="name" value="DoFn Additional Parameters" />
<option name="stepikChangeStatus" value="Content changed" />
<option name="updateDate" value="0" />
<option name="unitId" value="-1" />
<option name="items">
<list>
<EduTask>
<option name="customPresentableName" />
<option name="descriptionFormat" value="HTML" />
<option name="descriptionText" value="&lt;!--&#10; ~ Licensed to the Apache Software Foundation (ASF) under one&#10; ~ or more contributor license agreements. See the NOTICE file&#10; ~ distributed with this work for additional information&#10; ~ regarding copyright ownership. The ASF licenses this file&#10; ~ to you under the Apache License, Version 2.0 (the&#10; ~ &quot;License&quot;); you may not use this file except in compliance&#10; ~ with the License. You may obtain a copy of the License at&#10; ~&#10; ~ http://www.apache.org/licenses/LICENSE-2.0&#10; ~&#10; ~ Unless required by applicable law or agreed to in writing, software&#10; ~ distributed under the License is distributed on an &quot;AS IS&quot; BASIS,&#10; ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&#10; ~ See the License for the specific language governing permissions and&#10; ~ limitations under the License.&#10; --&gt;&#10;&#10;&lt;html&gt;&#10;&lt;h2&gt;DoFn Additional Parameters&lt;/h2&gt;&#10;&lt;p&gt;&#10; In addition to the element and the OutputReceiver, Beam will populate other parameters to your&#10; DoFn’s @ProcessElement method. Any combination of these parameters can be added to your process&#10; method in any order.&#10;&lt;/p&gt;&#10;&lt;div&gt;&#10; &lt;ul&gt;&#10; &lt;li&gt;&#10; &lt;b&gt;Timestamp&lt;/b&gt;: To access the timestamp of an input element, add a parameter annotated with&#10; @Timestamp of type Instant&#10; &lt;/li&gt;&#10; &lt;li&gt;&#10; &lt;b&gt;Window&lt;/b&gt;: To access the window an input element falls into, add a parameter of the type of the&#10; window used for the input PCollection.&#10; &lt;/li&gt;&#10; &lt;li&gt;&#10; &lt;b&gt;PaneInfo&lt;/b&gt;: When triggers are used, Beam provides a PaneInfo object that contains information&#10; about the current firing. Using PaneInfo you can determine whether this is an early or a&#10; late firing, and how many times this window has already fired for this key.&#10; &lt;/li&gt;&#10; &lt;li&gt;&#10; &lt;b&gt;PipelineOptions&lt;/b&gt;: The PipelineOptions for the current pipeline can always be accessed in a&#10; process method by adding it as a parameter.&#10; &lt;/li&gt;&#10; &lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;p&gt;&#10; Refer to the Beam Programming Guide&#10; &lt;a href=&quot;https://beam.apache.org/documentation/programming-guide/#other-dofn-parameters&quot;&gt;&#10; &quot;Accessing additional parameters in your DoFn&quot;&lt;/a&gt; section for more information.&#10;&lt;/p&gt;&#10;&lt;/html&gt;&#10;" />
<option name="feedbackLink">
<FeedbackLink>
<option name="link" />
<option name="type" value="STEPIK" />
</FeedbackLink>
</option>
<option name="id" value="753154" />
<option name="index" value="1" />
<option name="name" value="DoFn Additional Parameters" />
<option name="record" value="-1" />
<option name="status" value="Unchecked" />
<option name="stepikChangeStatus" value="Up to date" />
<option name="files">
<map>
<entry key="src/org/apache/beam/learning/katas/coretransforms/dofnadditionalparams/Task.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list />
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="src/org/apache/beam/learning/katas/coretransforms/dofnadditionalparams/Task.java" />
<option name="text" value="public class Task {&#10; //put your task here&#10;}" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="true" />
</TaskFile>
</value>
</entry>
<entry key="test/org/apache/beam/learning/katas/coretransforms/dofnadditionalparams/TaskTest.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list />
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="test/org/apache/beam/learning/katas/coretransforms/dofnadditionalparams/TaskTest.java" />
<option name="text" value="" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="false" />
</TaskFile>
</value>
</entry>
</map>
</option>
<option name="updateDate" value="1560699463688" />
</EduTask>
</list>
</option>
</Lesson>
</list>
</option>
</Section>
<Section>
<option name="courseId" value="54530" />
<option name="customPresentableName" />
<option name="id" value="85641" />
<option name="index" value="3" />
<option name="name" value="Common Transforms" />
<option name="position" value="3" />
<option name="stepikChangeStatus" value="Up to date" />
<option name="updateDate" value="1559325072000" />
<option name="items">
<list>
<Lesson>
<option name="customPresentableName" />
<option name="id" value="229513" />
<option name="index" value="1" />
<option name="name" value="Filter" />
<option name="stepikChangeStatus" value="Content changed" />
<option name="updateDate" value="1559325056000" />
<option name="unitId" value="202038" />
<option name="items">
<list>
<EduTask>
<option name="customPresentableName" />
<option name="descriptionFormat" value="HTML" />
<option name="descriptionText" value="&lt;!--&#10; ~ Licensed to the Apache Software Foundation (ASF) under one&#10; ~ or more contributor license agreements. See the NOTICE file&#10; ~ distributed with this work for additional information&#10; ~ regarding copyright ownership. The ASF licenses this file&#10; ~ to you under the Apache License, Version 2.0 (the&#10; ~ &quot;License&quot;); you may not use this file except in compliance&#10; ~ with the License. You may obtain a copy of the License at&#10; ~&#10; ~ http://www.apache.org/licenses/LICENSE-2.0&#10; ~&#10; ~ Unless required by applicable law or agreed to in writing, software&#10; ~ distributed under the License is distributed on an &quot;AS IS&quot; BASIS,&#10; ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&#10; ~ See the License for the specific language governing permissions and&#10; ~ limitations under the License.&#10; --&gt;&#10;&#10;&lt;html&gt;&#10;&lt;h2&gt;Filter using ParDo&lt;/h2&gt;&#10;&lt;p&gt;&#10; &lt;b&gt;Kata:&lt;/b&gt; Implement a filter function that filters out the even numbers by using&#10; &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/DoFn.html&quot;&gt;&#10; DoFn&lt;/a&gt;.&#10;&lt;/p&gt;&#10;&lt;br&gt;&#10;&lt;div class=&quot;hint&quot;&gt;&#10; Use &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/ParDo.html&quot;&gt;&#10; ParDo&lt;/a&gt; with&#10; &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/DoFn.html&quot;&gt;&#10; DoFn&lt;/a&gt; and only output the intended element.&#10;&lt;/div&gt;&#10;&lt;/html&gt;&#10;" />
<option name="feedbackLink">
<FeedbackLink>
<option name="link" />
<option name="type" value="STEPIK" />
</FeedbackLink>
</option>
<option name="id" value="713736" />
<option name="index" value="1" />
<option name="name" value="ParDo" />
<option name="record" value="-1" />
<option name="status" value="Unchecked" />
<option name="stepikChangeStatus" value="Info and Content changed" />
<option name="files">
<map>
<entry key="src/org/apache/beam/learning/katas/commontransforms/filter/pardo/Task.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list>
<AnswerPlaceholder>
<option name="hints">
<list />
</option>
<option name="index" value="0" />
<option name="initialState" />
<option name="initializedFromDependency" value="false" />
<option name="length" value="6" />
<option name="offset" value="1752" />
<option name="placeholderDependency" />
<option name="placeholderText" value="TODO()" />
<option name="possibleAnswer" value="input.apply(ParDo.of(&#10; new DoFn&lt;Integer, Integer&gt;() {&#10;&#10; @ProcessElement&#10; public void processElement(@Element Integer number, OutputReceiver&lt;Integer&gt; out) {&#10; if (number % 2 == 1) {&#10; out.output(number);&#10; }&#10; }&#10; })&#10; )" />
<option name="selected" value="false" />
<option name="status" value="Unchecked" />
<option name="studentAnswer" />
<option name="useLength" value="false" />
</AnswerPlaceholder>
</list>
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="src/org/apache/beam/learning/katas/commontransforms/filter/pardo/Task.java" />
<option name="text" value="" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="true" />
</TaskFile>
</value>
</entry>
<entry key="test/org/apache/beam/learning/katas/commontransforms/filter/pardo/TaskTest.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list />
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="test/org/apache/beam/learning/katas/commontransforms/filter/pardo/TaskTest.java" />
<option name="text" value="" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="false" />
</TaskFile>
</value>
</entry>
</map>
</option>
<option name="updateDate" value="1560936224000" />
</EduTask>
<EduTask>
<option name="customPresentableName" />
<option name="descriptionFormat" value="HTML" />
<option name="descriptionText" value="&lt;!--&#10; ~ Licensed to the Apache Software Foundation (ASF) under one&#10; ~ or more contributor license agreements. See the NOTICE file&#10; ~ distributed with this work for additional information&#10; ~ regarding copyright ownership. The ASF licenses this file&#10; ~ to you under the Apache License, Version 2.0 (the&#10; ~ &quot;License&quot;); you may not use this file except in compliance&#10; ~ with the License. You may obtain a copy of the License at&#10; ~&#10; ~ http://www.apache.org/licenses/LICENSE-2.0&#10; ~&#10; ~ Unless required by applicable law or agreed to in writing, software&#10; ~ distributed under the License is distributed on an &quot;AS IS&quot; BASIS,&#10; ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&#10; ~ See the License for the specific language governing permissions and&#10; ~ limitations under the License.&#10; --&gt;&#10;&#10;&lt;html&gt;&#10;&lt;h2&gt;Filter&lt;/h2&gt;&#10;&lt;p&gt;&#10; The Beam SDKs provide language-specific ways to simplify how you provide your DoFn implementation.&#10;&lt;/p&gt;&#10;&lt;p&gt;&#10; &lt;b&gt;Kata:&lt;/b&gt; Implement a filter function that filters out the odd numbers by using&#10; &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/Filter.html&quot;&gt;&#10; Filter&lt;/a&gt;.&#10;&lt;/p&gt;&#10;&lt;br&gt;&#10;&lt;div class=&quot;hint&quot;&gt;&#10; Use &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/Filter.html&quot;&gt;&#10; Filter.by(...)&lt;/a&gt;.&#10;&lt;/div&gt;&#10;&lt;/html&gt;&#10;" />
<option name="feedbackLink">
<FeedbackLink>
<option name="link" />
<option name="type" value="STEPIK" />
</FeedbackLink>
</option>
<option name="id" value="713737" />
<option name="index" value="2" />
<option name="name" value="Filter" />
<option name="record" value="-1" />
<option name="status" value="Unchecked" />
<option name="stepikChangeStatus" value="Info and Content changed" />
<option name="files">
<map>
<entry key="src/org/apache/beam/learning/katas/commontransforms/filter/filter/Task.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list>
<AnswerPlaceholder>
<option name="hints">
<list />
</option>
<option name="index" value="0" />
<option name="initialState" />
<option name="initializedFromDependency" value="false" />
<option name="length" value="6" />
<option name="offset" value="1718" />
<option name="placeholderDependency" />
<option name="placeholderText" value="TODO()" />
<option name="possibleAnswer" value="input.apply(Filter.by(number -&gt; number % 2 == 0))" />
<option name="selected" value="false" />
<option name="status" value="Unchecked" />
<option name="studentAnswer" />
<option name="useLength" value="false" />
</AnswerPlaceholder>
</list>
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="src/org/apache/beam/learning/katas/commontransforms/filter/filter/Task.java" />
<option name="text" value="" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="true" />
</TaskFile>
</value>
</entry>
<entry key="test/org/apache/beam/learning/katas/commontransforms/filter/filter/TaskTest.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list />
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="test/org/apache/beam/learning/katas/commontransforms/filter/filter/TaskTest.java" />
<option name="text" value="" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="false" />
</TaskFile>
</value>
</entry>
</map>
</option>
<option name="updateDate" value="1560936227000" />
</EduTask>
</list>
</option>
</Lesson>
<Lesson>
<option name="customPresentableName" />
<option name="id" value="229514" />
<option name="index" value="2" />
<option name="name" value="Aggregation" />
<option name="stepikChangeStatus" value="Content changed" />
<option name="updateDate" value="1559325072000" />
<option name="unitId" value="202039" />
<option name="items">
<list>
<EduTask>
<option name="customPresentableName" />
<option name="descriptionFormat" value="HTML" />
<option name="descriptionText" value="&lt;!--&#10; ~ Licensed to the Apache Software Foundation (ASF) under one&#10; ~ or more contributor license agreements. See the NOTICE file&#10; ~ distributed with this work for additional information&#10; ~ regarding copyright ownership. The ASF licenses this file&#10; ~ to you under the Apache License, Version 2.0 (the&#10; ~ &quot;License&quot;); you may not use this file except in compliance&#10; ~ with the License. You may obtain a copy of the License at&#10; ~&#10; ~ http://www.apache.org/licenses/LICENSE-2.0&#10; ~&#10; ~ Unless required by applicable law or agreed to in writing, software&#10; ~ distributed under the License is distributed on an &quot;AS IS&quot; BASIS,&#10; ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&#10; ~ See the License for the specific language governing permissions and&#10; ~ limitations under the License.&#10; --&gt;&#10;&#10;&lt;html&gt;&#10;&lt;h2&gt;Aggregation - Count&lt;/h2&gt;&#10;&lt;p&gt;&#10; &lt;b&gt;Kata:&lt;/b&gt; Count the number of elements from an input.&#10;&lt;/p&gt;&#10;&lt;br&gt;&#10;&lt;div class=&quot;hint&quot;&gt;&#10; Use &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/Count.html&quot;&gt;&#10; Count&lt;/a&gt;.&#10;&lt;/div&gt;&#10;&lt;/html&gt;&#10;" />
<option name="feedbackLink">
<FeedbackLink>
<option name="link" />
<option name="type" value="STEPIK" />
</FeedbackLink>
</option>
<option name="id" value="713738" />
<option name="index" value="1" />
<option name="name" value="Count" />
<option name="record" value="-1" />
<option name="status" value="Unchecked" />
<option name="stepikChangeStatus" value="Info and Content changed" />
<option name="files">
<map>
<entry key="src/org/apache/beam/learning/katas/commontransforms/aggregation/count/Task.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list>
<AnswerPlaceholder>
<option name="hints">
<list />
</option>
<option name="index" value="0" />
<option name="initialState" />
<option name="initializedFromDependency" value="false" />
<option name="length" value="6" />
<option name="offset" value="1707" />
<option name="placeholderDependency" />
<option name="placeholderText" value="TODO()" />
<option name="possibleAnswer" value="input.apply(Count.globally())" />
<option name="selected" value="false" />
<option name="status" value="Unchecked" />
<option name="studentAnswer" />
<option name="useLength" value="false" />
</AnswerPlaceholder>
</list>
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="src/org/apache/beam/learning/katas/commontransforms/aggregation/count/Task.java" />
<option name="text" value="" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="true" />
</TaskFile>
</value>
</entry>
<entry key="test/org/apache/beam/learning/katas/commontransforms/aggregation/count/TaskTest.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list />
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="test/org/apache/beam/learning/katas/commontransforms/aggregation/count/TaskTest.java" />
<option name="text" value="" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="false" />
</TaskFile>
</value>
</entry>
</map>
</option>
<option name="updateDate" value="1560936231000" />
</EduTask>
<EduTask>
<option name="customPresentableName" />
<option name="descriptionFormat" value="HTML" />
<option name="descriptionText" value="&lt;!--&#10; ~ Licensed to the Apache Software Foundation (ASF) under one&#10; ~ or more contributor license agreements. See the NOTICE file&#10; ~ distributed with this work for additional information&#10; ~ regarding copyright ownership. The ASF licenses this file&#10; ~ to you under the Apache License, Version 2.0 (the&#10; ~ &quot;License&quot;); you may not use this file except in compliance&#10; ~ with the License. You may obtain a copy of the License at&#10; ~&#10; ~ http://www.apache.org/licenses/LICENSE-2.0&#10; ~&#10; ~ Unless required by applicable law or agreed to in writing, software&#10; ~ distributed under the License is distributed on an &quot;AS IS&quot; BASIS,&#10; ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&#10; ~ See the License for the specific language governing permissions and&#10; ~ limitations under the License.&#10; --&gt;&#10;&#10;&lt;html&gt;&#10;&lt;h2&gt;Aggregation - Sum&lt;/h2&gt;&#10;&lt;p&gt;&#10; &lt;b&gt;Kata:&lt;/b&gt; Compute the sum of all elements from an input.&#10;&lt;/p&gt;&#10;&lt;br&gt;&#10;&lt;div class=&quot;hint&quot;&gt;&#10; Use &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/Sum.html&quot;&gt;&#10; Sum&lt;/a&gt;.&#10;&lt;/div&gt;&#10;&lt;/html&gt;&#10;" />
<option name="feedbackLink">
<FeedbackLink>
<option name="link" />
<option name="type" value="STEPIK" />
</FeedbackLink>
</option>
<option name="id" value="713739" />
<option name="index" value="2" />
<option name="name" value="Sum" />
<option name="record" value="-1" />
<option name="status" value="Unchecked" />
<option name="stepikChangeStatus" value="Info and Content changed" />
<option name="files">
<map>
<entry key="src/org/apache/beam/learning/katas/commontransforms/aggregation/sum/Task.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list>
<AnswerPlaceholder>
<option name="hints">
<list />
</option>
<option name="index" value="0" />
<option name="initialState" />
<option name="initializedFromDependency" value="false" />
<option name="length" value="6" />
<option name="offset" value="1709" />
<option name="placeholderDependency" />
<option name="placeholderText" value="TODO()" />
<option name="possibleAnswer" value="input.apply(Sum.integersGlobally())" />
<option name="selected" value="false" />
<option name="status" value="Unchecked" />
<option name="studentAnswer" />
<option name="useLength" value="false" />
</AnswerPlaceholder>
</list>
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="src/org/apache/beam/learning/katas/commontransforms/aggregation/sum/Task.java" />
<option name="text" value="" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="true" />
</TaskFile>
</value>
</entry>
<entry key="test/org/apache/beam/learning/katas/commontransforms/aggregation/sum/TaskTest.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list />
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="test/org/apache/beam/learning/katas/commontransforms/aggregation/sum/TaskTest.java" />
<option name="text" value="" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="false" />
</TaskFile>
</value>
</entry>
</map>
</option>
<option name="updateDate" value="1560936235000" />
</EduTask>
<EduTask>
<option name="customPresentableName" />
<option name="descriptionFormat" value="HTML" />
<option name="descriptionText" value="&lt;!--&#10; ~ Licensed to the Apache Software Foundation (ASF) under one&#10; ~ or more contributor license agreements. See the NOTICE file&#10; ~ distributed with this work for additional information&#10; ~ regarding copyright ownership. The ASF licenses this file&#10; ~ to you under the Apache License, Version 2.0 (the&#10; ~ &quot;License&quot;); you may not use this file except in compliance&#10; ~ with the License. You may obtain a copy of the License at&#10; ~&#10; ~ http://www.apache.org/licenses/LICENSE-2.0&#10; ~&#10; ~ Unless required by applicable law or agreed to in writing, software&#10; ~ distributed under the License is distributed on an &quot;AS IS&quot; BASIS,&#10; ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&#10; ~ See the License for the specific language governing permissions and&#10; ~ limitations under the License.&#10; --&gt;&#10;&#10;&lt;html&gt;&#10;&lt;h2&gt;Aggregation - Mean&lt;/h2&gt;&#10;&lt;p&gt;&#10; &lt;b&gt;Kata:&lt;/b&gt; Compute the mean/average of all elements from an input.&#10;&lt;/p&gt;&#10;&lt;br&gt;&#10;&lt;div class=&quot;hint&quot;&gt;&#10; Use &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/Mean.html&quot;&gt;&#10; Mean&lt;/a&gt;.&#10;&lt;/div&gt;&#10;&lt;/html&gt;&#10;" />
<option name="feedbackLink">
<FeedbackLink>
<option name="link" />
<option name="type" value="STEPIK" />
</FeedbackLink>
</option>
<option name="id" value="713740" />
<option name="index" value="3" />
<option name="name" value="Mean" />
<option name="record" value="-1" />
<option name="status" value="Unchecked" />
<option name="stepikChangeStatus" value="Info and Content changed" />
<option name="files">
<map>
<entry key="src/org/apache/beam/learning/katas/commontransforms/aggregation/mean/Task.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list>
<AnswerPlaceholder>
<option name="hints">
<list />
</option>
<option name="index" value="0" />
<option name="initialState" />
<option name="initializedFromDependency" value="false" />
<option name="length" value="6" />
<option name="offset" value="1709" />
<option name="placeholderDependency" />
<option name="placeholderText" value="TODO()" />
<option name="possibleAnswer" value="input.apply(Mean.globally())" />
<option name="selected" value="false" />
<option name="status" value="Unchecked" />
<option name="studentAnswer" />
<option name="useLength" value="false" />
</AnswerPlaceholder>
</list>
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="src/org/apache/beam/learning/katas/commontransforms/aggregation/mean/Task.java" />
<option name="text" value="" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="true" />
</TaskFile>
</value>
</entry>
<entry key="test/org/apache/beam/learning/katas/commontransforms/aggregation/mean/TaskTest.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list />
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="test/org/apache/beam/learning/katas/commontransforms/aggregation/mean/TaskTest.java" />
<option name="text" value="" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="false" />
</TaskFile>
</value>
</entry>
</map>
</option>
<option name="updateDate" value="1560936238000" />
</EduTask>
<EduTask>
<option name="customPresentableName" />
<option name="descriptionFormat" value="HTML" />
<option name="descriptionText" value="&lt;!--&#10; ~ Licensed to the Apache Software Foundation (ASF) under one&#10; ~ or more contributor license agreements. See the NOTICE file&#10; ~ distributed with this work for additional information&#10; ~ regarding copyright ownership. The ASF licenses this file&#10; ~ to you under the Apache License, Version 2.0 (the&#10; ~ &quot;License&quot;); you may not use this file except in compliance&#10; ~ with the License. You may obtain a copy of the License at&#10; ~&#10; ~ http://www.apache.org/licenses/LICENSE-2.0&#10; ~&#10; ~ Unless required by applicable law or agreed to in writing, software&#10; ~ distributed under the License is distributed on an &quot;AS IS&quot; BASIS,&#10; ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&#10; ~ See the License for the specific language governing permissions and&#10; ~ limitations under the License.&#10; --&gt;&#10;&#10;&lt;html&gt;&#10;&lt;h2&gt;Aggregation - Min&lt;/h2&gt;&#10;&lt;p&gt;&#10; &lt;b&gt;Kata:&lt;/b&gt; Compute the minimum of the elements from an input.&#10;&lt;/p&gt;&#10;&lt;br&gt;&#10;&lt;div class=&quot;hint&quot;&gt;&#10; Use &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/Min.html&quot;&gt;&#10; Min&lt;/a&gt;.&#10;&lt;/div&gt;&#10;&lt;/html&gt;&#10;" />
<option name="feedbackLink">
<FeedbackLink>
<option name="link" />
<option name="type" value="STEPIK" />
</FeedbackLink>
</option>
<option name="id" value="713741" />
<option name="index" value="4" />
<option name="name" value="Min" />
<option name="record" value="-1" />
<option name="status" value="Unchecked" />
<option name="stepikChangeStatus" value="Info and Content changed" />
<option name="files">
<map>
<entry key="src/org/apache/beam/learning/katas/commontransforms/aggregation/min/Task.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list>
<AnswerPlaceholder>
<option name="hints">
<list />
</option>
<option name="index" value="0" />
<option name="initialState" />
<option name="initializedFromDependency" value="false" />
<option name="length" value="6" />
<option name="offset" value="1709" />
<option name="placeholderDependency" />
<option name="placeholderText" value="TODO()" />
<option name="possibleAnswer" value="input.apply(Min.integersGlobally())" />
<option name="selected" value="false" />
<option name="status" value="Unchecked" />
<option name="studentAnswer" />
<option name="useLength" value="false" />
</AnswerPlaceholder>
</list>
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="src/org/apache/beam/learning/katas/commontransforms/aggregation/min/Task.java" />
<option name="text" value="class Task {&#10; //put your task here&#10;}" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="true" />
</TaskFile>
</value>
</entry>
<entry key="test/org/apache/beam/learning/katas/commontransforms/aggregation/min/TaskTest.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list />
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="test/org/apache/beam/learning/katas/commontransforms/aggregation/min/TaskTest.java" />
<option name="text" value="public class Test {&#10; // put your test here&#10;}" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="false" />
</TaskFile>
</value>
</entry>
</map>
</option>
<option name="updateDate" value="1560936242000" />
</EduTask>
<EduTask>
<option name="customPresentableName" />
<option name="descriptionFormat" value="HTML" />
<option name="descriptionText" value="&lt;!--&#10; ~ Licensed to the Apache Software Foundation (ASF) under one&#10; ~ or more contributor license agreements. See the NOTICE file&#10; ~ distributed with this work for additional information&#10; ~ regarding copyright ownership. The ASF licenses this file&#10; ~ to you under the Apache License, Version 2.0 (the&#10; ~ &quot;License&quot;); you may not use this file except in compliance&#10; ~ with the License. You may obtain a copy of the License at&#10; ~&#10; ~ http://www.apache.org/licenses/LICENSE-2.0&#10; ~&#10; ~ Unless required by applicable law or agreed to in writing, software&#10; ~ distributed under the License is distributed on an &quot;AS IS&quot; BASIS,&#10; ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&#10; ~ See the License for the specific language governing permissions and&#10; ~ limitations under the License.&#10; --&gt;&#10;&#10;&lt;html&gt;&#10;&lt;h2&gt;Aggregation - Max&lt;/h2&gt;&#10;&lt;p&gt;&#10; &lt;b&gt;Kata:&lt;/b&gt; Compute the maximum of the elements from an input.&#10;&lt;/p&gt;&#10;&lt;br&gt;&#10;&lt;div class=&quot;hint&quot;&gt;&#10; Use &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/Max.html&quot;&gt;&#10; Max&lt;/a&gt;.&#10;&lt;/div&gt;&#10;&lt;/html&gt;&#10;" />
<option name="feedbackLink">
<FeedbackLink>
<option name="link" />
<option name="type" value="STEPIK" />
</FeedbackLink>
</option>
<option name="id" value="713742" />
<option name="index" value="5" />
<option name="name" value="Max" />
<option name="record" value="-1" />
<option name="status" value="Unchecked" />
<option name="stepikChangeStatus" value="Info and Content changed" />
<option name="files">
<map>
<entry key="src/org/apache/beam/learning/katas/commontransforms/aggregation/max/Task.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list>
<AnswerPlaceholder>
<option name="hints">
<list />
</option>
<option name="index" value="0" />
<option name="initialState" />
<option name="initializedFromDependency" value="false" />
<option name="length" value="6" />
<option name="offset" value="1709" />
<option name="placeholderDependency" />
<option name="placeholderText" value="TODO()" />
<option name="possibleAnswer" value="input.apply(Max.integersGlobally())" />
<option name="selected" value="false" />
<option name="status" value="Unchecked" />
<option name="studentAnswer" />
<option name="useLength" value="false" />
</AnswerPlaceholder>
</list>
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="src/org/apache/beam/learning/katas/commontransforms/aggregation/max/Task.java" />
<option name="text" value="class Task {&#10; //put your task here&#10;}" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="true" />
</TaskFile>
</value>
</entry>
<entry key="test/org/apache/beam/learning/katas/commontransforms/aggregation/max/TaskTest.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list />
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="test/org/apache/beam/learning/katas/commontransforms/aggregation/max/TaskTest.java" />
<option name="text" value="public class Test {&#10; // put your test here&#10;}" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="false" />
</TaskFile>
</value>
</entry>
</map>
</option>
<option name="updateDate" value="1560936246000" />
</EduTask>
</list>
</option>
</Lesson>
<Lesson>
<option name="customPresentableName" />
<option name="id" value="237992" />
<option name="index" value="3" />
<option name="name" value="WithKeys" />
<option name="stepikChangeStatus" value="Info and Content changed" />
<option name="updateDate" value="1560791491864" />
<option name="unitId" value="-1" />
<option name="items">
<list>
<EduTask>
<option name="customPresentableName" />
<option name="descriptionFormat" value="HTML" />
<option name="descriptionText" value="&lt;!--&#10; ~ Licensed to the Apache Software Foundation (ASF) under one&#10; ~ or more contributor license agreements. See the NOTICE file&#10; ~ distributed with this work for additional information&#10; ~ regarding copyright ownership. The ASF licenses this file&#10; ~ to you under the Apache License, Version 2.0 (the&#10; ~ &quot;License&quot;); you may not use this file except in compliance&#10; ~ with the License. You may obtain a copy of the License at&#10; ~&#10; ~ http://www.apache.org/licenses/LICENSE-2.0&#10; ~&#10; ~ Unless required by applicable law or agreed to in writing, software&#10; ~ distributed under the License is distributed on an &quot;AS IS&quot; BASIS,&#10; ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&#10; ~ See the License for the specific language governing permissions and&#10; ~ limitations under the License.&#10; --&gt;&#10;&#10;&lt;html&gt;&#10;&lt;h2&gt;WithKeys&lt;/h2&gt;&#10;&lt;p&gt;&#10; &lt;b&gt;Kata:&lt;/b&gt; Convert each fruit name into a KV of its first letter and itself, e.g.&#10; &lt;code&gt;apple =&gt; KV.of(&quot;a&quot;, &quot;apple&quot;)&lt;/code&gt;&#10;&lt;/p&gt;&#10;&lt;br&gt;&#10;&lt;div class=&quot;hint&quot;&gt;&#10; Use &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/WithKeys.html&quot;&gt;&#10; WithKeys&lt;/a&gt;.&#10;&lt;/div&gt;&#10;&lt;div class=&quot;hint&quot;&gt;&#10; If using a lambda in Java 8, &lt;code&gt;withKeyType(TypeDescriptor)&lt;/code&gt; must be called on the&#10; result PTransform.&#10;&lt;/div&gt;&#10;&lt;/html&gt;&#10;" />
<option name="feedbackLink">
<FeedbackLink>
<option name="link" />
<option name="type" value="STEPIK" />
</FeedbackLink>
</option>
<option name="id" value="754089" />
<option name="index" value="1" />
<option name="name" value="WithKeys" />
<option name="record" value="-1" />
<option name="status" value="Unchecked" />
<option name="stepikChangeStatus" value="Info and Content changed" />
<option name="files">
<map>
<entry key="src/org/apache/beam/learning/katas/commontransforms/withkeys/Task.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list>
<AnswerPlaceholder>
<option name="hints">
<list />
</option>
<option name="index" value="0" />
<option name="initialState" />
<option name="initializedFromDependency" value="false" />
<option name="length" value="6" />
<option name="offset" value="1875" />
<option name="placeholderDependency" />
<option name="placeholderText" value="TODO()" />
<option name="possibleAnswer" value="input&#10; .apply(WithKeys.&lt;String, String&gt;of(fruit -&gt; fruit.substring(0, 1))&#10; .withKeyType(strings()))" />
<option name="selected" value="false" />
<option name="status" value="Unchecked" />
<option name="studentAnswer" />
<option name="useLength" value="false" />
</AnswerPlaceholder>
</list>
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="src/org/apache/beam/learning/katas/commontransforms/withkeys/Task.java" />
<option name="text" value="public class Task {&#10; //put your task here&#10;}" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="true" />
</TaskFile>
</value>
</entry>
<entry key="test/org/apache/beam/learning/katas/commontransforms/withkeys/TaskTest.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list />
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="test/org/apache/beam/learning/katas/commontransforms/withkeys/TaskTest.java" />
<option name="text" value="import org.junit.Assert;&#10;import org.junit.Test;&#10;&#10;public class Tests {&#10; @Test&#10; public void testSolution() {&#10; // put your test here&#10; Assert.fail(&quot;Tests not implemented for the task&quot;);&#10; }&#10;}" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="false" />
</TaskFile>
</value>
</entry>
</map>
</option>
<option name="updateDate" value="1560936249000" />
</EduTask>
</list>
</option>
</Lesson>
</list>
</option>
</Section>
<Section>
<option name="courseId" value="54530" />
<option name="customPresentableName" />
<option name="id" value="88010" />
<option name="index" value="4" />
<option name="name" value="IO" />
<option name="position" value="4" />
<option name="stepikChangeStatus" value="Up to date" />
<option name="updateDate" value="1560431425000" />
<option name="items">
<list>
<Lesson>
<option name="customPresentableName" />
<option name="id" value="237187" />
<option name="index" value="1" />
<option name="name" value="TextIO" />
<option name="stepikChangeStatus" value="Content changed" />
<option name="updateDate" value="1560431430000" />
<option name="unitId" value="209563" />
<option name="items">
<list>
<EduTask>
<option name="customPresentableName" />
<option name="descriptionFormat" value="HTML" />
<option name="descriptionText" value="&lt;!--&#10; ~ Licensed to the Apache Software Foundation (ASF) under one&#10; ~ or more contributor license agreements. See the NOTICE file&#10; ~ distributed with this work for additional information&#10; ~ regarding copyright ownership. The ASF licenses this file&#10; ~ to you under the Apache License, Version 2.0 (the&#10; ~ &quot;License&quot;); you may not use this file except in compliance&#10; ~ with the License. You may obtain a copy of the License at&#10; ~&#10; ~ http://www.apache.org/licenses/LICENSE-2.0&#10; ~&#10; ~ Unless required by applicable law or agreed to in writing, software&#10; ~ distributed under the License is distributed on an &quot;AS IS&quot; BASIS,&#10; ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&#10; ~ See the License for the specific language governing permissions and&#10; ~ limitations under the License.&#10; --&gt;&#10;&#10;&lt;html&gt;&#10;&lt;h2&gt;TextIO Read&lt;/h2&gt;&#10;&lt;p&gt;&#10; When you create a pipeline, you often need to read data from some external source, such as a file&#10; or a database. Likewise, you may want your pipeline to output its result data to an external&#10; storage system. Beam provides read and write transforms for a number of common data storage types.&#10; If you want your pipeline to read from or write to a data storage format that isn’t supported by&#10; the built-in transforms, you can implement your own read and write transforms.&#10;&lt;/p&gt;&#10;&lt;p&gt;&#10; To read a PCollection from one or more text files, use TextIO.read() to instantiate a transform&#10; and use TextIO.Read.from(String) to specify the path of the file(s) to be read.&#10;&lt;/p&gt;&#10;&lt;p&gt;&#10; &lt;b&gt;Kata:&lt;/b&gt; Read the 'countries.txt' file and convert each country name into uppercase.&#10;&lt;/p&gt;&#10;&lt;br&gt;&#10;&lt;div class=&quot;hint&quot;&gt;&#10; Use &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/io/TextIO.html&quot;&gt;&#10; TextIO&lt;/a&gt; and its corresponding&#10; &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/io/TextIO.html#read--&quot;&gt;&#10; TextIO.read()&lt;/a&gt; method.&#10;&lt;/div&gt;&#10;&lt;div class=&quot;hint&quot;&gt;&#10; Refer to the Beam Programming Guide&#10; &lt;a href=&quot;https://beam.apache.org/documentation/programming-guide/#pipeline-io-reading-data&quot;&gt;&#10; &quot;Reading input data&quot;&lt;/a&gt; section for more information.&#10;&lt;/div&gt;&#10;&lt;/html&gt;&#10;" />
<option name="feedbackLink">
<FeedbackLink>
<option name="link" />
<option name="type" value="STEPIK" />
</FeedbackLink>
</option>
<option name="id" value="750317" />
<option name="index" value="1" />
<option name="name" value="TextIO Read" />
<option name="record" value="-1" />
<option name="status" value="Unchecked" />
<option name="stepikChangeStatus" value="Info and Content changed" />
<option name="files">
<map>
<entry key="countries.txt">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list />
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="countries.txt" />
<option name="text" value="" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="true" />
</TaskFile>
</value>
</entry>
<entry key="src/org/apache/beam/learning/katas/io/textio/read/Task.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list>
<AnswerPlaceholder>
<option name="hints">
<list />
</option>
<option name="index" value="0" />
<option name="initialState" />
<option name="initializedFromDependency" value="false" />
<option name="length" value="6" />
<option name="offset" value="1615" />
<option name="placeholderDependency" />
<option name="placeholderText" value="TODO()" />
<option name="possibleAnswer" value="TextIO.read().from(FILE_PATH)" />
<option name="selected" value="false" />
<option name="status" value="Unchecked" />
<option name="studentAnswer" />
<option name="useLength" value="false" />
</AnswerPlaceholder>
<AnswerPlaceholder>
<option name="hints">
<list />
</option>
<option name="index" value="1" />
<option name="initialState" />
<option name="initializedFromDependency" value="false" />
<option name="length" value="6" />
<option name="offset" value="1855" />
<option name="placeholderDependency" />
<option name="placeholderText" value="TODO()" />
<option name="possibleAnswer" value="input.apply(MapElements.into(strings()).via(String::toUpperCase))" />
<option name="selected" value="false" />
<option name="status" value="Unchecked" />
<option name="studentAnswer" />
<option name="useLength" value="false" />
</AnswerPlaceholder>
</list>
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="src/org/apache/beam/learning/katas/io/textio/read/Task.java" />
<option name="text" value="public class Task {&#10; //put your task here&#10;}" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="true" />
</TaskFile>
</value>
</entry>
<entry key="test/org/apache/beam/learning/katas/io/textio/read/TaskTest.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list />
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="test/org/apache/beam/learning/katas/io/textio/read/TaskTest.java" />
<option name="text" value="import org.junit.Assert;&#10;import org.junit.Test;&#10;&#10;public class Tests {&#10; @Test&#10; public void testSolution() {&#10; // put your test here&#10; Assert.fail(&quot;Tests not implemented for the task&quot;);&#10; }&#10;}" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="false" />
</TaskFile>
</value>
</entry>
</map>
</option>
<option name="updateDate" value="1560936253000" />
</EduTask>
</list>
</option>
</Lesson>
<Lesson>
<option name="customPresentableName" />
<option name="id" value="237188" />
<option name="index" value="2" />
<option name="name" value="Built-in IOs" />
<option name="stepikChangeStatus" value="Content changed" />
<option name="updateDate" value="1560431436000" />
<option name="unitId" value="209564" />
<option name="items">
<list>
<EduTask>
<option name="customPresentableName" />
<option name="descriptionFormat" value="HTML" />
<option name="descriptionText" value="&lt;!--&#10; ~ Licensed to the Apache Software Foundation (ASF) under one&#10; ~ or more contributor license agreements. See the NOTICE file&#10; ~ distributed with this work for additional information&#10; ~ regarding copyright ownership. The ASF licenses this file&#10; ~ to you under the Apache License, Version 2.0 (the&#10; ~ &quot;License&quot;); you may not use this file except in compliance&#10; ~ with the License. You may obtain a copy of the License at&#10; ~&#10; ~ http://www.apache.org/licenses/LICENSE-2.0&#10; ~&#10; ~ Unless required by applicable law or agreed to in writing, software&#10; ~ distributed under the License is distributed on an &quot;AS IS&quot; BASIS,&#10; ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&#10; ~ See the License for the specific language governing permissions and&#10; ~ limitations under the License.&#10; --&gt;&#10;&#10;&lt;html&gt;&#10;&lt;h2&gt;Built-in I/Os&lt;/h2&gt;&#10;&lt;p&gt;&#10; Beam SDKs provide many out of the box I/O transforms that can be used to read from many&#10; different sources and write to many different sinks.&#10;&lt;/p&gt;&#10;&lt;p&gt;&#10; See the &lt;a href=&quot;https://beam.apache.org/documentation/io/built-in/&quot;&gt;Beam-provided I/O&#10; Transforms&lt;/a&gt; page for a list of the currently available I/O transforms.&#10;&lt;/p&gt;&#10;&lt;/html&gt;" />
<option name="feedbackLink">
<FeedbackLink>
<option name="link" />
<option name="type" value="STEPIK" />
</FeedbackLink>
</option>
<option name="id" value="750319" />
<option name="index" value="1" />
<option name="name" value="Built-in IOs" />
<option name="record" value="-1" />
<option name="status" value="Unchecked" />
<option name="stepikChangeStatus" value="Info and Content changed" />
<option name="files">
<map>
<entry key="src/org/apache/beam/learning/katas/io/builtinios/Task.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list />
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="src/org/apache/beam/learning/katas/io/builtinios/Task.java" />
<option name="text" value="" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="true" />
</TaskFile>
</value>
</entry>
<entry key="test/org/apache/beam/learning/katas/io/builtinios/TaskTest.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list />
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="test/org/apache/beam/learning/katas/io/builtinios/TaskTest.java" />
<option name="text" value="" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="false" />
</TaskFile>
</value>
</entry>
</map>
</option>
<option name="updateDate" value="1560936257000" />
</EduTask>
</list>
</option>
</Lesson>
</list>
</option>
</Section>
<Section>
<option name="courseId" value="54530" />
<option name="customPresentableName" />
<option name="id" value="88156" />
<option name="index" value="5" />
<option name="name" value="Windowing" />
<option name="position" value="5" />
<option name="stepikChangeStatus" value="Up to date" />
<option name="updateDate" value="1560698891352" />
<option name="items">
<list>
<Lesson>
<option name="customPresentableName" />
<option name="id" value="237760" />
<option name="index" value="1" />
<option name="name" value="Adding Timestamp" />
<option name="stepikChangeStatus" value="Content changed" />
<option name="updateDate" value="0" />
<option name="unitId" value="210092" />
<option name="items">
<list>
<EduTask>
<option name="customPresentableName" />
<option name="descriptionFormat" value="HTML" />
<option name="descriptionText" value="&lt;!--&#10; ~ Licensed to the Apache Software Foundation (ASF) under one&#10; ~ or more contributor license agreements. See the NOTICE file&#10; ~ distributed with this work for additional information&#10; ~ regarding copyright ownership. The ASF licenses this file&#10; ~ to you under the Apache License, Version 2.0 (the&#10; ~ &quot;License&quot;); you may not use this file except in compliance&#10; ~ with the License. You may obtain a copy of the License at&#10; ~&#10; ~ http://www.apache.org/licenses/LICENSE-2.0&#10; ~&#10; ~ Unless required by applicable law or agreed to in writing, software&#10; ~ distributed under the License is distributed on an &quot;AS IS&quot; BASIS,&#10; ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&#10; ~ See the License for the specific language governing permissions and&#10; ~ limitations under the License.&#10; --&gt;&#10;&#10;&lt;html&gt;&#10;&lt;h2&gt;Adding Timestamp - ParDo&lt;/h2&gt;&#10;&lt;p&gt;&#10; Bounded sources (such as a file from TextIO) do not provide timestamps for elements. If you need&#10; timestamps, you must add them to your PCollection’s elements.&#10;&lt;/p&gt;&#10;&lt;p&gt;&#10; You can assign new timestamps to the elements of a PCollection by applying a ParDo transform that&#10; outputs new elements with timestamps that you set.&#10;&lt;/p&gt;&#10;&lt;p&gt;&#10; &lt;b&gt;Kata:&lt;/b&gt; Please assign each element a timestamp based on the the &lt;code&gt;Event.getDate()&lt;/code&gt;.&#10;&lt;/p&gt;&#10;&lt;br&gt;&#10;&lt;div class=&quot;hint&quot;&gt;&#10; Use &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/ParDo.html&quot;&gt;&#10; ParDo&lt;/a&gt;&#10; with &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/DoFn.html&quot;&gt;&#10; DoFn&lt;/a&gt;.&#10;&lt;/div&gt;&#10;&lt;div class=&quot;hint&quot;&gt;&#10; Use &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/DoFn.OutputReceiver.html#outputWithTimestamp-T-org.joda.time.Instant-&quot;&gt;&#10; OutputReceiver.outputWithTimestamp&lt;/a&gt; method to assign timestamp to the element.&#10;&lt;/div&gt;&#10;&lt;div class=&quot;hint&quot;&gt;&#10; Refer to the Beam Programming Guide&#10; &lt;a href=&quot;https://beam.apache.org/documentation/programming-guide/#adding-timestamps-to-a-pcollections-elements&quot;&gt;&#10; &quot;Adding timestamps to a PCollection’s elements&quot;&lt;/a&gt; section for more information.&#10;&lt;/div&gt;&#10;&lt;/html&gt;&#10;" />
<option name="feedbackLink">
<FeedbackLink>
<option name="link" />
<option name="type" value="STEPIK" />
</FeedbackLink>
</option>
<option name="id" value="753142" />
<option name="index" value="1" />
<option name="name" value="ParDo" />
<option name="record" value="-1" />
<option name="status" value="Unchecked" />
<option name="stepikChangeStatus" value="Up to date" />
<option name="files">
<map>
<entry key="src/org/apache/beam/learning/katas/windowing/addingtimestamp/pardo/Event.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list />
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="src/org/apache/beam/learning/katas/windowing/addingtimestamp/pardo/Event.java" />
<option name="text" value="" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="true" />
</TaskFile>
</value>
</entry>
<entry key="src/org/apache/beam/learning/katas/windowing/addingtimestamp/pardo/Task.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list>
<AnswerPlaceholder>
<option name="hints">
<list />
</option>
<option name="index" value="0" />
<option name="initialState" />
<option name="initializedFromDependency" value="false" />
<option name="length" value="6" />
<option name="offset" value="2249" />
<option name="placeholderDependency" />
<option name="placeholderText" value="TODO()" />
<option name="possibleAnswer" value="events.apply(ParDo.of(new DoFn&lt;Event, Event&gt;() {&#10;&#10; @ProcessElement&#10; public void processElement(@Element Event event, OutputReceiver&lt;Event&gt; out) {&#10; out.outputWithTimestamp(event, event.getDate().toInstant());&#10; }&#10;&#10; }))" />
<option name="selected" value="false" />
<option name="status" value="Unchecked" />
<option name="studentAnswer" />
<option name="useLength" value="false" />
</AnswerPlaceholder>
</list>
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="src/org/apache/beam/learning/katas/windowing/addingtimestamp/pardo/Task.java" />
<option name="text" value="public class Task {&#10; //put your task here&#10;}" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="true" />
</TaskFile>
</value>
</entry>
<entry key="test/org/apache/beam/learning/katas/windowing/addingtimestamp/pardo/TaskTest.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list />
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="test/org/apache/beam/learning/katas/windowing/addingtimestamp/pardo/TaskTest.java" />
<option name="text" value="import org.junit.Assert;&#10;import org.junit.Test;&#10;&#10;public class Tests {&#10; @Test&#10; public void testSolution() {&#10; // put your test here&#10; Assert.fail(&quot;Tests not implemented for the task&quot;);&#10; }&#10;}" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="false" />
</TaskFile>
</value>
</entry>
</map>
</option>
<option name="updateDate" value="1560698905262" />
</EduTask>
<EduTask>
<option name="customPresentableName" />
<option name="descriptionFormat" value="HTML" />
<option name="descriptionText" value="&lt;!--&#10; ~ Licensed to the Apache Software Foundation (ASF) under one&#10; ~ or more contributor license agreements. See the NOTICE file&#10; ~ distributed with this work for additional information&#10; ~ regarding copyright ownership. The ASF licenses this file&#10; ~ to you under the Apache License, Version 2.0 (the&#10; ~ &quot;License&quot;); you may not use this file except in compliance&#10; ~ with the License. You may obtain a copy of the License at&#10; ~&#10; ~ http://www.apache.org/licenses/LICENSE-2.0&#10; ~&#10; ~ Unless required by applicable law or agreed to in writing, software&#10; ~ distributed under the License is distributed on an &quot;AS IS&quot; BASIS,&#10; ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&#10; ~ See the License for the specific language governing permissions and&#10; ~ limitations under the License.&#10; --&gt;&#10;&#10;&lt;html&gt;&#10;&lt;h2&gt;Adding Timestamp - WithTimestamps&lt;/h2&gt;&#10;&lt;p&gt;&#10; Bounded sources (such as a file from TextIO) do not provide timestamps for elements. If you need&#10; timestamps, you must add them to your PCollection’s elements.&#10;&lt;/p&gt;&#10;&lt;p&gt;&#10; You can assign new timestamps to the elements of a PCollection by applying a ParDo transform that&#10; outputs new elements with timestamps that you set.&#10;&lt;/p&gt;&#10;&lt;p&gt;&#10; &lt;b&gt;Kata:&lt;/b&gt; Please assign each element a timestamp based on the the &lt;code&gt;Event.getDate()&lt;/code&gt;.&#10;&lt;/p&gt;&#10;&lt;br&gt;&#10;&lt;div class=&quot;hint&quot;&gt;&#10; Use &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/WithTimestamps.html&quot;&gt;&#10; WithTimestamps&lt;/a&gt;.&#10;&lt;/div&gt;&#10;&lt;div class=&quot;hint&quot;&gt;&#10; Refer to the Beam Programming Guide&#10; &lt;a href=&quot;https://beam.apache.org/documentation/programming-guide/#adding-timestamps-to-a-pcollections-elements&quot;&gt;&#10; &quot;Adding timestamps to a PCollection’s elements&quot;&lt;/a&gt; section for more information.&#10;&lt;/div&gt;&#10;&lt;/html&gt;" />
<option name="feedbackLink">
<FeedbackLink>
<option name="link" />
<option name="type" value="STEPIK" />
</FeedbackLink>
</option>
<option name="id" value="753143" />
<option name="index" value="2" />
<option name="name" value="WithTimestamps" />
<option name="record" value="-1" />
<option name="status" value="Unchecked" />
<option name="stepikChangeStatus" value="Up to date" />
<option name="files">
<map>
<entry key="src/org/apache/beam/learning/katas/windowing/addingtimestamp/withtimestamps/Event.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list />
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="src/org/apache/beam/learning/katas/windowing/addingtimestamp/withtimestamps/Event.java" />
<option name="text" value="" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="true" />
</TaskFile>
</value>
</entry>
<entry key="src/org/apache/beam/learning/katas/windowing/addingtimestamp/withtimestamps/Task.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list>
<AnswerPlaceholder>
<option name="hints">
<list />
</option>
<option name="index" value="0" />
<option name="initialState" />
<option name="initializedFromDependency" value="false" />
<option name="length" value="6" />
<option name="offset" value="2223" />
<option name="placeholderDependency" />
<option name="placeholderText" value="TODO()" />
<option name="possibleAnswer" value="events.apply(WithTimestamps.of(event -&gt; event.getDate().toInstant()))" />
<option name="selected" value="false" />
<option name="status" value="Unchecked" />
<option name="studentAnswer" />
<option name="useLength" value="false" />
</AnswerPlaceholder>
</list>
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="src/org/apache/beam/learning/katas/windowing/addingtimestamp/withtimestamps/Task.java" />
<option name="text" value="public class Task {&#10; //put your task here&#10;}" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="true" />
</TaskFile>
</value>
</entry>
<entry key="test/org/apache/beam/learning/katas/windowing/addingtimestamp/withtimestamps/TaskTest.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list />
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="test/org/apache/beam/learning/katas/windowing/addingtimestamp/withtimestamps/TaskTest.java" />
<option name="text" value="import org.junit.Assert;&#10;import org.junit.Test;&#10;&#10;public class Tests {&#10; @Test&#10; public void testSolution() {&#10; // put your test here&#10; Assert.fail(&quot;Tests not implemented for the task&quot;);&#10; }&#10;}" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="false" />
</TaskFile>
</value>
</entry>
</map>
</option>
<option name="updateDate" value="1560698907450" />
</EduTask>
</list>
</option>
</Lesson>
<Lesson>
<option name="customPresentableName" />
<option name="id" value="237761" />
<option name="index" value="2" />
<option name="name" value="Fixed Time Window" />
<option name="stepikChangeStatus" value="Content changed" />
<option name="updateDate" value="0" />
<option name="unitId" value="210093" />
<option name="items">
<list>
<EduTask>
<option name="customPresentableName" />
<option name="descriptionFormat" value="HTML" />
<option name="descriptionText" value="&lt;!--&#10; ~ Licensed to the Apache Software Foundation (ASF) under one&#10; ~ or more contributor license agreements. See the NOTICE file&#10; ~ distributed with this work for additional information&#10; ~ regarding copyright ownership. The ASF licenses this file&#10; ~ to you under the Apache License, Version 2.0 (the&#10; ~ &quot;License&quot;); you may not use this file except in compliance&#10; ~ with the License. You may obtain a copy of the License at&#10; ~&#10; ~ http://www.apache.org/licenses/LICENSE-2.0&#10; ~&#10; ~ Unless required by applicable law or agreed to in writing, software&#10; ~ distributed under the License is distributed on an &quot;AS IS&quot; BASIS,&#10; ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&#10; ~ See the License for the specific language governing permissions and&#10; ~ limitations under the License.&#10; --&gt;&#10;&#10;&lt;html&gt;&#10;&lt;h2&gt;Fixed Time Window&lt;/h2&gt;&#10;&lt;p&gt;&#10; Windowing subdivides a PCollection according to the timestamps of its individual elements.&#10; Transforms that aggregate multiple elements, such as GroupByKey and Combine, work implicitly on&#10; a per-window basis — they process each PCollection as a succession of multiple, finite windows,&#10; though the entire collection itself may be of unbounded size.&#10;&lt;/p&gt;&#10;&lt;p&gt;&#10; In the Beam model, any PCollection (including unbounded PCollections) can be subdivided into&#10; logical windows. Each element in a PCollection is assigned to one or more windows according to&#10; the PCollection’s windowing function, and each individual window contains a finite number of&#10; elements. Grouping transforms then consider each PCollection’s elements on a per-window basis.&#10; GroupByKey, for example, implicitly groups the elements of a PCollection by key and window.&#10;&lt;/p&gt;&#10;&lt;div&gt;&#10; Beam provides several windowing functions, including:&#10; &lt;ul&gt;&#10; &lt;li&gt;Fixed Time Windows&lt;/li&gt;&#10; &lt;li&gt;Sliding Time Windows&lt;/li&gt;&#10; &lt;li&gt;Per-Session Windows&lt;/li&gt;&#10; &lt;li&gt;Single Global Window&lt;/li&gt;&#10; &lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;p&gt;&#10; The simplest form of windowing is using fixed time windows. A fixed time window represents a&#10; consistent duration, non overlapping time interval in the data stream.&#10;&lt;/p&gt;&#10;&lt;p&gt;&#10; &lt;b&gt;Kata:&lt;/b&gt; Please count the number of events that happened based on fixed window with&#10; 1-day duration.&#10;&lt;/p&gt;&#10;&lt;br&gt;&#10;&lt;div class=&quot;hint&quot;&gt;&#10; Use &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/windowing/FixedWindows.html&quot;&gt;&#10; FixedWindows&lt;/a&gt; with 1-day duration.&#10;&lt;/div&gt;&#10;&lt;div class=&quot;hint&quot;&gt;&#10; Refer to the Beam Programming Guide&#10; &lt;a href=&quot;https://beam.apache.org/documentation/programming-guide/#fixed-time-windows&quot;&gt;&#10; &quot;Fixed time windows&quot;&lt;/a&gt; section for more information.&#10;&lt;/div&gt;&#10;&lt;/html&gt;" />
<option name="feedbackLink">
<FeedbackLink>
<option name="link" />
<option name="type" value="STEPIK" />
</FeedbackLink>
</option>
<option name="id" value="753144" />
<option name="index" value="1" />
<option name="name" value="Fixed Time Window" />
<option name="record" value="-1" />
<option name="status" value="Unchecked" />
<option name="stepikChangeStatus" value="Up to date" />
<option name="files">
<map>
<entry key="src/org/apache/beam/learning/katas/windowing/fixedwindow/Task.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list>
<AnswerPlaceholder>
<option name="hints">
<list />
</option>
<option name="index" value="0" />
<option name="initialState" />
<option name="initializedFromDependency" value="false" />
<option name="length" value="6" />
<option name="offset" value="2906" />
<option name="placeholderDependency" />
<option name="placeholderText" value="TODO()" />
<option name="possibleAnswer" value="events&#10; .apply(Window.into(FixedWindows.of(Duration.standardDays(1))))&#10; .apply(Count.perElement())" />
<option name="selected" value="false" />
<option name="status" value="Unchecked" />
<option name="studentAnswer" />
<option name="useLength" value="false" />
</AnswerPlaceholder>
</list>
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="src/org/apache/beam/learning/katas/windowing/fixedwindow/Task.java" />
<option name="text" value="public class Task {&#10; //put your task here&#10;}" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="true" />
</TaskFile>
</value>
</entry>
<entry key="test/org/apache/beam/learning/katas/windowing/fixedwindow/TaskTest.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list />
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="test/org/apache/beam/learning/katas/windowing/fixedwindow/TaskTest.java" />
<option name="text" value="import org.junit.Assert;&#10;import org.junit.Test;&#10;&#10;public class Tests {&#10; @Test&#10; public void testSolution() {&#10; // put your test here&#10; Assert.fail(&quot;Tests not implemented for the task&quot;);&#10; }&#10;}" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="false" />
</TaskFile>
</value>
</entry>
<entry key="test/org/apache/beam/learning/katas/windowing/fixedwindow/WindowedEvent.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list />
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="test/org/apache/beam/learning/katas/windowing/fixedwindow/WindowedEvent.java" />
<option name="text" value="" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="false" />
</TaskFile>
</value>
</entry>
</map>
</option>
<option name="updateDate" value="1560698912954" />
</EduTask>
</list>
</option>
</Lesson>
</list>
</option>
</Section>
<Section>
<option name="courseId" value="54530" />
<option name="customPresentableName" />
<option name="id" value="88157" />
<option name="index" value="6" />
<option name="name" value="Triggers" />
<option name="position" value="6" />
<option name="stepikChangeStatus" value="Up to date" />
<option name="updateDate" value="1560923505422" />
<option name="items">
<list>
<Lesson>
<option name="customPresentableName" />
<option name="id" value="237762" />
<option name="index" value="1" />
<option name="name" value="Event Time Triggers" />
<option name="stepikChangeStatus" value="Up to date" />
<option name="updateDate" value="1560923508379" />
<option name="unitId" value="210094" />
<option name="items">
<list>
<EduTask>
<option name="customPresentableName" />
<option name="descriptionFormat" value="HTML" />
<option name="descriptionText" value="&lt;!--&#10; ~ Licensed to the Apache Software Foundation (ASF) under one&#10; ~ or more contributor license agreements. See the NOTICE file&#10; ~ distributed with this work for additional information&#10; ~ regarding copyright ownership. The ASF licenses this file&#10; ~ to you under the Apache License, Version 2.0 (the&#10; ~ &quot;License&quot;); you may not use this file except in compliance&#10; ~ with the License. You may obtain a copy of the License at&#10; ~&#10; ~ http://www.apache.org/licenses/LICENSE-2.0&#10; ~&#10; ~ Unless required by applicable law or agreed to in writing, software&#10; ~ distributed under the License is distributed on an &quot;AS IS&quot; BASIS,&#10; ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&#10; ~ See the License for the specific language governing permissions and&#10; ~ limitations under the License.&#10; --&gt;&#10;&#10;&lt;html&gt;&#10;&lt;h2&gt;Event Time Triggers&lt;/h2&gt;&#10;&lt;p&gt;&#10; When collecting and grouping data into windows, Beam uses triggers to determine when to emit the&#10; aggregated results of each window (referred to as a pane). If you use Beam’s default windowing&#10; configuration and default trigger, Beam outputs the aggregated result when it estimates all data&#10; has arrived, and discards all subsequent data for that window.&#10;&lt;/p&gt;&#10;&lt;p&gt;&#10; You can set triggers for your PCollections to change this default behavior. Beam provides a&#10; number of pre-built triggers that you can set:&#10;&lt;/p&gt;&#10;&lt;div&gt;&#10; &lt;ul&gt;&#10; &lt;li&gt;Event time triggers&lt;/li&gt;&#10; &lt;li&gt;Processing time triggers&lt;/li&gt;&#10; &lt;li&gt;Data-driven triggers&lt;/li&gt;&#10; &lt;li&gt;Composite triggers&lt;/li&gt;&#10; &lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;p&gt;&#10; Event time triggers operate on the event time, as indicated by the timestamp on each data&#10; element. Beam’s default trigger is event time-based.&#10;&lt;/p&gt;&#10;&lt;p&gt;&#10; The AfterWatermark trigger operates on event time. The AfterWatermark trigger emits the contents&#10; of a window after the watermark passes the end of the window, based on the timestamps attached&#10; to the data elements. The watermark is a global progress metric, and is Beam’s notion of input&#10; completeness within your pipeline at any given point. AfterWatermark.pastEndOfWindow() only fires&#10; when the watermark passes the end of the window.&#10;&lt;/p&gt;&#10;&lt;p&gt;&#10; &lt;b&gt;Kata:&lt;/b&gt; Given that events are being generated every second, please implement a trigger that&#10; emits the number of events count within a fixed window of 5-second duration.&#10;&lt;/p&gt;&#10;&lt;br&gt;&#10;&lt;div class=&quot;hint&quot;&gt;&#10; Use &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/windowing/FixedWindows.html&quot;&gt;&#10; FixedWindows&lt;/a&gt; with 5-second duration using&#10; &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/windowing/AfterWatermark.html#pastEndOfWindow--&quot;&gt;&#10; AfterWatermark.pastEndOfWindow()&lt;/a&gt; trigger.&#10;&lt;/div&gt;&#10;&lt;div class=&quot;hint&quot;&gt;&#10; Set the &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/windowing/Window.html#withAllowedLateness-org.joda.time.Duration-&quot;&gt;&#10; allowed lateness&lt;/a&gt; to 0 with&#10; &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/windowing/Window.html#discardingFiredPanes--&quot;&gt;&#10; discarding accumulation mode&lt;/a&gt;.&#10;&lt;/div&gt;&#10;&lt;div class=&quot;hint&quot;&gt;&#10; Use &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/Combine.html#globally-org.apache.beam.sdk.transforms.CombineFnBase.GlobalCombineFn-&quot;&gt;&#10; Combine.globally&lt;/a&gt; and&#10; &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/Count.html#combineFn--&quot;&gt;&#10; Count.combineFn&lt;/a&gt; to calculate the count of events.&#10;&lt;/div&gt;&#10;&lt;div class=&quot;hint&quot;&gt;&#10; Refer to the Beam Programming Guide&#10; &lt;a href=&quot;https://beam.apache.org/documentation/programming-guide/#event-time-triggers&quot;&gt;&#10; &quot;Event time triggers&quot;&lt;/a&gt; section for more information.&#10;&lt;/div&gt;&#10;&lt;/html&gt;&#10;" />
<option name="feedbackLink">
<FeedbackLink>
<option name="link" />
<option name="type" value="STEPIK" />
</FeedbackLink>
</option>
<option name="id" value="753145" />
<option name="index" value="1" />
<option name="name" value="Event Time Triggers" />
<option name="record" value="-1" />
<option name="status" value="Unchecked" />
<option name="stepikChangeStatus" value="Up to date" />
<option name="files">
<map>
<entry key="src/org/apache/beam/learning/katas/triggers/eventtimetriggers/Task.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list>
<AnswerPlaceholder>
<option name="hints">
<list />
</option>
<option name="index" value="0" />
<option name="initialState" />
<option name="initializedFromDependency" value="false" />
<option name="length" value="6" />
<option name="offset" value="1905" />
<option name="placeholderDependency" />
<option name="placeholderText" value="TODO()" />
<option name="possibleAnswer" value="events&#10; .apply(&#10; Window.&lt;String&gt;into(FixedWindows.of(Duration.standardSeconds(5)))&#10; .triggering(AfterWatermark.pastEndOfWindow())&#10; .withAllowedLateness(Duration.ZERO)&#10; .discardingFiredPanes())&#10;&#10; .apply(Combine.globally(Count.&lt;String&gt;combineFn()).withoutDefaults())" />
<option name="selected" value="false" />
<option name="status" value="Unchecked" />
<option name="studentAnswer" />
<option name="useLength" value="false" />
</AnswerPlaceholder>
</list>
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="src/org/apache/beam/learning/katas/triggers/eventtimetriggers/Task.java" />
<option name="text" value="public class Task {&#10; //put your task here&#10;}" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="true" />
</TaskFile>
</value>
</entry>
<entry key="src/org/apache/beam/learning/katas/triggers/eventtimetriggers/GenerateEvent.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list />
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="src/org/apache/beam/learning/katas/triggers/eventtimetriggers/GenerateEvent.java" />
<option name="text" value="" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="true" />
</TaskFile>
</value>
</entry>
<entry key="test/org/apache/beam/learning/katas/triggers/eventtimetriggers/TaskTest.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list />
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="test/org/apache/beam/learning/katas/triggers/eventtimetriggers/TaskTest.java" />
<option name="text" value="import org.junit.Assert;&#10;import org.junit.Test;&#10;&#10;public class Tests {&#10; @Test&#10; public void testSolution() {&#10; // put your test here&#10; Assert.fail(&quot;Tests not implemented for the task&quot;);&#10; }&#10;}" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="false" />
</TaskFile>
</value>
</entry>
</map>
</option>
<option name="updateDate" value="1560923517000" />
</EduTask>
</list>
</option>
</Lesson>
<Lesson>
<option name="customPresentableName" />
<option name="id" value="237763" />
<option name="index" value="2" />
<option name="name" value="Early Triggers" />
<option name="stepikChangeStatus" value="Up to date" />
<option name="updateDate" value="1560923523075" />
<option name="unitId" value="210095" />
<option name="items">
<list>
<EduTask>
<option name="customPresentableName" />
<option name="descriptionFormat" value="HTML" />
<option name="descriptionText" value="&lt;!--&#10; ~ Licensed to the Apache Software Foundation (ASF) under one&#10; ~ or more contributor license agreements. See the NOTICE file&#10; ~ distributed with this work for additional information&#10; ~ regarding copyright ownership. The ASF licenses this file&#10; ~ to you under the Apache License, Version 2.0 (the&#10; ~ &quot;License&quot;); you may not use this file except in compliance&#10; ~ with the License. You may obtain a copy of the License at&#10; ~&#10; ~ http://www.apache.org/licenses/LICENSE-2.0&#10; ~&#10; ~ Unless required by applicable law or agreed to in writing, software&#10; ~ distributed under the License is distributed on an &quot;AS IS&quot; BASIS,&#10; ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&#10; ~ See the License for the specific language governing permissions and&#10; ~ limitations under the License.&#10; --&gt;&#10;&#10;&lt;html&gt;&#10;&lt;h2&gt;Early Triggers&lt;/h2&gt;&#10;&lt;p&gt;&#10; Triggers allow Beam to emit early results, before all the data in a given window has arrived.&#10; For example, emitting after a certain amount of time elapses, or after a certain number of&#10; elements arrives.&#10;&lt;/p&gt;&#10;&lt;p&gt;&#10; &lt;b&gt;Kata:&lt;/b&gt; Given that events are being generated every second and a fixed window of 1-day&#10; duration, please implement an early trigger that emits the number of events count immediately&#10; after new element is processed.&#10;&lt;/p&gt;&#10;&lt;br&gt;&#10;&lt;div class=&quot;hint&quot;&gt;&#10; Use &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/windowing/AfterWatermark.AfterWatermarkEarlyAndLate.html#withEarlyFirings-org.apache.beam.sdk.transforms.windowing.Trigger.OnceTrigger-&quot;&gt;&#10; withEarlyFirings&lt;/a&gt; to set early firing triggers.&#10;&lt;/div&gt;&#10;&lt;div class=&quot;hint&quot;&gt;&#10; Use &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/windowing/FixedWindows.html&quot;&gt;&#10; FixedWindows&lt;/a&gt; with 1-day duration using&#10; &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/windowing/AfterWatermark.html#pastEndOfWindow--&quot;&gt;&#10; AfterWatermark.pastEndOfWindow()&lt;/a&gt; trigger.&#10;&lt;/div&gt;&#10;&lt;div class=&quot;hint&quot;&gt;&#10; Set the &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/windowing/Window.html#withAllowedLateness-org.joda.time.Duration-&quot;&gt;&#10; allowed lateness&lt;/a&gt; to 0 with&#10; &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/windowing/Window.html#discardingFiredPanes--&quot;&gt;&#10; discarding accumulation mode&lt;/a&gt;.&#10;&lt;/div&gt;&#10;&lt;div class=&quot;hint&quot;&gt;&#10; Use &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/Combine.html#globally-org.apache.beam.sdk.transforms.CombineFnBase.GlobalCombineFn-&quot;&gt;&#10; Combine.globally&lt;/a&gt; and&#10; &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/Count.html#combineFn--&quot;&gt;&#10; Count.combineFn&lt;/a&gt; to calculate the count of events.&#10;&lt;/div&gt;&#10;&lt;div class=&quot;hint&quot;&gt;&#10; Refer to the Beam Programming Guide&#10; &lt;a href=&quot;https://beam.apache.org/documentation/programming-guide/#event-time-triggers&quot;&gt;&#10; &quot;Event time triggers&quot;&lt;/a&gt; section for more information.&#10;&lt;/div&gt;&#10;&lt;/html&gt;" />
<option name="feedbackLink">
<FeedbackLink>
<option name="link" />
<option name="type" value="STEPIK" />
</FeedbackLink>
</option>
<option name="id" value="753146" />
<option name="index" value="1" />
<option name="name" value="Early Triggers" />
<option name="record" value="-1" />
<option name="status" value="Unchecked" />
<option name="stepikChangeStatus" value="Up to date" />
<option name="files">
<map>
<entry key="resources/log4j2.xml">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list />
</option>
<option name="highlightErrors" value="false" />
<option name="name" value="resources/log4j2.xml" />
<option name="text" value="" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="true" />
</TaskFile>
</value>
</entry>
<entry key="src/org/apache/beam/learning/katas/triggers/earlytriggers/GenerateEvent.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list />
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="src/org/apache/beam/learning/katas/triggers/earlytriggers/GenerateEvent.java" />
<option name="text" value="" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="true" />
</TaskFile>
</value>
</entry>
<entry key="src/org/apache/beam/learning/katas/triggers/earlytriggers/Task.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list>
<AnswerPlaceholder>
<option name="hints">
<list />
</option>
<option name="index" value="0" />
<option name="initialState" />
<option name="initializedFromDependency" value="false" />
<option name="length" value="6" />
<option name="offset" value="1970" />
<option name="placeholderDependency" />
<option name="placeholderText" value="TODO()" />
<option name="possibleAnswer" value="events&#10; .apply(&#10; Window.&lt;String&gt;into(FixedWindows.of(Duration.standardDays(1)))&#10; .triggering(&#10; AfterWatermark.pastEndOfWindow()&#10; .withEarlyFirings(&#10; AfterProcessingTime.pastFirstElementInPane()))&#10; .withAllowedLateness(Duration.ZERO)&#10; .discardingFiredPanes())&#10;&#10; .apply(Combine.globally(Count.&lt;String&gt;combineFn()).withoutDefaults())" />
<option name="selected" value="false" />
<option name="status" value="Unchecked" />
<option name="studentAnswer" />
<option name="useLength" value="false" />
</AnswerPlaceholder>
</list>
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="src/org/apache/beam/learning/katas/triggers/earlytriggers/Task.java" />
<option name="text" value="public class Task {&#10; //put your task here&#10;}" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="true" />
</TaskFile>
</value>
</entry>
<entry key="test/org/apache/beam/learning/katas/triggers/earlytriggers/TaskTest.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list />
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="test/org/apache/beam/learning/katas/triggers/earlytriggers/TaskTest.java" />
<option name="text" value="import org.junit.Assert;&#10;import org.junit.Test;&#10;&#10;public class Tests {&#10; @Test&#10; public void testSolution() {&#10; // put your test here&#10; Assert.fail(&quot;Tests not implemented for the task&quot;);&#10; }&#10;}" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="false" />
</TaskFile>
</value>
</entry>
</map>
</option>
<option name="updateDate" value="1560923531000" />
</EduTask>
</list>
</option>
</Lesson>
<Lesson>
<option name="customPresentableName" />
<option name="id" value="237764" />
<option name="index" value="3" />
<option name="name" value="Window Accumulation Mode" />
<option name="stepikChangeStatus" value="Up to date" />
<option name="updateDate" value="1560923537697" />
<option name="unitId" value="210096" />
<option name="items">
<list>
<EduTask>
<option name="customPresentableName" />
<option name="descriptionFormat" value="HTML" />
<option name="descriptionText" value="&lt;!--&#10; ~ Licensed to the Apache Software Foundation (ASF) under one&#10; ~ or more contributor license agreements. See the NOTICE file&#10; ~ distributed with this work for additional information&#10; ~ regarding copyright ownership. The ASF licenses this file&#10; ~ to you under the Apache License, Version 2.0 (the&#10; ~ &quot;License&quot;); you may not use this file except in compliance&#10; ~ with the License. You may obtain a copy of the License at&#10; ~&#10; ~ http://www.apache.org/licenses/LICENSE-2.0&#10; ~&#10; ~ Unless required by applicable law or agreed to in writing, software&#10; ~ distributed under the License is distributed on an &quot;AS IS&quot; BASIS,&#10; ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&#10; ~ See the License for the specific language governing permissions and&#10; ~ limitations under the License.&#10; --&gt;&#10;&#10;&lt;html&gt;&#10;&lt;h2&gt;Window Accumulation Mode&lt;/h2&gt;&#10;&lt;p&gt;&#10; When you specify a trigger, you must also set the the window’s accumulation mode. When a trigger&#10; fires, it emits the current contents of the window as a pane. Since a trigger can fire multiple&#10; times, the accumulation mode determines whether the system accumulates the window panes as the&#10; trigger fires, or discards them.&#10;&lt;/p&gt;&#10;&lt;p&gt;&#10; &lt;b&gt;Kata:&lt;/b&gt; Given that events are being generated every second and a fixed window of 1-day&#10; duration, please implement an early trigger that emits the number of events count immediately&#10; after new element is processed in accumulating mode.&#10;&lt;/p&gt;&#10;&lt;br&gt;&#10;&lt;div class=&quot;hint&quot;&gt;&#10; Use &lt;a href=&quot;https://beam.apache.org/releases/javadoc/2.13.0/org/apache/beam/sdk/transforms/windowing/Window.html#accumulatingFiredPanes--&quot;&gt;&#10; accumulatingFiredPanes()&lt;/a&gt; to set a window to accumulate the panes that are produced when the&#10; trigger fires.&#10;&lt;/div&gt;&#10;&lt;div class=&quot;hint&quot;&gt;&#10; Use &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/windowing/AfterWatermark.AfterWatermarkEarlyAndLate.html#withEarlyFirings-org.apache.beam.sdk.transforms.windowing.Trigger.OnceTrigger-&quot;&gt;&#10; withEarlyFirings&lt;/a&gt; to set early firing triggers.&#10;&lt;/div&gt;&#10;&lt;div class=&quot;hint&quot;&gt;&#10; Use &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/windowing/FixedWindows.html&quot;&gt;&#10; FixedWindows&lt;/a&gt; with 1-day duration using&#10; &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/windowing/AfterWatermark.html#pastEndOfWindow--&quot;&gt;&#10; AfterWatermark.pastEndOfWindow()&lt;/a&gt; trigger.&#10;&lt;/div&gt;&#10;&lt;div class=&quot;hint&quot;&gt;&#10; Set the &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/windowing/Window.html#withAllowedLateness-org.joda.time.Duration-&quot;&gt;&#10; allowed lateness&lt;/a&gt; to 0.&#10;&lt;/div&gt;&#10;&lt;div class=&quot;hint&quot;&gt;&#10; Use &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/Combine.html#globally-org.apache.beam.sdk.transforms.CombineFnBase.GlobalCombineFn-&quot;&gt;&#10; Combine.globally&lt;/a&gt; and&#10; &lt;a href=&quot;https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/transforms/Count.html#combineFn--&quot;&gt;&#10; Count.combineFn&lt;/a&gt; to calculate the count of events.&#10;&lt;/div&gt;&#10;&lt;div class=&quot;hint&quot;&gt;&#10; Refer to the Beam Programming Guide&#10; &lt;a href=&quot;https://beam.apache.org/documentation/programming-guide/#event-time-triggers&quot;&gt;&#10; &quot;Event time triggers&quot;&lt;/a&gt; section for more information.&#10;&lt;/div&gt;&#10;&lt;/html&gt;&#10;" />
<option name="feedbackLink">
<FeedbackLink>
<option name="link" />
<option name="type" value="STEPIK" />
</FeedbackLink>
</option>
<option name="id" value="753147" />
<option name="index" value="1" />
<option name="name" value="Window Accumulation Mode" />
<option name="record" value="-1" />
<option name="status" value="Unchecked" />
<option name="stepikChangeStatus" value="Up to date" />
<option name="files">
<map>
<entry key="src/org/apache/beam/learning/katas/triggers/windowaccummode/GenerateEvent.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list />
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="src/org/apache/beam/learning/katas/triggers/windowaccummode/GenerateEvent.java" />
<option name="text" value="" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="true" />
</TaskFile>
</value>
</entry>
<entry key="src/org/apache/beam/learning/katas/triggers/windowaccummode/Task.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list>
<AnswerPlaceholder>
<option name="hints">
<list />
</option>
<option name="index" value="0" />
<option name="initialState" />
<option name="initializedFromDependency" value="false" />
<option name="length" value="6" />
<option name="offset" value="1972" />
<option name="placeholderDependency" />
<option name="placeholderText" value="TODO()" />
<option name="possibleAnswer" value="events&#10; .apply(&#10; Window.&lt;String&gt;into(FixedWindows.of(Duration.standardDays(1)))&#10; .triggering(&#10; AfterWatermark.pastEndOfWindow()&#10; .withEarlyFirings(&#10; AfterProcessingTime.pastFirstElementInPane()))&#10; .withAllowedLateness(Duration.ZERO)&#10; .accumulatingFiredPanes())&#10;&#10; .apply(Combine.globally(Count.&lt;String&gt;combineFn()).withoutDefaults())" />
<option name="selected" value="false" />
<option name="status" value="Unchecked" />
<option name="studentAnswer" />
<option name="useLength" value="false" />
</AnswerPlaceholder>
</list>
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="src/org/apache/beam/learning/katas/triggers/windowaccummode/Task.java" />
<option name="text" value="public class Task {&#10; //put your task here&#10;}" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="true" />
</TaskFile>
</value>
</entry>
<entry key="test/org/apache/beam/learning/katas/triggers/windowaccummode/TaskTest.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list />
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="test/org/apache/beam/learning/katas/triggers/windowaccummode/TaskTest.java" />
<option name="text" value="import org.junit.Assert;&#10;import org.junit.Test;&#10;&#10;public class Tests {&#10; @Test&#10; public void testSolution() {&#10; // put your test here&#10; Assert.fail(&quot;Tests not implemented for the task&quot;);&#10; }&#10;}" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="false" />
</TaskFile>
</value>
</entry>
</map>
</option>
<option name="updateDate" value="1560923544000" />
</EduTask>
</list>
</option>
</Lesson>
</list>
</option>
</Section>
<Section>
<option name="courseId" value="54530" />
<option name="customPresentableName" />
<option name="id" value="85642" />
<option name="index" value="7" />
<option name="name" value="Examples" />
<option name="position" value="7" />
<option name="stepikChangeStatus" value="Up to date" />
<option name="updateDate" value="1557824624000" />
<option name="items">
<list>
<Lesson>
<option name="customPresentableName" />
<option name="id" value="229515" />
<option name="index" value="1" />
<option name="name" value="Word Count" />
<option name="stepikChangeStatus" value="Content changed" />
<option name="updateDate" value="1557824624000" />
<option name="unitId" value="202040" />
<option name="items">
<list>
<EduTask>
<option name="customPresentableName" />
<option name="descriptionFormat" value="HTML" />
<option name="descriptionText" value="&lt;!--&#10; ~ Licensed to the Apache Software Foundation (ASF) under one&#10; ~ or more contributor license agreements. See the NOTICE file&#10; ~ distributed with this work for additional information&#10; ~ regarding copyright ownership. The ASF licenses this file&#10; ~ to you under the Apache License, Version 2.0 (the&#10; ~ &quot;License&quot;); you may not use this file except in compliance&#10; ~ with the License. You may obtain a copy of the License at&#10; ~&#10; ~ http://www.apache.org/licenses/LICENSE-2.0&#10; ~&#10; ~ Unless required by applicable law or agreed to in writing, software&#10; ~ distributed under the License is distributed on an &quot;AS IS&quot; BASIS,&#10; ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&#10; ~ See the License for the specific language governing permissions and&#10; ~ limitations under the License.&#10; --&gt;&#10;&#10;&lt;html&gt;&#10;&lt;h2&gt;Word Count Pipeline&lt;/h2&gt;&#10;&lt;p&gt;&#10; &lt;b&gt;Kata:&lt;/b&gt; Create a pipeline that counts the number of words.&#10;&lt;/p&gt;&#10;&lt;p&gt;&#10; Please output the count of each word in the following format:&#10;&lt;/p&gt;&#10;&lt;pre&gt;&#10; word:count&#10; ball:5&#10; book:3&#10;&lt;/pre&gt;&#10;&lt;br&gt;&#10;&lt;div class=&quot;hint&quot;&gt;&#10; Refer to your katas above.&#10;&lt;/div&gt;&#10;&lt;/html&gt;&#10;" />
<option name="feedbackLink">
<FeedbackLink>
<option name="link" />
<option name="type" value="STEPIK" />
</FeedbackLink>
</option>
<option name="id" value="713743" />
<option name="index" value="1" />
<option name="name" value="Word Count" />
<option name="record" value="-1" />
<option name="status" value="Unchecked" />
<option name="stepikChangeStatus" value="Info and Content changed" />
<option name="files">
<map>
<entry key="src/org/apache/beam/learning/katas/examples/wordcount/Task.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list>
<AnswerPlaceholder>
<option name="hints">
<list />
</option>
<option name="index" value="0" />
<option name="initialState" />
<option name="initializedFromDependency" value="false" />
<option name="length" value="6" />
<option name="offset" value="2075" />
<option name="placeholderDependency" />
<option name="placeholderText" value="TODO()" />
<option name="possibleAnswer" value="input&#10;&#10; .apply(FlatMapElements.into(TypeDescriptors.strings())&#10; .via(line -&gt; Arrays.asList(line.split(&quot; &quot;))))&#10;&#10; .apply(Count.perElement())&#10;&#10; .apply(ParDo.of(new DoFn&lt;KV&lt;String, Long&gt;, String&gt;() {&#10;&#10; @ProcessElement&#10; public void processElement(&#10; @Element KV&lt;String, Long&gt; element, OutputReceiver&lt;String&gt; out) {&#10;&#10; out.output(element.getKey() + &quot;:&quot; + element.getValue());&#10; }&#10;&#10; }))" />
<option name="selected" value="false" />
<option name="status" value="Unchecked" />
<option name="studentAnswer" />
<option name="useLength" value="false" />
</AnswerPlaceholder>
</list>
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="src/org/apache/beam/learning/katas/examples/wordcount/Task.java" />
<option name="text" value="class Task {&#10; //put your task here&#10;}" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="true" />
</TaskFile>
</value>
</entry>
<entry key="test/org/apache/beam/learning/katas/examples/wordcount/TaskTest.java">
<value>
<TaskFile>
<option name="answerPlaceholders">
<list />
</option>
<option name="highlightErrors" value="true" />
<option name="name" value="test/org/apache/beam/learning/katas/examples/wordcount/TaskTest.java" />
<option name="text" value="public class Test {&#10; // put your test here&#10;}" />
<option name="trackChanges" value="true" />
<option name="trackLengths" value="true" />
<option name="visible" value="false" />
</TaskFile>
</value>
</entry>
</map>
</option>
<option name="updateDate" value="1560936261000" />
</EduTask>
</list>
</option>
</Lesson>
</list>
</option>
</Section>
</list>
</option>
</EduCourse>
</option>
</StudyTaskManager>
</component>
</project>