You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by Emmanuel Lecharny <el...@apache.org> on 2009/09/03 13:43:46 UTC
[Partition refactoring] Some proposals
Hi guys,
right now, the Partition interface is used in two places :
- as the interceptor chain entry point
- as the facade for the specific backends (JDBM, LDIF, Oracle...)
We are using the same interface in both case.
What about defining two different interfaces ? One for the chain, one
for the backend ?
The chain interface (ie, Partition, to keep the existing name), will
carry the operations (add, delete, search...), the other interface,
named BackendPartition, which expose a bit more methods, like the sync()
method, get/set Id, get/set SuffixDn, etc.
Does it make sense to you ?
--
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org
Re: [Partition refactoring] Some proposals
Posted by Emmanuel Lecharny <el...@apache.org>.
I was not correct in my previous mail.
In any case, the Partition is hit when we have gone through the whole
Interceptor chain, there is not such a Partition used as the Chain entry
point.
The first Partition called is the PartitionNexus, which itself calls the
correct Partition backend (ie, the one associated with the operation
context).
My bad.
--
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org
Re: [Partition refactoring] Some proposals
Posted by Alex Karasulu <ak...@gmail.com>.
On Thu, Sep 3, 2009 at 3:24 PM, Emmanuel Lecharny <el...@apache.org>wrote:
> Alex Karasulu wrote:
>
>> On Thu, Sep 3, 2009 at 2:59 PM, Kiran Ayyagari <ayyagarikiran@gmail.com
>> >wrote:
>>
>>
>>
>>> Hi guys,
>>>
>>>
>>>> right now, the Partition interface is used in two places :
>>>> - as the interceptor chain entry point
>>>> - as the facade for the specific backends (JDBM, LDIF, Oracle...)
>>>>
>>>> We are using the same interface in both case.
>>>>
>>>> What about defining two different interfaces ? One for the chain, one
>>>> for
>>>> the backend ?
>>>>
>>>>
>>>>
>>> +1
>>>
>>>
>>>
>>
>> Don't know for sure. Need to think a bit more about this. What specific
>> entry point into the chain are you citing as using the Partition
>> interface?
>> I thought we used LdapSession which has similar methods yet adapted to
>> deal
>> with session related concerns.
>>
>> LdapSession is the adaptation of Partition that you're looking for I
>> think.
>>
>>
> Let me bit more precies. We have a CoreSession which uses an
> OperationManager which pushes the operation into the InterceptorChain which
> calls the NexusPartition method. Pfeww...
>
> This is this NexusPartition I suggest to be the base interface, and when we
> hit the backend, we use an extended interface.
>
> Is it more clear ?
>
>
Yep much clearer now. Yes I agree that there's some improvements to be made
on the relationship between NexusPartition and Partition especially now that
several things have shifted in the architecture of the server. I know we
have remnants of crap that still plagues these interfaces. This is a great
time to eradicate them!
>>
>>
>>>
>>>
>>>> The chain interface (ie, Partition, to keep the existing name), will
>>>> carry
>>>> the operations (add, delete, search...), the other interface, named
>>>> BackendPartition, which expose a bit more methods, like the sync()
>>>> method,
>>>> get/set Id, get/set SuffixDn, etc.
>>>>
>>>> Does it make sense to you ?
>>>>
>>>>
>>>>
>>>>
>>> yeap, and one more thing is to change the BTreePartition class name too.
>>> (I somehow feel that it doesn't sound like a generic base class)
>>>
>>>
>>>
>>>
>> I agree. I think this is a base XdbmPartition implementation really.
>>
>>
> Then we have to define it. We can rename the BTreePartion to be
> XdbmPartition
>
>
Sounds good to me.
Regards,
--
Alex Karasulu
My Blog :: http://www.jroller.com/akarasulu/
Apache Directory Server :: http://directory.apache.org
Apache MINA :: http://mina.apache.org
Re: [Partition refactoring] Some proposals
Posted by Emmanuel Lecharny <el...@apache.org>.
Alex Karasulu wrote:
> On Thu, Sep 3, 2009 at 2:59 PM, Kiran Ayyagari <ay...@gmail.com>wrote:
>
>
>> Hi guys,
>>
>>> right now, the Partition interface is used in two places :
>>> - as the interceptor chain entry point
>>> - as the facade for the specific backends (JDBM, LDIF, Oracle...)
>>>
>>> We are using the same interface in both case.
>>>
>>> What about defining two different interfaces ? One for the chain, one for
>>> the backend ?
>>>
>>>
>> +1
>>
>>
>
> Don't know for sure. Need to think a bit more about this. What specific
> entry point into the chain are you citing as using the Partition interface?
> I thought we used LdapSession which has similar methods yet adapted to deal
> with session related concerns.
>
> LdapSession is the adaptation of Partition that you're looking for I think.
>
Let me bit more precies. We have a CoreSession which uses an
OperationManager which pushes the operation into the InterceptorChain
which calls the NexusPartition method. Pfeww...
This is this NexusPartition I suggest to be the base interface, and when
we hit the backend, we use an extended interface.
Is it more clear ?
>
>
>>
>>> The chain interface (ie, Partition, to keep the existing name), will carry
>>> the operations (add, delete, search...), the other interface, named
>>> BackendPartition, which expose a bit more methods, like the sync() method,
>>> get/set Id, get/set SuffixDn, etc.
>>>
>>> Does it make sense to you ?
>>>
>>>
>>>
>> yeap, and one more thing is to change the BTreePartition class name too.
>> (I somehow feel that it doesn't sound like a generic base class)
>>
>>
>>
> I agree. I think this is a base XdbmPartition implementation really.
>
Then we have to define it. We can rename the BTreePartion to be
XdbmPartition
>
>
>> A problem I often encounter when writing a new partition is with the cast
>> in DefaultDirectoryService
>> where it assumes that all partitions are JdbmPartitionS, I think the time
>> is right to get this fixed.
>>
>>
>>
> Right and I think I already removed this. It's pretty clear at this point
> that some of the code in DDS can be moved into the XdbmPartition's
> initialization. For example these is a fragment of code that checks to make
> sure the XdbmPartition indexes objectClass and therefore applies casts in
> the DDS exposing and binding us to the Jdbm implementation. This need not
> be present anymore and may no longer be there as of last night.
>
> I will make sure with re-factoring this will go away.
>
> But most importantly we should review this stuff. Emmanuel it's great that
> you posted this because it puts all our thoughts out there to be
> investigated. I'll try to do the same and give people a basis to review
> what we are doing.
>
Ok, waiting for your brain dump then :)
--
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org
Re: [Partition refactoring] Some proposals
Posted by Alex Karasulu <ak...@gmail.com>.
On Thu, Sep 3, 2009 at 2:59 PM, Kiran Ayyagari <ay...@gmail.com>wrote:
>
> Hi guys,
>>
>> right now, the Partition interface is used in two places :
>> - as the interceptor chain entry point
>> - as the facade for the specific backends (JDBM, LDIF, Oracle...)
>>
>> We are using the same interface in both case.
>>
>> What about defining two different interfaces ? One for the chain, one for
>> the backend ?
>>
> +1
>
Don't know for sure. Need to think a bit more about this. What specific
entry point into the chain are you citing as using the Partition interface?
I thought we used LdapSession which has similar methods yet adapted to deal
with session related concerns.
LdapSession is the adaptation of Partition that you're looking for I think.
>
>
>> The chain interface (ie, Partition, to keep the existing name), will carry
>> the operations (add, delete, search...), the other interface, named
>> BackendPartition, which expose a bit more methods, like the sync() method,
>> get/set Id, get/set SuffixDn, etc.
>>
>> Does it make sense to you ?
>>
>>
> yeap, and one more thing is to change the BTreePartition class name too.
> (I somehow feel that it doesn't sound like a generic base class)
>
>
I agree. I think this is a base XdbmPartition implementation really.
> A problem I often encounter when writing a new partition is with the cast
> in DefaultDirectoryService
> where it assumes that all partitions are JdbmPartitionS, I think the time
> is right to get this fixed.
>
>
Right and I think I already removed this. It's pretty clear at this point
that some of the code in DDS can be moved into the XdbmPartition's
initialization. For example these is a fragment of code that checks to make
sure the XdbmPartition indexes objectClass and therefore applies casts in
the DDS exposing and binding us to the Jdbm implementation. This need not
be present anymore and may no longer be there as of last night.
I will make sure with re-factoring this will go away.
But most importantly we should review this stuff. Emmanuel it's great that
you posted this because it puts all our thoughts out there to be
investigated. I'll try to do the same and give people a basis to review
what we are doing.
Thanks all,
Alex
thanks Emmanuel
>
> Kiran Ayyagari
>
--
Alex Karasulu
My Blog :: http://www.jroller.com/akarasulu/
Apache Directory Server :: http://directory.apache.org
Apache MINA :: http://mina.apache.org
Re: [Partition refactoring] Some proposals
Posted by Kiran Ayyagari <ay...@gmail.com>.
> Hi guys,
>
> right now, the Partition interface is used in two places :
> - as the interceptor chain entry point
> - as the facade for the specific backends (JDBM, LDIF, Oracle...)
>
> We are using the same interface in both case.
>
> What about defining two different interfaces ? One for the chain, one
> for the backend ?
+1
>
> The chain interface (ie, Partition, to keep the existing name), will
> carry the operations (add, delete, search...), the other interface,
> named BackendPartition, which expose a bit more methods, like the sync()
> method, get/set Id, get/set SuffixDn, etc.
>
> Does it make sense to you ?
>
yeap, and one more thing is to change the BTreePartition class name too.
(I somehow feel that it doesn't sound like a generic base class)
A problem I often encounter when writing a new partition is with the cast in DefaultDirectoryService
where it assumes that all partitions are JdbmPartitionS, I think the time is right to get this fixed.
thanks Emmanuel
Kiran Ayyagari