flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fhueske <...@git.apache.org>
Subject [GitHub] flink pull request #3912: [FLINK-6589] [core] Deserialize ArrayList with cap...
Date Mon, 15 May 2017 22:20:23 GMT
GitHub user fhueske opened a pull request:


    [FLINK-6589] [core] Deserialize ArrayList with capacity of size+1 to prevent growth.

    Several Table API / SQL operators hold records in a `MapState[Long, List[X]]` keyed on
a timestamp.
    When a new record arrives, the corresponding list is fetched and the record is added to
the list. 
    Currently, the `ListSerializer` deserializes lists as `ArrayList` with capacity exactly
equal to the number of serialized elements. Hence, the `ArrayList` will grow when a new element
is added which is an expensive operation.
    This PR changes the capacity of the deserialized `ArrayList` to #elements + 1 to avoid
the growing the list when a single element is added.

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

    $ git pull https://github.com/fhueske/flink listSer

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


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

    This closes #3912
commit 1fa86b4e282ab0594d8dc768840de4c798e29591
Author: Fabian Hueske <fhueske@apache.org>
Date:   2017-05-15T19:41:51Z

    [FLINK-6589] [core] Deserialize ArrayList with capacity of size+1 to prevent growth.


If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.

View raw message