From dev-return-25187-apmail-directory-dev-archive=directory.apache.org@directory.apache.org Tue May 13 05:15:59 2008 Return-Path: Delivered-To: apmail-directory-dev-archive@www.apache.org Received: (qmail 12012 invoked from network); 13 May 2008 05:15:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 13 May 2008 05:15:59 -0000 Received: (qmail 46072 invoked by uid 500); 13 May 2008 05:16:00 -0000 Delivered-To: apmail-directory-dev-archive@directory.apache.org Received: (qmail 46022 invoked by uid 500); 13 May 2008 05:16:00 -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 46011 invoked by uid 99); 13 May 2008 05:16:00 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 May 2008 22:16:00 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of akarasulu@gmail.com designates 209.85.200.169 as permitted sender) Received: from [209.85.200.169] (HELO wf-out-1314.google.com) (209.85.200.169) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 May 2008 05:15:15 +0000 Received: by wf-out-1314.google.com with SMTP id 27so2766054wfd.31 for ; Mon, 12 May 2008 22:15:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:mime-version:content-type:x-google-sender-auth; bh=Ix0+YMv1bIuJ5ODoKKfnTXceY8lW9U6KHo8HcJj15jM=; b=tArIxifczcNDNLwAZwR2JV92KjF53a2DUpTXOLV2TgOQJ7K4X+dTSUG8yjS7evmm3pw7zQ2DDKLdKv5vH3gfUM+x77ilc5VDGylrST5W3Yzh+C2yM+QcaiSTNwtr7iJRi5KJfpNukeHm51RYshkXq16k/U0FENqqnekRU7YOPPY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:mime-version:content-type:x-google-sender-auth; b=KRMTOR8VH7PBBJg067/3TVp0N5aQq+tCASbsElYB8Oh3SQqF4SydUjt7Ofc6t6824+B2h27cQqrWNDueBt6InNxYwvJtkQAvG7ItTMsLSkJvd/H0rB5mhve3roArd4ffB137inIj6Dkq7Kz181ekpkG9KoCvGFZftKhZDDNaplw= Received: by 10.142.79.15 with SMTP id c15mr3622425wfb.105.1210655730786; Mon, 12 May 2008 22:15:30 -0700 (PDT) Received: by 10.143.166.2 with HTTP; Mon, 12 May 2008 22:15:30 -0700 (PDT) Message-ID: Date: Tue, 13 May 2008 01:15:30 -0400 From: "Alex Karasulu" Sender: akarasulu@gmail.com To: "Apache Directory Developers List" Subject: [ApacheDS] [Search] Adding additional methods to Evaluator interface MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_2975_32344664.1210655730779" X-Google-Sender-Auth: 2383bc0d56caac18 X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_2975_32344664.1210655730779 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline In the Cursor based refactoring I've noticed some inefficiencies with the way we deal with Evaluators. For more information about what these are please see the developer documentation on the default partition implementation and how search is conducted on it here [0]. The Evaluator interface is used to determine whether or not a filter expression accepts a candidate entry. Evaluators have an AST representation of the expression or subexpression they use to determine if the candidate matches the expression filter. Right now we use evaluate( IndexEntry ) which contains the id and value along with the entry if it is pulled from the master table. This is to temporarily store the entry so subsequent evaluation attempts do not have to access the master table again to get the entry. It makes search a lot faster. I was seeing some use cases in unit tests and Cursor implementations that use evaluators which don't necessarily need to pass in an IndexEntry. Instead they need to pass in a ServerEntry or a Long id for the candidate. In some cases a new IndexEntry object is created just to be able to utilize the Evaluator. So I'm going to change this interface so it adds these additional overloads: boolean evaluate( IndexEntry entry ) throws Exception; boolean evaluate( Long id ) throws Exception; boolean evaluate( E entry ) throws Exception; Any objections? Thanks, Alex -------- [0] - http://cwiki.apache.org/confluence/display/DIRxSRVx11/SearchEngine+and+Optimizer ------=_Part_2975_32344664.1210655730779 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline In the Cursor based refactoring I've noticed some inefficiencies with the way we deal with Evaluators.  For more information about what these are please see the developer documentation on the default partition implementation and how search is conducted on it here [0].

The Evaluator interface is used to determine whether or not a filter expression accepts a candidate entry.  Evaluators have an AST representation of the expression or subexpression they use to determine if the candidate matches the expression filter.  Right now we use evaluate( IndexEntry ) which contains the id and value along with the entry if it is pulled from the master table.  This is to temporarily store the entry so subsequent evaluation attempts do not have to access the master table again to get the entry.  It makes search a lot faster.

I was seeing some use cases in unit tests and Cursor implementations that use evaluators which don't necessarily need to pass in an IndexEntry. Instead they need to pass in a ServerEntry or a Long id for the candidate.  In some cases a new IndexEntry object is created just to be able to utilize the Evaluator.  So I'm going to change this interface so it adds these additional overloads:

    boolean evaluate( IndexEntry<?,E> entry ) throws Exception;
    boolean evaluate( Long id ) throws Exception;
    boolean evaluate( E entry ) throws Exception;

Any objections?

Thanks,
Alex

--------
[0] - http://cwiki.apache.org/confluence/display/DIRxSRVx11/SearchEngine+and+Optimizer
------=_Part_2975_32344664.1210655730779--