You are viewing a plain text version of this content. The canonical link for it is here.
Posted to yarn-dev@hadoop.apache.org by Jun Ping Du <jd...@vmware.com> on 2013/09/10 13:20:01 UTC

(YARN-921) Consider adding clone methods to protocol objects

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)" <ji...@apache.org>
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