Return-Path: X-Original-To: apmail-hbase-dev-archive@www.apache.org Delivered-To: apmail-hbase-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 394ECDE54 for ; Fri, 28 Dec 2012 03:12:19 +0000 (UTC) Received: (qmail 14265 invoked by uid 500); 28 Dec 2012 03:12:18 -0000 Delivered-To: apmail-hbase-dev-archive@hbase.apache.org Received: (qmail 14084 invoked by uid 500); 28 Dec 2012 03:12:17 -0000 Mailing-List: contact dev-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hbase.apache.org Delivered-To: mailing list dev@hbase.apache.org Received: (qmail 14069 invoked by uid 99); 28 Dec 2012 03:12:17 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 Dec 2012 03:12:17 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of saint.ack@gmail.com designates 209.85.214.53 as permitted sender) Received: from [209.85.214.53] (HELO mail-bk0-f53.google.com) (209.85.214.53) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 Dec 2012 03:12:10 +0000 Received: by mail-bk0-f53.google.com with SMTP id j5so4460206bkw.40 for ; Thu, 27 Dec 2012 19:11:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=uhI1TsWSDl6IwA7S/R7ie6Rmodra/ijuHK5mFfEzTtA=; b=m9LpvHbbX4BzGDAI1E0pat6JD0eWIwC+Gzb2aioP5Hga7DHMN/kRZ2gUmdvF+TyUX0 M+bHna9HG8p3enngTPkUKCcf31aaZIpxBnsy47qkY93YjIYS8Td2c0cGVSUGxZtqGDqC 0ZaBCIBtXOHDLFLPhf+RwbYEgVi6agoEW0xdzhbu/kcxHgnVvh6SUcFPGQCcDAz08loU wOsT1Sg6o4ZYAA7H3lLjQ7Tr8fwDytjTuzgHKlsTiW8tciF2LJ+L8DJ4LKCbt3Nx8gzD nT8M+0CKN5hjJBnI0Fyo6F9/W3ejzD97fWzmSWAeNficBHT0F8fCLMjg5JqjLcVHfTnM Benw== MIME-Version: 1.0 Received: by 10.204.147.85 with SMTP id k21mr15379725bkv.24.1356664309033; Thu, 27 Dec 2012 19:11:49 -0800 (PST) Sender: saint.ack@gmail.com Received: by 10.205.39.135 with HTTP; Thu, 27 Dec 2012 19:11:48 -0800 (PST) In-Reply-To: References: <88EC303B-9769-4C3A-B3A7-450B468F6486@hortonworks.com> Date: Thu, 27 Dec 2012 19:11:48 -0800 X-Google-Sender-Auth: PN21dv2Uj94CmIuyAX6nMly55qA Message-ID: Subject: Re: Handling protocol versions From: Stack To: HBase Dev List Content-Type: multipart/alternative; boundary=0015174a0e62382ccb04d1e1062b X-Virus-Checked: Checked by ClamAV on apache.org --0015174a0e62382ccb04d1e1062b Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Thu, Dec 27, 2012 at 5:37 PM, Enis S=F6ztutar wrote= : > I think what Devaraj describes is a valid use case, and I am sure we will > need it a few times. However, I suspect each of these might be unique, an= d > we have to deal with how to handle backwards-forwards compat from the > client differently (image META moving to zk, after 0.96). So we cannot > easily generalize, and we may still have to drop support for features > gradually. > > I agree. Just trying to make sure we have some facility in place to help us over some of the humps. > If we still keep the version, do we bump it every time a parameter is add= ed > to a method, or only when a new method is added? It does not sound very > maintainable. > > Version alone won't work. The 0.94 branch might be version 100. The 0.96 branch might be 105. If we want to backport the method that cuts CO2 emissions by 25% but only this method, what version do we give 0.94's protocol? We could make it 101 but maybe 0.96.3 was 101? We could give it a version that has not been seen before but then it gets a little awkward to manage and understand. Regardless, client would have to keep a dictionary of methods per version number, a pain. The suggestion above was that the server gives off a list of features written in shorthand, a bitmap, where bits are set when a feature is added. This way a client can look at the bitmap and see if the C02 saving feature is available in the 0.94 server and if so, use that method. > Not knowing much about the recent changes, why don't we go full PB, and > define actual rpc methods as services? (as in > https://developers.google.com/protocol-buffers/docs/proto#services) > > I thought about it. It has some nice facility that comes for free. For example, you can get an aforementioned pb'd description of the "protocol" and actually used the return to compose an invocation against the server. Nice. Our 'protocols' actually already implement Service.Interface from pb (actually Service.BlockingInterface). I'm not sure why as it looks to complicate things going by a quick examination today (I started stripping it out to see what would break). So it would not take too much to get a Stub on clientside and have servers implement the Service. We could try shoehorning our RPC so it implemented the necessary RpcController, etc. Interfaces. But it would seem Service is deprecated with a good while now [1] and folks are encouraged to do otherwise because as is, the generated code makes for too much "indirection" [1]. I could try playing around some more w/ using Service to learn more about this 'indirection'. We could use the long-hand service descriptor in place of the above suggested bitmap figuring what the server provides. St.Ack 1. https://developers.google.com/protocol-buffers/docs/reference/java-generate= d#service --0015174a0e62382ccb04d1e1062b--