directory-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Garbage <garb...@gmx.de>
Subject Re: [ApacheDS] how can a partition return more than one result ?
Date Mon, 11 Jun 2012 13:21:10 GMT


Von meinem iPad gesendet


>> But I am only able to return ONE entry, I didn't find or understand the concept how
MULTIPLE entries can be returned. Can someone show me the right direction ?
> The idea is to use a Cursor that maps around the partition and fetch the entries one
by one.
> 
> The way the server works is that based on your filter, you select the right 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 enough, for instance).
In this case, you don't use any index, you just use the MasterTable to get the entries. Now,
for each entry you fetch, you'll have to filter 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 each of them,
fetch the associated entry.  Once done, you can check against the filter if the entry is valid
- or not
> 
> In any case, the cursor is your friend here : it maps the next() operation on top of
your index.
> 
> Now, if your Partition is a Btree, it's easier, as the AbstractBTreePartition class already
handles everyting for you. If you don't inherit from this Abstract class, then it's way more
complicated. I'll suggest you have a look at the AbstractBTreePartition to get a clue about
how we process a search over a BTree based partition.
If I got you right I am to create my own cursor object which retrieves and stores the array
with the items I want to deliver. The cursor then implements the next and get method in order
to send the array one by one. But where is the cursor being called ? 
I tried to base my own partition on the abstract btree partition but what am I supposed to
return from getRootId and getDefaultId and even worse from convertAndInit ?

Sorry for the beginner level questions but ApacheDS is quite complex and new to me.
Mime
View raw message