Github user StephanEwen commented on the pull request:
https://github.com/apache/flink/pull/1115#issuecomment-141041498
You are right, in those drivers, it is handled in the wrong way. Probably
an artifact from the time before the `MultableObjectIterator` had both variants
of the `next()` method. It used to have only the reusing variant.
Clearly, this should be fixed.
Here is the guide that I try to follow when working with the mutable
objects:
- All `MultableObjectIterator`s have two variants of the `next()` method
- one for reuse, one without.
- The variant without reuse it crucial, as not every situation can work
with object reuse.
- The variant with reuse is optional, but should be implemented where
possible for performance.
- The task drivers (AllReduceDriver, ...) or algorithms (sorter / hasher)
know whether they want to work with reuse or not, and call the respective
method in that case.
---
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.
---