Return-Path: X-Original-To: apmail-directory-users-archive@www.apache.org Delivered-To: apmail-directory-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 061F1C9D7 for ; Fri, 8 Jun 2012 12:06:59 +0000 (UTC) Received: (qmail 1903 invoked by uid 500); 8 Jun 2012 12:06:58 -0000 Delivered-To: apmail-directory-users-archive@directory.apache.org Received: (qmail 1828 invoked by uid 500); 8 Jun 2012 12:06:58 -0000 Mailing-List: contact users-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@directory.apache.org Delivered-To: mailing list users@directory.apache.org Received: (qmail 1816 invoked by uid 99); 8 Jun 2012 12:06:58 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Jun 2012 12:06:58 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of garbage@gmx.de designates 213.165.64.23 as permitted sender) Received: from [213.165.64.23] (HELO mailout-de.gmx.net) (213.165.64.23) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 08 Jun 2012 12:06:51 +0000 Received: (qmail invoked by alias); 08 Jun 2012 12:06:06 -0000 Received: from ip-2-200-1-50.web.vodafone.de (EHLO [2.200.1.50]) [2.200.1.50] by mail.gmx.net (mp039) with SMTP; 08 Jun 2012 14:06:06 +0200 X-Authenticated: #276902 X-Provags-ID: V01U2FsdGVkX1+8+Wgn5dy81ac5vPhBvmZKziE2vXOduRFyN0Xyab BT7ODwsNHIStyF Subject: Re: [ApacheDS] how can a partition return more than one result ? References: <4FD1E8D9.80409@gmail.com> From: Garbage Content-Type: text/plain; charset=utf-8 X-Mailer: iPad Mail (9B206) In-Reply-To: <4FD1E8D9.80409@gmail.com> Message-Id: <010C18A7-F861-4A36-A7A2-0EF84A258040@gmx.de> Date: Fri, 8 Jun 2012 14:05:57 +0200 To: "users@directory.apache.org" Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (1.0) X-Y-GMX-Trusted: 0 X-Virus-Checked: Checked by ClamAV on apache.org Am 08.06.2012 um 13:58 schrieb Emmanuel L=C3=A9charny := > Le 6/8/12 1:49 PM, Garbage a =C3=A9crit : >> I learned a lot about the implementation of custom partitions and see the= changes in the API from search and lookup returning an Entry in 1.5.x and a= n EntryFilteringCursor later on. >> I even was able to change an existing partition (shame on me: based on th= e 1.5.5 example, but I will switch to 2.0 soon) in a way that lets it return= a fake group object that was created in my custom POJO. >>=20 >> But I am only able to return ONE entry, I didn't find or understand the c= oncept how MULTIPLE entries can be returned. Can someone show me the right d= irection ? > The idea is to use a Cursor that maps around the partition and fetch the e= ntries one by one. >=20 > The way the server works is that based on your filter, you select the righ= t index to use to fetch the entries. There are may possibilities here : > - first, you may have to do a full scan (the filter is not selective enoug= h, for instance). In this case, you don't use any index, you just use the Ma= sterTable to get the entries. Now, for each entry you fetch, you'll have to f= ilter them to see if it's a valid entry - or not. > - or you can select an index. You will fetch the index elements, and for e= ach of them, fetch the associated entry. Once done, you can check against t= he filter if the entry is valid - or not >=20 > In any case, the cursor is your friend here : it maps the next() operation= on top of your index. >=20 > Now, if your Partition is a Btree, it's easier, as the AbstractBTreePartit= ion class already handles everyting for you. If you don't inherit from this A= bstract class, then it's way more complicated. I'll suggest you have a look a= t the AbstractBTreePartition to get a clue about how we process a search ove= r a BTree based partition. >=20 > --=20 > Regards, > Cordialement, > Emmanuel L=C3=A9charny > www.iktek.com >=20 Thanks, I will investigate this. What a pity, I am able to map searches to s= tring arrays containing the name of groups I want to return. But I understan= d why you don't support arrays directly, I will somehow manage to map to the= Bree example. And if not I will show up here again ;-)