Return-Path: X-Original-To: apmail-hadoop-yarn-dev-archive@minotaur.apache.org Delivered-To: apmail-hadoop-yarn-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 EFDD710AC9 for ; Tue, 10 Sep 2013 11:20:37 +0000 (UTC) Received: (qmail 83735 invoked by uid 500); 10 Sep 2013 11:20:36 -0000 Delivered-To: apmail-hadoop-yarn-dev-archive@hadoop.apache.org Received: (qmail 83215 invoked by uid 500); 10 Sep 2013 11:20:28 -0000 Mailing-List: contact yarn-dev-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: yarn-dev@hadoop.apache.org Delivered-To: mailing list yarn-dev@hadoop.apache.org Received: (qmail 83206 invoked by uid 99); 10 Sep 2013 11:20:25 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Sep 2013 11:20:25 +0000 X-ASF-Spam-Status: No, hits=-5.0 required=5.0 tests=RCVD_IN_DNSWL_HI,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [208.91.2.13] (HELO smtp-outbound-2.vmware.com) (208.91.2.13) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Sep 2013 11:20:21 +0000 Received: from sc9-mailhost3.vmware.com (sc9-mailhost3.vmware.com [10.113.161.73]) by smtp-outbound-2.vmware.com (Postfix) with ESMTP id 69B8429B68 for ; Tue, 10 Sep 2013 04:20:01 -0700 (PDT) Received: from zcs-prod-mta-1.vmware.com (zcs-prod-mta-1.vmware.com [10.113.163.63]) by sc9-mailhost3.vmware.com (Postfix) with ESMTP id 663614038A for ; Tue, 10 Sep 2013 04:20:01 -0700 (PDT) Received: from zcs-prod-mta-1 (localhost.localdomain [127.0.0.1]) by zcs-prod-mta-1.vmware.com (Postfix) with ESMTP id 52E0CE0106 for ; Tue, 10 Sep 2013 04:20:01 -0700 (PDT) Received: from zcs-prod-mbox-41.vmware.com (lbv-sc9-t2prod2-int.vmware.com [10.113.160.246]) by zcs-prod-mta-1.vmware.com (Postfix) with ESMTP for ; Tue, 10 Sep 2013 04:20:01 -0700 (PDT) Date: Tue, 10 Sep 2013 04:20:01 -0700 (PDT) From: Jun Ping Du To: yarn-dev@hadoop.apache.org Message-ID: <1812037458.50744168.1378812001046.JavaMail.root@vmware.com> In-Reply-To: References: Subject: (YARN-921) Consider adding clone methods to protocol objects MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [10.113.62.221] X-Mailer: Zimbra 8.0.3_GA_5664 (ZimbraWebClient - SAF5.1 (Mac)/8.0.3_GA_5664) Thread-Topic: (YARN-921) Consider adding clone methods to protocol objects Thread-Index: fHZiOtIAiFlDM0fHQdrt6FPUPbbxVg== X-Virus-Checked: Checked by ClamAV on apache.org Hello, I am going to work on YARN-921 which tries to add clone() method to yarn protocol objects and pretty convinced by Bikas's comments below for reason to add it. How does it sounds like to you? Welcome to any comments or feedbacks! :) Thanks, Junping ----- Forwarded Message ----- From: "Bikas Saha (JIRA)" To: jdu@vmware.com Sent: Tuesday, September 10, 2013 1:37:52 PM Subject: [jira] [Commented] (YARN-921) Consider adding clone methods to protocol objects [ https://issues.apache.org/jira/browse/YARN-921?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13762756#comment-13762756 ] Bikas Saha commented on YARN-921: --------------------------------- The requirement is to be able to clone a yarn protocol object (not a protobuf object). A yarn object is implemented as a protobuf object but that is not visible to the user. So yarn helper API exists eg. Container.newInstance() returns a container object. However, given a container object there is no helper API to create a copy (like a copy constructor in C++). The user has to manually get and set the members. The set methods are mostly @private and so the user is technically not supposed to set any member. So having a .clone method lets the user easily create a copy of an existing object. > Consider adding clone methods to protocol objects > ------------------------------------------------- > > Key: YARN-921 > URL: https://issues.apache.org/jira/browse/YARN-921 > Project: Hadoop YARN > Issue Type: Sub-task > Affects Versions: 2.1.0-beta > Reporter: Bikas Saha > Assignee: Junping Du > > Whenever we create a new object from an existing object, a clone method could be used to create a copy efficiently vs. new object followed by setters. -- 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