This is an automated email from the ASF dual-hosted git repository. domgarguilo pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/accumulo-website.git
The following commit(s) were added to refs/heads/main by this push: new 0d3904b0 Fix Iterator Teardown documentation (#383) 0d3904b0 is described below commit 0d3904b0c3b4eb839bb59158946d9068fba7ef53 Author: Dom G <domgargu...@apache.org> AuthorDate: Mon Apr 17 12:29:59 2023 -0400 Fix Iterator Teardown documentation (#383) Co-authored-by: Jeffrey Manno <jeffreymann...@gmail.com> --- _docs-2/development/iterators.md | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/_docs-2/development/iterators.md b/_docs-2/development/iterators.md index 54808482..f557ab59 100644 --- a/_docs-2/development/iterators.md +++ b/_docs-2/development/iterators.md @@ -408,12 +408,16 @@ On an instance of an Iterator: `init` is always called before `seek`, `seek` is ### Teardown -As mentioned, instance of Iterators may be torn down inside of the server transparently. When a complex -collection of iterators is performing some advanced functionality, they will not be torn down until a Key-Value -pair is returned out of the "stack" of Iterators (and added into the batch of Key-Values to be returned -to the caller). Being torn-down is equivalent to a new instance of the Iterator being creating and `deepCopy` -being called on the new instance with the old instance provided as the argument to `deepCopy`. References -to the old instance are removed and the object is lazily garbage collected by the JVM. +Instances of iterators may be torn down inside the server transparently. When a complex collection +of iterators is performing advanced functionality, they will not be torn down until a Key-Value pair +is returned out of the "stack" of iterators (and added into the batch of Key-Values to be returned +to the caller), or the iterator is yielded. + +When an iterator is torn down, the entire stack is dropped and no state is preserved. Only the last +key returned (or the yielded position), original options, and seek range are retained. When the scan +is continued, the iterator stack is rebuilt and re-initialized using the original options. The stack +is then seeked with the original range, and the start key is replaced by the last key returned (or +the yielded position), non-inclusive. ## Compaction-time Iterators