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 "Chandni Singh (JIRA)" <ji...@apache.org> on 2018/02/28 00:28:00 UTC

[jira] [Updated] (YARN-7985) Service name is validated twice in ServiceClient when a service is created

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

Chandni Singh updated YARN-7985:
--------------------------------
    Description: 
In ServiceClient.actionCreate() :
{code:java}
ServiceApiUtil.validateNameFormat(serviceName, getConfig());
ServiceApiUtil.validateAndResolveService(service, fs, getConfig());{code}
However, the ServiceApiUtil.validateAndResolveService(...), also validates the service name
{code:java}
if (StringUtils.isEmpty(service.getName())) {
  throw new IllegalArgumentException(
      RestApiErrorMessages.ERROR_APPLICATION_NAME_INVALID);
}

validateNameFormat(service.getName(), conf);{code}
Also, {{ServiceClientTest}}  which is a mock client for the ApiServer, can perform the actual validation which is performed by the {{ServiceClient}}

  was:
In ServiceClient.actionCreate() :
{code:java}
ServiceApiUtil.validateNameFormat(serviceName, getConfig());
ServiceApiUtil.validateAndResolveService(service, fs, getConfig());{code}
However the ServiceApiUtil.validateAndResolveService(...), also validates the service name
{code:java}
if (StringUtils.isEmpty(service.getName())) {
  throw new IllegalArgumentException(
      RestApiErrorMessages.ERROR_APPLICATION_NAME_INVALID);
}

validateNameFormat(service.getName(), conf);{code}


> Service name is validated twice in ServiceClient when a service is created
> --------------------------------------------------------------------------
>
>                 Key: YARN-7985
>                 URL: https://issues.apache.org/jira/browse/YARN-7985
>             Project: Hadoop YARN
>          Issue Type: Bug
>          Components: yarn-native-services
>            Reporter: Chandni Singh
>            Assignee: Chandni Singh
>            Priority: Trivial
>
> In ServiceClient.actionCreate() :
> {code:java}
> ServiceApiUtil.validateNameFormat(serviceName, getConfig());
> ServiceApiUtil.validateAndResolveService(service, fs, getConfig());{code}
> However, the ServiceApiUtil.validateAndResolveService(...), also validates the service name
> {code:java}
> if (StringUtils.isEmpty(service.getName())) {
>   throw new IllegalArgumentException(
>       RestApiErrorMessages.ERROR_APPLICATION_NAME_INVALID);
> }
> validateNameFormat(service.getName(), conf);{code}
> Also, {{ServiceClientTest}}  which is a mock client for the ApiServer, can perform the actual validation which is performed by the {{ServiceClient}}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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