Re: [MINA 3] LDAP codec

2013-01-12 Thread Julien Vermillard
Demuxingiohandler .. what a moronic piece of code, it s sure you
should not depend on that. In place of switch case you should use
polymorphism (visitor pattern fits).
BTW the OutOfOrderExecutor Will process your two messages in two // threads.
--
Julien Vermillard


Le 12 janv. 2013 à 08:09, "Emmanuel Lécharny"  a écrit :

> Hi !
>
> I did some experiment with the LDAP codec today. It's not exactly easy
> to check if it can work safely with MINA 3, as it's almost impossible to
> write a standalone LDAP codec in MINA without doing some huge
> modifications in the LDAP API code.
>
> I think it should be done the other way out : the LDAP API code should
> be made network agnostic, so that we can write a mina project depending
> on the LDAP API, not the other way out. Currently, the LDAP API depends
> on MINA 2 heavily, and I'd like to make it depend on whatever network
> layer we have (be it MINA 2, MINA3 or even Netty).
>
> So I will have to rework the LDAP API code to use a factory to
> instanciate the selected network layer.
>
>
> Otherwise, the current LDAP API codec interface is pretty simple :
>
> public class LdapDecoder
> {
>/**
> * Decodes a PDU from an input stream into a Ldap message container.
> We can only
> * decode one complete message.
> *
> * @param in The input stream to read and decode PDU bytes from
> * @return return The decoded message
> */
>public Message decode( InputStream in,
> LdapMessageContainer> container )
>throws DecoderException
>{
>...
>}
> }
>
>
> public class LdapProtocolDecoder implements ProtocolDecoder
> {
>public void decode( IoSession session, IoBuffer in,
> ProtocolDecoderOutput out ) throws Exception
>{
>List decodedMessages = new ArrayList();
>ByteBuffer buf = in.buf();
>
>decode( buf, messageContainer, decodedMessages );
>
>for ( Message message : decodedMessages )
>{
>out.write( message );
>}
>}
> }
>
> and the very same for the encoder.
>
> The decode( buf, messageContainer, decodedMessages ) call just deal with
> the pure LDAP decoding, and the storage of a state if the incoming data
> don't contan a full message (this is a stateful decoder).
>
> As is, there is no reason for the LDAP decoder to be incompatible with
> MINA 3, except that we have to find another way to handle decoded
> messages (currently, we use a ProtocolDecoderOutput intermediate
> structure, which in fact is just a callback storing the decoded messages
> into a queue, a solution I frankly don't like...)
>
> Would we use MINA 3 in ApacheDS, there is one thing we will need to add
> in MINA 3, and one thing we will have to modify in ApacheDS :
> o ApacheDS depends on the MINA2 DemuxingIoHandler interface, which does
> no exist in MINA3. This interface role is to redirect each message to a
> dedicated handler. For that purpose, we register in a Map
> each decoded message type and the associated MessageHandler. IMO, this
> is a total waste of CPU : a decent switch based on a message type would
> perfectly do the job, and more efficiently. I'll work on this part in
> ApacheDS to remove this dependency.
> o We need to accept two messages for the same session, and be able to
> process them in two different threads. In order to do that in MINA 2, we
> have added an OrderedThreadPollExecutor after the LdapDecoder. In MINA
> 3, this will be slighty different : the executor will be an
> InOrderHandlerExecutor, but that requires we add a codec Filter in the
> chain.
>
> In other words, we can't put the decoder *after* the handler, it must be
> executed before. This is not an issue hough.
>
> Frankly, I do think that I can have ApacheDS working based on MINA 3 in
> probably one or two days, no more. It will most certainly not require
> any modification in MINA3 whatsoever.
>
> Performance wise, the last time I conducted some performance tests on
> ApacheDS (with MINA2), I was able to reach 13 000 lookup per second (ie,
> we were able to send 13000 search request and send back 13000
> SearchResultEntry and 13000 SearchResultDone messages per second.). The
> exact same benchmark (ie, a lookup) done without the network layer
> exhibit a bare performance of around 60 000 requests per second, 5 times
> faster.
>
> With MINA 3 being 50% faster than MINA 2, I do expect we will be able to
> reach 20 000 requests per second on my laptop. The real problem will be
> to be able to start enough client to simulate the load :)
>
> Ok, now, time to shape a working prototype !
>
> --
> Regards,
> Cordialement,
> Emmanuel Lécharny
> www.iktek.com
>


Re: So where would I find 2.0.8?

2013-01-12 Thread Emmanuel Lécharny
Le 1/12/13 11:14 AM, sebb a écrit :
> On 12 January 2013 07:11, Emmanuel Lécharny  wrote:
>> Le 1/12/13 7:05 AM, Mondain a écrit :
>>> Do I need to pull it from Git or is it still available in SVN?
>> Definitively from git.
>>
>> We can't update the site yet to inform people about this, because the
>> site is stored in SVN and the SVN repo has been switched to read-only,
>> but we don't have the site repo on git available yet :/
> AIUI, the site will always have to be served from SVN.
> AFAIK there are no plans to implement the equivalent of svnpubsub using Git.
>
> So if you are waiting for that to happen, the updated site will never happen.
>
> The PMC needs to decide what flavour of svnpubsub is to be used, and
> ask Infra (via JIRA) to set it up.
We already decided to go for CMS, and switched back in december. The pb
is that the SVN repo is read only atm, so whatever modification we do
can't be saved...


-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com 



Re: GIT mgratio : how to grab the sources for MINA

2013-01-12 Thread sebb
On 12 January 2013 07:41, Emmanuel Lécharny  wrote:
> Hi developers !
>
> MINA project has migrated to GIT this week, so if you want to get the
> sources, you have to clone the repository using this command :
>
> git clone http://git-wip-us.apache.org/repos/asf/mina.git
>
>
> Sadly, we are still waiting for the other projects (FtpServe, SSHD and
> Vysper) to be migrated too.
>
> The very same for the site which is currently in Subversion, which has
> been made read-only.

As per my other mail - AFAIK the site will have to remain in SVN - or
at least the _generated site_ will need to be committed to SVN.

Site publication must use svnpubsub.

The standard ways to use svnpubsub assume that the site source is in SVN.
The end result is that the generated site is checked into an SVN tree
from which the public website is updated.

So I suppose it might be possible to generate the site from git and
check it in to SVN.

> We will update the site as soon as possible !
>
> --
> Regards,
> Cordialement,
> Emmanuel Lécharny
> www.iktek.com
>


Re: So where would I find 2.0.8?

2013-01-12 Thread sebb
On 12 January 2013 07:11, Emmanuel Lécharny  wrote:
> Le 1/12/13 7:05 AM, Mondain a écrit :
>> Do I need to pull it from Git or is it still available in SVN?
> Definitively from git.
>
> We can't update the site yet to inform people about this, because the
> site is stored in SVN and the SVN repo has been switched to read-only,
> but we don't have the site repo on git available yet :/

AIUI, the site will always have to be served from SVN.
AFAIK there are no plans to implement the equivalent of svnpubsub using Git.

So if you are waiting for that to happen, the updated site will never happen.

The PMC needs to decide what flavour of svnpubsub is to be used, and
ask Infra (via JIRA) to set it up.

In the meantime, I believe updating the site on minotaur still works.
This will be switched off fairly soon, so don't delay.