hadoop-yarn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jun Ping Du <...@vmware.com>
Subject (YARN-921) Consider adding clone methods to protocol objects
Date Tue, 10 Sep 2013 11:20:01 GMT
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)" <jira@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

Mime
View raw message