sirenbyte commented on code in PR #25301:
URL: https://github.com/apache/beam/pull/25301#discussion_r1150275665


##########
learning/tour-of-beam/learning-content/IO/text-io/text-io-local-read/description.md:
##########
@@ -0,0 +1,84 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+### TextIO local file
+
+Apache Beam is a programming model for data processing pipelines that can be 
executed on a variety of runtime environments, including **Apache Flink**, 
**Apache Spark**, and **Google Cloud Dataflow**. The `TextIO` class in Apache 
Beam provides a way to read and write text files in a pipeline. To read a local 
file using TextIO, you can use the Read method and pass in the file path as a 
string. Here is an example of reading a local text file named "**myfile.txt**" 
and printing its contents:

Review Comment:
   Done



##########
learning/tour-of-beam/learning-content/IO/kafka-io/kafka-read/description.md:
##########
@@ -0,0 +1,60 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+### KafkaIO
+
+KafkaIO is a part of the Apache Beam SDK that provides a way to read data from 
Apache Kafka and write data to it. It allows for the creation of Beam pipelines 
that can consume data from a Kafka topic, process the data and write the 
processed data back to another Kafka topic. This makes it possible to build 
data processing pipelines using Apache Beam that can easily integrate with a 
Kafka-based data architecture.
+
+{{if (eq .Sdk "go")}}
+```
+var (
+       expansionAddr = flag.String("expansion_addr", "",
+               "Address of Expansion Service. If not specified, attempts to 
automatically start an appropriate expansion service.")
+       bootstrapServers = flag.String("bootstrap_servers", "",
+               "(Required) URL of the bootstrap servers for the Kafka cluster. 
Should be accessible by the runner.")
+       topic = flag.String("topic", "kafka_taxirides_realtime", "Kafka topic 
to write to and read from.")
+)
+
+read := kafkaio.Read(s, *expansionAddr, *bootstrapServers, []string{*topic})
+```
+{{end}}

Review Comment:
   Done



##########
learning/tour-of-beam/learning-content/IO/kafka-io/kafka-read/description.md:
##########
@@ -0,0 +1,60 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+### KafkaIO
+
+KafkaIO is a part of the Apache Beam SDK that provides a way to read data from 
Apache Kafka and write data to it. It allows for the creation of Beam pipelines 
that can consume data from a Kafka topic, process the data and write the 
processed data back to another Kafka topic. This makes it possible to build 
data processing pipelines using Apache Beam that can easily integrate with a 
Kafka-based data architecture.
+
+{{if (eq .Sdk "go")}}
+```
+var (
+       expansionAddr = flag.String("expansion_addr", "",
+               "Address of Expansion Service. If not specified, attempts to 
automatically start an appropriate expansion service.")
+       bootstrapServers = flag.String("bootstrap_servers", "",
+               "(Required) URL of the bootstrap servers for the Kafka cluster. 
Should be accessible by the runner.")
+       topic = flag.String("topic", "kafka_taxirides_realtime", "Kafka topic 
to write to and read from.")
+)
+
+read := kafkaio.Read(s, *expansionAddr, *bootstrapServers, []string{*topic})
+```
+{{end}}
+
+{{if (eq .Sdk "java")}}
+```
+p.apply("ReadFromKafka",
+                        KafkaIO.<String, String>read()
+                                .withBootstrapServers("localhost:29092")
+                                .withTopicPartitions(
+                                        Collections.singletonList(
+                                                new TopicPartition(
+                                                        "NYCTaxi1000_simple",
+                                .withKeyDeserializer(StringDeserializer.class)
+                                
.withValueDeserializer(StringDeserializer.class)
+                                .withConsumerConfigUpdates(consumerConfig)
+                                .withMaxNumRecords(998)
+                                .withoutMetadata())
+```
+{{end}}

Review Comment:
   Done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to