hadoop-yarn-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wangda Tan (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (YARN-5552) Add Builder methods for common yarn API records
Date Tue, 06 Sep 2016 20:01:20 GMT

    [ https://issues.apache.org/jira/browse/YARN-5552?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15468390#comment-15468390

Wangda Tan commented on YARN-5552:

Thanks [~Tao Jie] working on this. 

I think builder-like API has better readability than newInstance. I also used builder API
while drafting YARN-5478.

But considering overheads to maintain two set of APIs, I think it's better to deprecate the
old API. Is that the plan in your mind? [~asuresh], [~kasha]. 

And one comment to the patch after a overall review:
- Instead of storing variables locally in the builder, like:
115	    private Priority priority = Priority.newInstance(0);
116	    private String resourceName = ResourceRequest.ANY;
117	    private Resource capability = null;
Is it better to create a fresh record with the Builder constructor, and invoke set... when
methods like (priority(...)) is invoked.

> 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

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

View raw message