Return-Path: Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: (qmail 61062 invoked from network); 19 Sep 2008 13:05:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 19 Sep 2008 13:05:36 -0000 Received: (qmail 61806 invoked by uid 500); 19 Sep 2008 13:05:32 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 61779 invoked by uid 500); 19 Sep 2008 13:05:32 -0000 Mailing-List: contact dev-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list dev@jackrabbit.apache.org Received: (qmail 61768 invoked by uid 99); 19 Sep 2008 13:05:32 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Sep 2008 06:05:32 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Sep 2008 13:04:41 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 63DD0234C1DB for ; Fri, 19 Sep 2008 06:04:44 -0700 (PDT) Message-ID: <1396757580.1221829484407.JavaMail.jira@brutus> Date: Fri, 19 Sep 2008 06:04:44 -0700 (PDT) From: "Sergey Nebolsin (JIRA)" To: dev@jackrabbit.apache.org Subject: [jira] Commented: (JCR-1740) Make ObjectIterator implement RangeIterator interface In-Reply-To: <1217993331.1221723584294.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/JCR-1740?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12632668#action_12632668 ] Sergey Nebolsin commented on JCR-1740: -------------------------------------- Hmm, trying to implement this feature correctly and writing the unit test for it, I discovered that the problem is not so simple. And the problem is: ObjectIterator just skips nodes from query result which it cannot convert to objects. And we cannot determine if node is convertible without actually retrieving this node and trying to convert it. So we cannot determine result's size and cannot implement skip() method cheaply. Two possible solutions: 1. Make ObjectIterator throw an exception if node is not convertible and add "@ocm_classname" clause to every query to ensure that query will return only nodes which are saved with OCM. 2. Leave things as they are but describe inconsistent behavior in the javadocs for skip(), getSize() and getPosition() methods if there are nonconvertible nodes in the query result I prefer option 1, since this behavior is consistent, and I believe that nonconvertible nodes in the query results means "error in the query" in 99,9% cases, and the user should be notified about this error more strongly than just log at info level. > Make ObjectIterator implement RangeIterator interface > ----------------------------------------------------- > > Key: JCR-1740 > URL: https://issues.apache.org/jira/browse/JCR-1740 > Project: Jackrabbit > Issue Type: Improvement > Components: jackrabbit-ocm > Affects Versions: 1.4 > Environment: All environments > Reporter: Sergey Nebolsin > Priority: Minor > Fix For: 1.5 > > Attachments: JCR-1740.patch > > > Currently, it's not possible to skip a part of results returned in the form of ObjectIterator (for example, to implement db-like pagination feature with offset/max parameters). > It would be great if ObjectIterator implement RangeIterator interface, and it's trivial enough since underlying NodeIterator implements this interface. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.