GitHub user fhueske opened a pull request:
https://github.com/apache/flink/pull/3912
[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:
https://github.com/apache/flink/pull/3912.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 #3912
----
commit 1fa86b4e282ab0594d8dc768840de4c798e29591
Author: Fabian Hueske <[email protected]>
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 [email protected] or file a JIRA ticket
with INFRA.
---