Return-Path: X-Original-To: apmail-accumulo-dev-archive@www.apache.org Delivered-To: apmail-accumulo-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D4ED817BB9 for ; Mon, 27 Apr 2015 17:35:27 +0000 (UTC) Received: (qmail 10525 invoked by uid 500); 27 Apr 2015 17:35:27 -0000 Delivered-To: apmail-accumulo-dev-archive@accumulo.apache.org Received: (qmail 10490 invoked by uid 500); 27 Apr 2015 17:35:27 -0000 Mailing-List: contact dev-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@accumulo.apache.org Delivered-To: mailing list dev@accumulo.apache.org Received: (qmail 10479 invoked by uid 99); 27 Apr 2015 17:35:27 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Apr 2015 17:35:27 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 3CB04E179A; Mon, 27 Apr 2015 17:35:27 +0000 (UTC) From: ohshazbot To: dev@accumulo.apache.org Reply-To: dev@accumulo.apache.org References: In-Reply-To: Subject: [GitHub] accumulo pull request: ACCUMULO-3646 Update iterator doc on entrie... Content-Type: text/plain Message-Id: <20150427173527.3CB04E179A@git1-us-west.apache.org> Date: Mon, 27 Apr 2015 17:35:27 +0000 (UTC) Github user ohshazbot commented on a diff in the pull request: https://github.com/apache/accumulo/pull/33#discussion_r29169794 --- Diff: docs/src/main/asciidoc/chapters/iterator_design.txt --- @@ -145,8 +146,16 @@ alter the internal state of the Iterator. These methods simply return the current Key-Value pair for this iterator. If `hasTop` returns true, both of these methods should return non-null objects. If `hasTop` returns false, it is undefined -what these methods should return. Multiple calls to these methods should not alter the state -of the Iterator like `hasTop`. +what these methods should return. Like `hasTop`, multiple calls to these methods should not alter +the state of the Iterator. + +When saving a Key or Value from a source iterator's `getTopKey` or `getTopValue` methods +for use after calling `next` on the source iterator (e.g., when cacheing keys or values +from the source iterator), it is important to copy the Key or Value into a new object +because the source iterator may reuse the Key or Value objects for performance reasons. --- End diff -- I don't like the verb use, as it's vague. I would prefer specifics - ..."which does not modify or cache the key beyond calling next()"... --- 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. ---