You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@directory.apache.org by Ga...@gmx.de on 2013/08/27 09:32:41 UTC

[ApacheDS] Porting 1.x based custom partition to 2.0

Over a year ago I developed a custom partition with ApacheDS that I want to port to 2.0 now. The partition is "special" because it is only used to connect to ApacheDS, the search in the sub tree is then taken care of in Javacode and not in a directory or database.
The result for the query needs to be determined "live" without copying any data to ApacheDS beforehand.

This is not my exact scenario but I want to give you an example which might explain what I want to do. Let's assume I want to use ApacheDS to look up square roots. It would not make sense to store all possible results in ApacheDS. 

A search for a square root would look like this:
ldapsearch -b ou=squareroot -M -h localhost -p 389 -x "(value=25)"

"squareroot" will be the name of the subtree / partition I write. The search is "value=25" which tells the partition that I want to receive the square root of 25. The partition would then simply calculate Math.sqrt(doubleTakenFromQuery) and return the value.

So my questions are:

1. do you rate 2.0 as mature enough to build my solution on it ? (I assume yes but perhaps a certain Milestone is a better fit)
2. is it still the best way to use a partition for this or does 2.0 offer better ways ?
3. do you know of any examples for this for 2.0 ? I only know examples for 1.x and know that these won't work for 2.0

Re: Re: Re: Re: [ApacheDS] Porting 1.x based custom partition to 2.0

Posted by Kiran Ayyagari <ka...@apache.org>.
On Tue, Sep 17, 2013 at 7:35 PM, <Ga...@gmx.de> wrote:

>
>
> Having this example comes in very handy, thanks for that.
> But I have two questions: is it already foreseeable when the "interface"
> will be fixed ? Reason for my question is that I want to build our new
> solution on a final release and not on a milestone.
>
yes, partition interface is already locked, and the only change that will
likely happen is
in the constructors that we are reviewing at the moment to pass an
additional parameter (the DN factory)

> Second question: is there an example how to implement a partition with a
> custom backend ? I know there were examples for JDBC in 1.x but did not
> find one for 2.0
>
take a look at the implementations
MavibotPartition or JdbmPartition (which use a disk based backend )
AvlPartition (which is an in-memory partition)

these should serve as the perfect examples and if you get stuck somewhere
feel free
to post here we might be able to help

>
>
> | Gesendet: Samstag, 14. September 2013 um 15:16 Uhr
> | Von: "Kiran Ayyagari" <ka...@apache.org>
> | An: users@directory.apache.org
> | Betreff: Re: Re: Re: [ApacheDS] Porting 1.x based custom partition to 2.0
> | Here[1] is the updated sample using M15 (M16 has changed the way a
> | partition is initialized, so
> | used M15 instead to keep it clear for the sake of understanding, except
> | that there is no major change
> | in initializing with M16)
> |
> | ...
> | [1]
> |
> http://svn.apache.org/repos/asf/directory/sandbox/kayyagari/embedded-sample-trunk
>
>



-- 
Kiran Ayyagari
http://keydap.com

Aw: Re: Re: Re: [ApacheDS] Porting 1.x based custom partition to 2.0

Posted by Ga...@gmx.de.

Having this example comes in very handy, thanks for that.
But I have two questions: is it already foreseeable when the "interface" will be fixed ? Reason for my question is that I want to build our new solution on a final release and not on a milestone.
Second question: is there an example how to implement a partition with a custom backend ? I know there were examples for JDBC in 1.x but did not find one for 2.0
 

| Gesendet: Samstag, 14. September 2013 um 15:16 Uhr
| Von: "Kiran Ayyagari" <ka...@apache.org>
| An: users@directory.apache.org
| Betreff: Re: Re: Re: [ApacheDS] Porting 1.x based custom partition to 2.0
| Here[1] is the updated sample using M15 (M16 has changed the way a
| partition is initialized, so
| used M15 instead to keep it clear for the sake of understanding, except
| that there is no major change
| in initializing with M16)
| 
| ...
| [1]
| http://svn.apache.org/repos/asf/directory/sandbox/kayyagari/embedded-sample-trunk
 

Re: Re: Re: [ApacheDS] Porting 1.x based custom partition to 2.0

