[
https://issues.apache.org/jira/browse/BEAM-10164?focusedWorklogId=440771&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-440771
]
ASF GitHub Bot logged work on BEAM-10164:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 03/Jun/20 13:33
Start Date: 03/Jun/20 13:33
Worklog Time Spent: 10m
Work Description: mxm commented on a change in pull request #11889:
URL: https://github.com/apache/beam/pull/11889#discussion_r434568958
##########
File path:
runners/flink/src/main/java/org/apache/beam/runners/flink/FlinkBatchTransformTranslators.java
##########
@@ -476,16 +476,15 @@ public void translateNode(
public void translateNode(
PTransform<PCollection<KV<K, InputT>>, PCollection<KV<K, OutputT>>>
transform,
FlinkBatchTranslationContext context) {
- DataSet<WindowedValue<KV<K, InputT>>> inputDataSet =
+ final DataSet<WindowedValue<KV<K, InputT>>> inputDataSet =
context.getInputDataSet(context.getInput(transform));
-
- CombineFnBase.GlobalCombineFn<InputT, AccumT, OutputT> combineFn =
- ((Combine.PerKey) transform).getFn();
-
- KvCoder<K, InputT> inputCoder = (KvCoder<K, InputT>)
context.getInput(transform).getCoder();
-
- Coder<AccumT> accumulatorCoder;
-
+ final Combine.PerKey<K, InputT, OutputT> combineTransform =
+ (Combine.PerKey<K, InputT, OutputT>) transform;
+ final CombineFnBase.GlobalCombineFn<InputT, AccumT, OutputT> combineFn =
+ (CombineFnBase.GlobalCombineFn<InputT, AccumT, OutputT>)
combineTransform.getFn();
+ final KvCoder<K, InputT> inputCoder =
+ (KvCoder<K, InputT>) context.getInput(transform).getCoder();
+ final Coder<AccumT> accumulatorCoder;
Review comment:
Yes, it depends on the situation. I use `final` mostly when there is a
clear assign-once relationship with commonly used types. Since
type-parameterized types are used here, there is very little chance of
accidentally overwriting a ref.
Just a discussion point. No need to revert.
----------------------------------------------------------------
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: 440771)
Time Spent: 1h 10m (was: 1h)
> Flink: Memory efficient combine implementation for batch runner
> ---------------------------------------------------------------
>
> Key: BEAM-10164
> URL: https://issues.apache.org/jira/browse/BEAM-10164
> Project: Beam
> Issue Type: Bug
> Components: runner-flink
> Reporter: David Morávek
> Assignee: David Morávek
> Priority: P2
> Time Spent: 1h 10m
> Remaining Estimate: 0h
>
> Current Combine implementation assumes that all input values for a single key
> (on both map and reduce side) fit in memory as it needs to sort them by
> window before combining.
> We can easily optimize this for non-merging windows by pre-grouping elements
> by (K, W) tuples.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)