[ 
https://issues.apache.org/jira/browse/BEAM-10164?focusedWorklogId=440750&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-440750
 ]

ASF GitHub Bot logged work on BEAM-10164:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 03/Jun/20 12:29
            Start Date: 03/Jun/20 12:29
    Worklog Time Spent: 10m 
      Work Description: dmvk commented on a change in pull request #11889:
URL: https://github.com/apache/beam/pull/11889#discussion_r434528990



##########
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:
       I agree that the benefit is discutable. 
   
   Personally I find it helpful when it comes to long methods or trying to 
understand someone elses code, that you see that there would be no more 
assignents to the variable (if there is no final modifier, you know that there 
is something more going on).
   
   Anyway, it's more of a personal taste. Do you want me to revert these?




----------------------------------------------------------------
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: 440750)
    Time Spent: 1h  (was: 50m)

> 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
>  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)

Reply via email to