[
https://issues.apache.org/jira/browse/YARN-7856?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16374184#comment-16374184
]
Weiwei Yang commented on YARN-7856:
-----------------------------------
Hi [~sunilg]
A new patch updated, regarding to your comments
{quote}could u pls check a case where one of getAttributePrefix may be null
{quote}
This is checked in the patch
{code}
if (Strings.isNullOrEmpty(prefix)) {
throw new IOException("Attribute prefix must be set");
}
{code}
We don't allow any prefix can be null, so immediately fail the check if found
one.
{quote}we could add some checks to avoid special characters etc
{quote}
Done. This is by calling \{{NodeLabelUtil#checkAndThrow...}} APIs.
{quote}we could validate each of these attribute alone.
{quote}
The reason I encapsulate the check against a given node attribute set in
\{{NodeLabelUtil}} is because this is easier to be reused by other components,
clearly RM side will need this when adding centralized attributes.
Please help to review the v2 patch and let me know if you have any more
comments.
Thanks
> Validation node attributes in NM
> --------------------------------
>
> Key: YARN-7856
> URL: https://issues.apache.org/jira/browse/YARN-7856
> Project: Hadoop YARN
> Issue Type: Sub-task
> Components: nodemanager, RM
> Reporter: Weiwei Yang
> Assignee: Weiwei Yang
> Priority: Major
> Attachments: YARN-7856-YARN-3409.001.patch,
> YARN-7856-YARN-3409.002.patch
>
>
> NM needs to do proper validation about the attributes before sending them to
> RM, this includes
> # a valid prefix is presented
> # no duplicate entries
> # do not allow two attributes with same prefix/name but different types
> This could be an utility class that can be used on both RM/NM sides.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]