bhisevishal commented on code in PR #25540:
URL: https://github.com/apache/beam/pull/25540#discussion_r1110237976
##########
sdks/java/harness/src/main/java/org/apache/beam/fn/harness/data/PCollectionConsumerRegistry.java:
##########
@@ -352,7 +350,8 @@ public void accept(WindowedValue<T> input) throws Exception
{
// Use the ExecutionStateTracker and enter an appropriate state to track
the
// Process Bundle Execution time metric and also ensure user counters
can get an appropriate
// metrics container.
- for (ConsumerAndMetadata consumerAndMetadata : consumerAndMetadatas) {
+ for (int size = consumerAndMetadatas.size(), i = 0; i < size; ++i) {
Review Comment:
You may want to add comment here to avoid using `for (ConsumerAndMetadata
consumerAndMetadata : consumerAndMetadatas)`
##########
sdks/java/harness/src/main/java/org/apache/beam/fn/harness/data/PCollectionConsumerRegistry.java:
##########
@@ -209,8 +208,7 @@ public FnDataReceiver<WindowedValue<?>>
getMultiplexingConsumer(String pCollecti
come up in the existing SDF expansion, but might be useful to
support fused SDF nodes.
This would require dedicated delivery of the split results to each
of the consumers
separately. */
- return new MultiplexingMetricTrackingFnDataReceiver(
- pcId, coder, ImmutableList.copyOf(consumerAndMetadatas));
+ return new MultiplexingMetricTrackingFnDataReceiver(pcId, coder,
consumerAndMetadatas);
Review Comment:
This is good less copies of data.
--
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]