Posted by Kiran Ayyagari <ka...@apache.org>.
Here[1] is the updated sample using M15 (M16 has changed the way a
partition is initialized, so
used M15 instead to keep it clear for the sake of understanding, except
that there is no major change
in initializing with M16)

P.S:- I have mistakenly replied earlier with the content "I know where the
problem is but haven't ..."
         this was supposed to be a reply for another email about ACIs

[1]
http://svn.apache.org/repos/asf/directory/sandbox/kayyagari/embedded-sample-trunk


On Sat, Sep 7, 2013 at 4:09 AM, <Ga...@gmx.de> wrote:

>
> > I know where the problem is but haven't committed anything yet, I can
> > commit it in the next week only
>
> That would be great and I am looking forward to it.
>



-- 
Kiran Ayyagari
http://keydap.com

Aw: Re: Re: [ApacheDS] Porting 1.x based custom partition to 2.0

Posted by Ga...@gmx.de.
> I know where the problem is but haven't committed anything yet, I can
> commit it in the next week only

That would be great and I am looking forward to it.

Re: Re: [ApacheDS] Porting 1.x based custom partition to 2.0

Posted by Kiran Ayyagari <ka...@apache.org>.
On Fri, Sep 6, 2013 at 4:26 PM, <Ga...@gmx.de> wrote:

>
>
>
> >> 3. do you know of any examples for this for 2.0 ? I only know examples
> for
> >> 1.x and know that these won't work for 2.0
> >>
> >I guess not, I will update the example code to work with the latest trunk
> >and let you know
>
> I do not want to rush anyone so please take this as what I indend it to
> be: a polite question.
> Did you already find the time to update or can you estimate when this will
> be available ?
>
> I know where the problem is but haven't committed anything yet, I can
commit it in the next week only

> Regards,
>



-- 
Kiran Ayyagari
http://keydap.com

Aw: Re: [ApacheDS] Porting 1.x based custom partition to 2.0

Posted by Ga...@gmx.de.
 

>> 3. do you know of any examples for this for 2.0 ? I only know examples for
>> 1.x and know that these won't work for 2.0
>>
>I guess not, I will update the example code to work with the latest trunk
>and let you know
 
I do not want to rush anyone so please take this as what I indend it to be: a polite question.
Did you already find the time to update or can you estimate when this will be available ?

Regards,

Re: [ApacheDS] Porting 1.x based custom partition to 2.0

Posted by Kiran Ayyagari <ka...@apache.org>.
On Tue, Aug 27, 2013 at 1:02 PM, <Ga...@gmx.de> wrote:

> Over a year ago I developed a custom partition with ApacheDS that I want
> to port to 2.0 now. The partition is "special" because it is only used to
> connect to ApacheDS, the search in the sub tree is then taken care of in
> Javacode and not in a directory or database.
> The result for the query needs to be determined "live" without copying any
> data to ApacheDS beforehand.
>
> This is not my exact scenario but I want to give you an example which
> might explain what I want to do. Let's assume I want to use ApacheDS to
> look up square roots. It would not make sense to store all possible results
> in ApacheDS.
>
> A search for a square root would look like this:
> ldapsearch -b ou=squareroot -M -h localhost -p 389 -x "(value=25)"
>
> "squareroot" will be the name of the subtree / partition I write. The
> search is "value=25" which tells the partition that I want to receive the
> square root of 25. The partition would then simply calculate
> Math.sqrt(doubleTakenFromQuery) and return the value.
>
> So my questions are:
>
> 1. do you rate 2.0 as mature enough to build my solution on it ? (I assume
> yes but perhaps a certain Milestone is a better fit)
>
yes, the latest 2.0.0-M15 is a good candidate

> 2. is it still the best way to use a partition for this or does 2.0 offer
> better ways ?
>
considering the way your custom partition works it won't offer any real
benefit by migrating to 2.0
you don't use the ApacheDS's backends and this is where a lot of 2.0
related improvements are
besides the internal search engine

> 3. do you know of any examples for this for 2.0 ? I only know examples for
> 1.x and know that these won't work for 2.0
>
I guess not, I will update the example code to work with the latest trunk
and let you know


-- 
Kiran Ayyagari
http://keydap.com