From dev-return-38350-apmail-directory-dev-archive=directory.apache.org@directory.apache.org Wed Jun 15 13:42:48 2011 Return-Path: X-Original-To: apmail-directory-dev-archive@www.apache.org Delivered-To: apmail-directory-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 6A2844027 for ; Wed, 15 Jun 2011 13:42:48 +0000 (UTC) Received: (qmail 90146 invoked by uid 500); 15 Jun 2011 13:42:48 -0000 Delivered-To: apmail-directory-dev-archive@directory.apache.org Received: (qmail 90104 invoked by uid 500); 15 Jun 2011 13:42:48 -0000 Mailing-List: contact dev-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Apache Directory Developers List" Delivered-To: mailing list dev@directory.apache.org Received: (qmail 90094 invoked by uid 99); 15 Jun 2011 13:42:48 -0000 Received: from minotaur.apache.org (HELO minotaur.apache.org) (140.211.11.9) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Jun 2011 13:42:48 +0000 Received: from localhost (HELO emmanuel-lecharnys-MacBook-Pro.local) (127.0.0.1) (smtp-auth username elecharny, mechanism plain) by minotaur.apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Jun 2011 13:42:48 +0000 Message-ID: <4DF8B6D6.7030808@apache.org> Date: Wed, 15 Jun 2011 15:42:46 +0200 From: =?UTF-8?B?RW1tYW51ZWwgTMOpY2hhcm55?= Reply-To: elecharny@apache.org Organization: The Apache Software Foundation User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 MIME-Version: 1.0 To: Apache Directory Developers List Subject: Re: Is this intended, or should we consider that is a bug ? References: <4DF89D31.6090902@gmail.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 6/15/11 2:07 PM, Stefan Seelmann wrote: > On Wed, Jun 15, 2011 at 1:53 PM, Emmanuel Lecharny wrote: >> Hi, >> >> I'm wondering if the following code snippet is just a bug, or if this was >> intended : >> >> public PresenceEvaluator( PresenceNode node, Store db, >> SchemaManager schemaManager ) >> throws Exception >> { >> this.db = db; >> this.node = node; >> this.schemaManager = schemaManager; >> this.attributeType = node.getAttributeType(); >> >> if ( db.hasUserIndexOn( attributeType ) ) >> { >> idx = db.getPresenceIndex(); >> } >> else >> { >> idx = null; >> } >> } >> >> In my case, the AttributeType is ObjectClass, which is a System index. I >> find it extremely doubtful that we want to set idx to null in this very >> case. > AFAIK we only add user attributes to the precence index. System > attributes (objectClass, entryUUID, entryCSN) are not added to the > precense index because they are always present in an entry so it would > be a waste of space to add them to the presence index. Instead in > another part of the PresenceEvaluator we check if the index is a > system index and return true. Stefan, you are absolutely right. The following code demonstrate it : public boolean evaluateEntry( Entry entry ) throws Exception { if ( db.hasSystemIndexOn( attributeType ) ) { // we don't maintain a presence index for objectClass, entryUUID, and entryCSN // however as every entry has such an attribute this evaluator always evaluates to true return true; } Thanks a lot ! -- Regards, Cordialement, Emmanuel Lécharny www.iktek.com