Return-Path: X-Original-To: apmail-hadoop-hdfs-dev-archive@minotaur.apache.org Delivered-To: apmail-hadoop-hdfs-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 018D29AC3 for ; Mon, 19 Mar 2012 02:49:27 +0000 (UTC) Received: (qmail 95496 invoked by uid 500); 19 Mar 2012 02:49:27 -0000 Delivered-To: apmail-hadoop-hdfs-dev-archive@hadoop.apache.org Received: (qmail 95250 invoked by uid 500); 19 Mar 2012 02:49:27 -0000 Mailing-List: contact hdfs-dev-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hdfs-dev@hadoop.apache.org Delivered-To: mailing list hdfs-dev@hadoop.apache.org Received: (qmail 95235 invoked by uid 99); 19 Mar 2012 02:49:26 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 19 Mar 2012 02:49:26 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of eli@cloudera.com designates 209.85.215.48 as permitted sender) Received: from [209.85.215.48] (HELO mail-lpp01m010-f48.google.com) (209.85.215.48) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 19 Mar 2012 02:49:21 +0000 Received: by lagu2 with SMTP id u2so6289328lag.35 for ; Sun, 18 Mar 2012 19:49:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:x-gm-message-state; bh=htFlEZbhfFW80MmLFH+gGKDTS7/2T1w91rsqRC74qfk=; b=k/9AW0dvAt5oLeZVLbrwOpPoXU3yZnwE49W9THPjLawALv9vASFyyHl6lUFaHuQIsl bUoP19nCtRBsto+v7cxVj0nO1603ucfvQvY7zhNz55kS2vez27yCShKzdNWqEMrfQlQy YfO5QqzQ7q8YneX/I1odX21fzA5C+MCLB5aZoK7khGATVBvZamHl8f+jUG7G6qPMmOs7 6qEvJtlVunt73lCtVCYfHhXoU8o3Of6D9EuKv7T0o5vZYiCnHjbl2WCxmf1+hQxz2ZqK uxY/sACMju/lQ8DAqiBTen8Ea5HE5//VWxkojZ+CWt4ZQ0vlilll/fg1xP9jwIoK4Pb8 JJwQ== MIME-Version: 1.0 Received: by 10.112.42.134 with SMTP id o6mr594395lbl.70.1332125340107; Sun, 18 Mar 2012 19:49:00 -0700 (PDT) Received: by 10.112.102.136 with HTTP; Sun, 18 Mar 2012 19:49:00 -0700 (PDT) In-Reply-To: References: Date: Sun, 18 Mar 2012 19:49:00 -0700 Message-ID: Subject: Re: Proposal: abandon protocol translator layer for cluster-internal RPCs From: Eli Collins To: hdfs-dev@hadoop.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQmKcB4mZqVSzLbjiH35FiFK7BM5N6Tpg4sERyCP7hqDrQFA/HjR7zIHrtBEJ5yPLc2akg29 X-Virus-Checked: Checked by ClamAV on apache.org On Sat, Mar 17, 2012 at 3:31 PM, Todd Lipcon wrote: > Hi all, > > I've been working on some patches recently that required adding a new > protocol and some RPC calls that will be used entirely internally to > HDFS -- i.e the types and functions are never exposed to clients. The > process to do this involved: > 1) Add a new .proto file MyProtocol.proto with the types and the > service definition > 2) Add a new empty Java interface MyProtocolPB.java which adds the > ProtocolInfo and KerberosInfo annotations > 3) Add a new Java interface MyProtocol.java which duplicates the same > methods I defined in the protobuf service > 4) For each new type, create a new Java class which duplicates the > fields, getters, and setters from the protobuf messages > 5) Create a Client-Side Translator and Server-Side Translator class, > each containing a wrapper method for each of the calls > 6) Create a PBHelper class which contains two convert() methods for > each of the new types > > Given that we have many protocols that we never intend to expose, I > see little benefit to adding the indirection layer here. It only makes > the task of modifying the protocols quite onerous and full of > duplicate boilerplate code. > I'd like to propose that, when adding protocols that are meant to be > HDFS-private, we drop steps 3-6 and use the protobuf RPC engine > directly. Doing this doesn't force our hand or limit our options in > the future -- should we want to add an alternate mechanism one can > always add the indirection layer down the road. > > Thoughts? > Sounds good to me. I'm not sure what the indirection layer really buys us even for the client <-> server protocols since just PB should be sufficient there. But that's a separate discussion. > -Todd > -- > Todd Lipcon > Software Engineer, Cloudera