thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chiku <hakise...@gmail.com>
Subject Re: Does thrift support one-client communicating with multi-servers?
Date Thu, 28 Jul 2011 13:59:54 GMT
I guess you do not need to implement something like Hadoop IPC Client class.


You already have the logic for Client Server rpc mechanism through Thrift
API.

Are you looking into Async Clients or the Sync Clients?

It should be a simple producer consumer problem. The Servers are the
response generators or the producers. The responses from the various Servers
are put into the queue. When you have responses from the all the Servers,
you could collate the responses into a single entity.

On Thu, Jul 28, 2011 at 12:28 PM, chang liu <liuchangit@gmail.com> wrote:

> Thank you very much!
>
> A little more, hadoop IPC has such a method:
>   public Writable[] call(Writable[] params, InetSocketAddress[] addresses)
> in its Client class, I want to implement the same function using thrift,
> where should I start from? do you have any suggestion?
>
>
>
> On Thu, Jul 28, 2011 at 2:36 PM, Chiku <hakisenin@gmail.com> wrote:
>
> > You will have to write your own wrapper for that.
> >
> > As far as I know, Thrift has no such aggregation service and in my
> opinion
> > there is a reason for that too:
> >
> > 1) What if a Server fails to respond to the request? How does the Service
> > react? It will be very specific to what kind of behavior you want to
> > achieve.
> >  Example: Ignore the request which is taking a lot of time? All the other
> > requests become invalid or not.
> >
> >
> > On Thu, Jul 28, 2011 at 10:34 AM, chang liu <liuchangit@gmail.com>
> wrote:
> >
> > > Hi,
> > >
> > > I have a cluster of servers running the same service but with different
> > > data, an aggregator acting as a client in front of the cluster
> > communicats
> > > to all of the servers and collects data from each service, so the
> client
> > > gets a data set finally. I am going to use thrift as the RPC framework.
> > >
> > > the service defination is below:
> > > service MyService {
> > >    Data call(1:Param param);
> > > }
> > >
> > > But the generated code only has the method I defined, I wish some
> method
> > > like this:
> > > List<Data> callMulti(1:Param param);
> > > to be generated from the defination above. Maybe there is also
> necessary
> > to
> > > have some TTransport implementation like TMultiServerTransport.
> > >
> > > Is there any way to archive this?
> > >
> > > Any Advice will be appropriated.
> > >
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message