Return-Path: X-Original-To: apmail-thrift-user-archive@www.apache.org Delivered-To: apmail-thrift-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 650887D30 for ; Fri, 29 Jul 2011 02:01:32 +0000 (UTC) Received: (qmail 77552 invoked by uid 500); 29 Jul 2011 02:01:31 -0000 Delivered-To: apmail-thrift-user-archive@thrift.apache.org Received: (qmail 77523 invoked by uid 500); 29 Jul 2011 02:01:31 -0000 Mailing-List: contact user-help@thrift.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@thrift.apache.org Delivered-To: mailing list user@thrift.apache.org Received: (qmail 77515 invoked by uid 99); 29 Jul 2011 02:01:30 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 Jul 2011 02:01:30 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of liuchangit@gmail.com designates 209.85.218.42 as permitted sender) Received: from [209.85.218.42] (HELO mail-yi0-f42.google.com) (209.85.218.42) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 Jul 2011 02:01:22 +0000 Received: by yih10 with SMTP id 10so4402837yih.1 for ; Thu, 28 Jul 2011 19:01:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=2/duu6IAOtwom6liOHcTmIVmKyVAZCyTk3sX+qC+im0=; b=XHFbZQ8Zc2CrP7TUqe/FM5PgryQG4WDl3wUc2ZBbhfZHSEUh4qD+6sZLZUOxr6mV56 4ohwumMWsRIgjUJqOjyBpmZ0vCIwVsXq7IN1I84FaZPndaD5dL/FBB0Bm7YqO/nFRIyD sSU70S9gYHIPugj014wiKtnZfvAdWvrAouHx0= MIME-Version: 1.0 Received: by 10.150.74.7 with SMTP id w7mr366897yba.116.1311904861797; Thu, 28 Jul 2011 19:01:01 -0700 (PDT) Received: by 10.236.41.40 with HTTP; Thu, 28 Jul 2011 19:01:01 -0700 (PDT) In-Reply-To: References: Date: Fri, 29 Jul 2011 10:01:01 +0800 Message-ID: Subject: Re: Does thrift support one-client communicating with multi-servers? From: chang liu To: user@thrift.apache.org Content-Type: multipart/alternative; boundary=000e0cd5c4be443d6904a92ba7f0 X-Virus-Checked: Checked by ClamAV on apache.org --000e0cd5c4be443d6904a92ba7f0 Content-Type: text/plain; charset=ISO-8859-1 Thanks very much, I think I know how to do it. On Thu, Jul 28, 2011 at 9:59 PM, Chiku wrote: > 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 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 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 > > 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 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. > > > > > > > > > > --000e0cd5c4be443d6904a92ba7f0--