beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (BEAM-703) SingletonViewFn might exhaust defaultValue if it's serialized after being used.
Date Tue, 04 Oct 2016 15:32:20 GMT

    [ https://issues.apache.org/jira/browse/BEAM-703?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15545665#comment-15545665
] 

ASF GitHub Bot commented on BEAM-703:
-------------------------------------

GitHub user amitsela opened a pull request:

    https://github.com/apache/incubator-beam/pull/1040

    [BEAM-703] SingletonViewFn might exhaust defaultValue if it's serialized after being used.

    Be sure to do all of the following to help us incorporate your contribution
    quickly and easily:
    
     - [ ] Make sure the PR title is formatted like:
       `[BEAM-<Jira issue #>] Description of pull request`
     - [ ] Make sure tests pass via `mvn clean verify`. (Even better, enable
           Travis-CI on your fork and ensure the whole test matrix passes).
     - [ ] Replace `<Jira issue #>` in the title with the actual Jira issue
           number, if there is one.
     - [ ] If this contribution is large, please file an Apache
           [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.txt).
    
    ---
    


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/amitsela/incubator-beam BEAM-703

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-beam/pull/1040.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1040
    
----
commit 0bd97efc0d764af17cdd8abdf43bff33bb21be2b
Author: Sela <ansela@paypal.com>
Date:   2016-10-04T15:12:38Z

    Avoid losing the encoded defaultValue.

----


> SingletonViewFn might exhaust defaultValue if it's serialized after being used. 
> --------------------------------------------------------------------------------
>
>                 Key: BEAM-703
>                 URL: https://issues.apache.org/jira/browse/BEAM-703
>             Project: Beam
>          Issue Type: Bug
>          Components: sdk-java-core
>            Reporter: Amit Sela
>            Assignee: Amit Sela
>            Priority: Minor
>
> In https://github.com/apache/incubator-beam/blob/master/sdks/java/core/src/main/java/org/apache/beam/sdk/util/PCollectionViews.java#L267
the defaultValue is set to null to avoid decoding over and over I assume.
> If the defaultValue is accessed before the the SingletonViewFn is serialized, it will
exhaust the encoded value (assigned with null) while losing the transient decoded value.
> It'd probably be best to simply check if defaultValue is null before decoding, so that
decode will still happen just once, but the encoded data is not lost. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message