Return-Path: X-Original-To: apmail-hadoop-common-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-common-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D978CA49 for ; Wed, 29 Aug 2012 18:18:08 +0000 (UTC) Received: (qmail 78165 invoked by uid 500); 29 Aug 2012 18:18:08 -0000 Delivered-To: apmail-hadoop-common-issues-archive@hadoop.apache.org Received: (qmail 78129 invoked by uid 500); 29 Aug 2012 18:18:08 -0000 Mailing-List: contact common-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-issues@hadoop.apache.org Delivered-To: mailing list common-issues@hadoop.apache.org Received: (qmail 78053 invoked by uid 99); 29 Aug 2012 18:18:08 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Aug 2012 18:18:08 +0000 Date: Thu, 30 Aug 2012 05:18:08 +1100 (NCT) From: "Aaron T. Myers (JIRA)" To: common-issues@hadoop.apache.org Message-ID: <603282600.13041.1346264288406.JavaMail.jiratomcat@arcas> In-Reply-To: <431023425.3028.1346098387529.JavaMail.jiratomcat@arcas> Subject: [jira] [Commented] (HADOOP-8736) Create a Builder to make an RPC server MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HADOOP-8736?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13444287#comment-13444287 ] Aaron T. Myers commented on HADOOP-8736: ---------------------------------------- bq. Firstly, the "truly required fields" are just the truly required for now, and it's hard to predict future. Sure, but if/when that future comes, what will have to happen with each of these approaches? In the constructor approach, you'll change the constructor signature and then things won't compile until you've fixed all of the call sites. That is good. In the multi-method builder approach, everything will compile, but you'll have to run all of the tests to find the call sites that you missed when adding a new builder method call, and also will have to hope that the tests in fact do cover all of the call sites. That is bad. bq. Secondly, even we have a constructor with all the current required fields, the developer can still pass null pointers by mistake. Of course that's always a possibility, but that seems less likely than a developer forgetting to call a builder method that is in fact required. That's also a possibility with the multi-method builder approach as well - the developer might pass null values by mistake. But like I said, you can go with whatever you prefer. You haven't convinced me that this is the right way to go, but I'm not going to stop you from doing it. > Create a Builder to make an RPC server > -------------------------------------- > > Key: HADOOP-8736 > URL: https://issues.apache.org/jira/browse/HADOOP-8736 > Project: Hadoop Common > Issue Type: Improvement > Components: ipc > Affects Versions: 3.0.0 > Reporter: Brandon Li > Assignee: Brandon Li > Attachments: HADOOP-8736.patch, HADOOP-8736.patch, HADOOP-8736.patch > > > There are quite a few variants of getServer() method to create an RPC server. Create a builder class to abstract the building steps and avoid more getServer() variants in the future. -- 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