Sync'ing two Netty based server

"Trustin Lee (이희승)" trustin at gmail.com
Mon Mar 8 02:28:01 EST 2010


This issue has been resolved in 3.2.0.BETA1 although not mentioned in
the release note.  The following two methods were added:

  * ChunkedInput.isEndOfInput()
  * ChunkedWriteHandler.resumeTransfer()

HTH,
Trustin

Trustin Lee (이희승) wrote:
> If I understood correctly, you implemented a ChunkedInput whose data is
> not always fully available.  It will not work actually because the
> current ChunkedWriteHandler and ChunkedInput implementations assume that
> the whole data is available somewhere.
> 
> I think this is a flaw in the current implementation.  ChunkedInput
> interface should provide a way to notify ChunkedWriteHandler when more
> data is available or end of stream has been reached.
> 
> Thanks for reporting the problem, and I will get back to you with a fix.
> 
> Regards,
> Trustin
> 
> gciuloaica wrote:
>> Hi,
>>
>> I need some guidelines regarding following situation:
>> 1. Http Node is taking care of processing Http Requests (GET, POST, PUT,
>> DELETE).
>>    Pipeline:
>>            pipeline.addLast("decoder", new HttpRequestDecoder());
>> 	   pipeline.addLast("encoder", new HttpResponseEncoder());
>> 	   pipeline.addLast("chunkedWriter", new ChunkedWriteHandler());
>> 	   pipeline.addLast("handler", new HttpRequestHandler(clusterInstance));
>> 2. Storage Node is able to store/retrieve and delete files.
>>            pipeline.addLast("decoder", new FileChunkRequestDecoder());
>> 	   pipeline.addLast("encoder", new FileChunkResponseEncoder());
>> 	   pipeline.addLast("streamer", new ChunkedWriteHandler());
>> 	   pipeline.addLast("handler", new FileChunkRequestHandler());
>> 3. PUT operation is working very well. When a PUT request arrived on Http
>> Node, HttpRequestHandler will create a new Storage Node client, create a
>> request message, and send it to Storage Node. Storage node will use the
>> FileChunkRequestDecoder that ReplayingDecoder, to decode the message and
>> store the content to the file system, chunk by chunk.
>> 4. GET operation is not working all the time. When a GET request is arriving
>> on Http node, a Storage Node client is created, create a request message
>> that is sent to Storage Node. Storage Node is using the
>> FileChunkRequestDecoder() to decode the message. If the file requested could
>> be identified, a response is created and written to the channel. Then the
>> content of the file is streamed back to http node (to storage client
>> instance) through the ChunkedWriterHandler. The storage node client is
>> storing internally all the chunks into a LinkedBlockingQueue, the http
>> response is going back to the client through ChunkedWriterHandler, through a
>> custom implementation of ChunkedInput interface. This custom implementation
>> is using take() from LinkdBlokingQueue. The issue is that this is not
>> working properly all the time. Sometimes, usually first GET operation
>> succeed, second is getting block on take() operation. I'm expecting that all
>> the receive messages are arriving in order.
>> Now the supposition is that my coding is not quite event driven done well.
>> The idea was to be able to responde to GET http request, chunk by chunk, as
>> soon as the chunk is available on Http Node coming from StorageNode. Can you
>> give me some guidelines?
>>
>> Thanks,
>> Gabi
>>
>>
> 

-- 
what we call human nature in actuality is human habit
http://gleamynode.net/


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 260 bytes
Desc: OpenPGP digital signature
Url : http://lists.jboss.org/pipermail/netty-users/attachments/20100308/579513b2/attachment.bin 


More information about the netty-users mailing list