You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Xing Jin (JIRA)" <ji...@apache.org> on 2011/01/08 07:46:46 UTC

[jira] Created: (THRIFT-1034) Add a multiplexing Java client

Add a multiplexing Java client
------------------------------

                 Key: THRIFT-1034
                 URL: https://issues.apache.org/jira/browse/THRIFT-1034
             Project: Thrift
          Issue Type: New Feature
          Components: Java - Library
         Environment: Java v1.4 or higher 
            Reporter: Xing Jin


One of our recent projects requires to fetch responses from several hundred servers. All servers have similar settings. The client needs to send same request to all servers, and then fetch their responses.

We would like to use non-blocking sockets to implement it, as it is much faster than setting up hundreds of blocking sockets. So in this patch, we create a client class, which sends a same request to multiple servers (using java.nio.selector and non-blocking socket), then fetches response from all these servers, and returns results as an array of ByteBuffer. We also pass a timeout value to the client, so that when a pre-defined time duration passes, the client would shutdown all sockets and return any available responses.

It assumes all servers are non-blocking servers and all use TFramedTransport. 

We have done many local tests. We could generate some unittest if necessary. Appreciate any comments!

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] [Assigned] (THRIFT-1034) Add a multiplexing Java client

Posted by "Jake Farrell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-1034?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jake Farrell reassigned THRIFT-1034:
------------------------------------

    Assignee: Jake Farrell
    
> Add a multiplexing Java client
> ------------------------------
>
>                 Key: THRIFT-1034
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1034
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Java - Library
>         Environment: Java v1.4 or higher 
>            Reporter: Xing Jin
>            Assignee: Jake Farrell
>         Attachments: thrift-1034-patch.txt
>
>
> One of our recent projects requires to fetch responses from several hundred servers. All servers have similar settings. The client needs to send same request to all servers, and then fetch their responses.
> We would like to use non-blocking sockets to implement it, as it is much faster than setting up hundreds of blocking sockets. So in this patch, we create a client class, which sends a same request to multiple servers (using java.nio.selector and non-blocking socket), then fetches response from all these servers, and returns results as an array of ByteBuffer. We also pass a timeout value to the client, so that when a pre-defined time duration passes, the client would shutdown all sockets and return any available responses.
> It assumes all servers are non-blocking servers and all use TFramedTransport. 
> We have done many local tests. We could generate some unittest if necessary. Appreciate any comments!

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (THRIFT-1034) Add a multiplexing Java client

Posted by "Jake Farrell (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1034?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13465556#comment-13465556 ] 

Jake Farrell commented on THRIFT-1034:
--------------------------------------

If you could please add some unit tests to this I will commit it
                
> Add a multiplexing Java client
> ------------------------------
>
>                 Key: THRIFT-1034
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1034
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Java - Library
>         Environment: Java v1.4 or higher 
>            Reporter: Xing Jin
>         Attachments: thrift-1034-patch.txt
>
>
> One of our recent projects requires to fetch responses from several hundred servers. All servers have similar settings. The client needs to send same request to all servers, and then fetch their responses.
> We would like to use non-blocking sockets to implement it, as it is much faster than setting up hundreds of blocking sockets. So in this patch, we create a client class, which sends a same request to multiple servers (using java.nio.selector and non-blocking socket), then fetches response from all these servers, and returns results as an array of ByteBuffer. We also pass a timeout value to the client, so that when a pre-defined time duration passes, the client would shutdown all sockets and return any available responses.
> It assumes all servers are non-blocking servers and all use TFramedTransport. 
> We have done many local tests. We could generate some unittest if necessary. Appreciate any comments!

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Updated: (THRIFT-1034) Add a multiplexing Java client

Posted by "Xing Jin (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-1034?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Xing Jin updated THRIFT-1034:
-----------------------------

    Attachment: thrift-1034-patch.txt

Client class as in the issue description.

> Add a multiplexing Java client
> ------------------------------
>
>                 Key: THRIFT-1034
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1034
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Java - Library
>         Environment: Java v1.4 or higher 
>            Reporter: Xing Jin
>         Attachments: thrift-1034-patch.txt
>
>
> One of our recent projects requires to fetch responses from several hundred servers. All servers have similar settings. The client needs to send same request to all servers, and then fetch their responses.
> We would like to use non-blocking sockets to implement it, as it is much faster than setting up hundreds of blocking sockets. So in this patch, we create a client class, which sends a same request to multiple servers (using java.nio.selector and non-blocking socket), then fetches response from all these servers, and returns results as an array of ByteBuffer. We also pass a timeout value to the client, so that when a pre-defined time duration passes, the client would shutdown all sockets and return any available responses.
> It assumes all servers are non-blocking servers and all use TFramedTransport. 
> We have done many local tests. We could generate some unittest if necessary. Appreciate any comments!

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.