[
https://issues.apache.org/jira/browse/BEAM-11172?focusedWorklogId=510042&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-510042
]
ASF GitHub Bot logged work on BEAM-11172:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 11/Nov/20 01:15
Start Date: 11/Nov/20 01:15
Worklog Time Spent: 10m
Work Description: boyuanzz commented on a change in pull request #13282:
URL: https://github.com/apache/beam/pull/13282#discussion_r520985187
##########
File path:
sdks/java/io/kafka/src/test/java/org/apache/beam/sdk/io/kafka/KafkaIOIT.java
##########
@@ -115,6 +122,43 @@ public static void setup() throws IOException {
.get();
}
+ @Test
+ public void testKafkaIOWithRunnerV2() throws IOException {
+ writePipeline
+ .apply("Generate records", Read.from(new
SyntheticBoundedSource(sourceOptions)))
+ .apply("Measure write time", ParDo.of(new TimeMonitor<>(NAMESPACE,
WRITE_TIME_METRIC_NAME)))
+ .apply("Write to Kafka", writeToKafka());
+
+ readPipeline.getOptions().as(Options.class).setStreaming(true);
+ PCollection<Integer> elementCount =
+ readPipeline
+ .apply("Read from Runner V2 Kafka", readFromKafka())
+ .apply(
+ "Measure read time", ParDo.of(new TimeMonitor<>(NAMESPACE,
READ_TIME_METRIC_NAME)))
+ .apply("Map records to strings", MapElements.via(new
MapKafkaRecordsToStrings()))
+ .apply(
+ "Keyed by empty key",
+ MapElements.into(new TypeDescriptor<KV<byte[], String>>() {})
+ .via(element -> KV.of(new byte[0], element)))
+ .apply(
+ "Counting elements", ParDo.of(new
CountingElementFn(options.getNumberOfRecords())));
Review comment:
Yes, counter works as well. I think we can use existing element counter
as well.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 510042)
Time Spent: 3h 10m (was: 3h)
> Set up Java Kafka performance test with runner v2
> -------------------------------------------------
>
> Key: BEAM-11172
> URL: https://issues.apache.org/jira/browse/BEAM-11172
> Project: Beam
> Issue Type: Test
> Components: io-java-kafka, testing
> Reporter: Boyuan Zhang
> Assignee: Boyuan Zhang
> Priority: P2
> Time Spent: 3h 10m
> Remaining Estimate: 0h
>
> Currently we have KafkaIO performance test with dataflow batch java
> production worker. We want to test it with runner v2 + SDF implementation in
> streaming as well.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)