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

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

                Author: ASF GitHub Bot
            Created on: 13/May/19 20:56
            Start Date: 13/May/19 20:56
    Worklog Time Spent: 10m 
      Work Description: mxm commented on pull request #8472: [BEAM-7126] Remove 
duplicate key encoding for state backend
URL: https://github.com/apache/beam/pull/8472#discussion_r283524906
 
 

 ##########
 File path: 
runners/flink/src/main/java/org/apache/beam/runners/flink/FlinkStreamingPortablePipelineTranslator.java
 ##########
 @@ -736,6 +737,11 @@ private void translateStreamingImpulse(
                 valueCoder.getClass().getSimpleName()));
       }
       keyCoder = ((KvCoder) valueCoder).getKeyCoder();
+      if (keyCoder instanceof LengthPrefixCoder) {
+        // Remove any unnecessary length prefixes which add more payload
+        // but also are not expected for state requests inside the operator.
+        keyCoder = ((LengthPrefixCoder) keyCoder).getValueCoder();
 
 Review comment:
   The problem is that the `keyCoder` (extracted from the `KvCoder` above) is 
wrapped with a `LengthPrefixCoder`. This adds an unnecessary length prefix to 
the key and affects the partitioning of the keys. The state requests are served 
without the length prefix which requires us to either re-add it or remove it 
entirely (like we do here).
 
----------------------------------------------------------------
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: 241307)
    Time Spent: 1h 40m  (was: 1.5h)

> Double encoding of state keys in portable Flink runner
> ------------------------------------------------------
>
>                 Key: BEAM-7126
>                 URL: https://issues.apache.org/jira/browse/BEAM-7126
>             Project: Beam
>          Issue Type: Bug
>          Components: runner-flink
>    Affects Versions: 2.11.0
>            Reporter: Thomas Weise
>            Assignee: Maximilian Michels
>            Priority: Major
>              Labels: portability-flink
>          Time Spent: 1h 40m
>  Remaining Estimate: 0h
>
> State keys currently need to be encoded as NESTED. My attempt to use the 
> ByteString directly in BEAM-7112 caused checkpointing to fail. We should look 
> into eliminating the redundant key encoding and adjusting 
> StateRequestHandlers.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to