Github user dhutchis commented on the issue:
https://github.com/apache/accumulo/pull/159
> The problem I am running into is our underlying reuse of RFiles
throughout the code.
One solution you suggested is to make the RFile close() methods do nothing.
(Rename the current close() method or make MultiIterator's close() do nothing.)
Not very satisfying, but it could work.
Another solution is approach 2 + don't close the RFiles. It seems nicer to
me since it promotes inter-iterator isolation and doesn't break existing code.
I realized that the nice way of ordering the close() calls is in the reverse
order of the order that the iterators were constructed/init()ed.
> Retain the list of IterInfos from when Accumulo sets up the iterator
stack (see IteratorUtil.loadIterators()). Before Accumulo tears down the stack,
for any reason, call close() on each iterator individually, say starting from
the bottom iterator and working up toward the root RFile/InMemoryMap iterators.
This strategy would not break existing iterators; an iterator that does not
call close() on its source is fine since Accumulo would call it. It also
provides better iterator isolation.
With this approach, each iterator is only responsible for closing the
resources it itself opens. No need to consider other iterators. Seems more
palatable, don't you think?
---
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.
---