You are viewing a plain text version of this content. The canonical link for it is here.
Posted to yarn-issues@hadoop.apache.org by "Tao Jie (JIRA)" <ji...@apache.org> on 2016/09/07 06:56:20 UTC

[jira] [Issue Comment Deleted] (YARN-5552) Add Builder methods for common yarn API records

     [ https://issues.apache.org/jira/browse/YARN-5552?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tao Jie updated YARN-5552:
--------------------------
    Comment: was deleted

(was: Thank you for your comment,[~leftnoteasy]!
Storing local variables in builder here is to give a default value for fields and avoid potential NPE. It is better to set default value also in builder constructor like:
{quote}
    private ResourceRequestBuilder() {
      ResourceRequest request = Records.newRecord(ResourceRequest.class);
      request.setResourceName(ResourceRequest.ANY);
      request.setPriority(Priority.newInstance(0));
      ...
    }
{quote})

> Add Builder methods for common yarn API records
> -----------------------------------------------
>
>                 Key: YARN-5552
>                 URL: https://issues.apache.org/jira/browse/YARN-5552
>             Project: Hadoop YARN
>          Issue Type: Improvement
>            Reporter: Arun Suresh
>            Assignee: Tao Jie
>         Attachments: YARN-5552.000.patch, YARN-5552.001.patch, YARN-5552.002.patch, YARN-5552.003.patch
>
>
> Currently yarn API records such as ResourceRequest, AllocateRequest/Respone as well as AMRMClient.ContainerRequest have multiple constructors / newInstance methods. This makes it very difficult to add new fields to these records.
> It would probably be better if we had Builder classes for many of these records, which would make evolution of these records a bit easier.
> (suggested by [~kasha])



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: yarn-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: yarn-issues-help@hadoop.apache.org