diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/test/java/org/apache/hadoop/yarn/service/ServiceClientTest.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/test/java/org/apache/hadoop/yarn/service/ServiceClientTest.java index 8e5fd5c9fc..5d959da377 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/test/java/org/apache/hadoop/yarn/service/ServiceClientTest.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/test/java/org/apache/hadoop/yarn/service/ServiceClientTest.java @@ -26,6 +26,7 @@ import org.apache.hadoop.yarn.service.api.records.Service; import org.apache.hadoop.yarn.service.client.ServiceClient; import org.apache.hadoop.yarn.service.utils.ServiceApiUtil; +import org.apache.hadoop.yarn.service.utils.SliderFileSystem; /** * A mock version of ServiceClient - This class is design @@ -49,9 +50,9 @@ public Configuration getConfig() { } @Override - public ApplicationId actionCreate(Service service) { - String serviceName = service.getName(); - ServiceApiUtil.validateNameFormat(serviceName, getConfig()); + public ApplicationId actionCreate(Service service) throws IOException { + ServiceApiUtil.validateAndResolveService(service, + new SliderFileSystem(conf), getConfig()); return ApplicationId.newInstance(System.currentTimeMillis(), 1); } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/ServiceClient.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/ServiceClient.java index f5e21ab976..5731e11a19 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/ServiceClient.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/ServiceClient.java @@ -210,7 +210,6 @@ public int actionLaunch(String fileName, String serviceName, Long lifetime, public ApplicationId actionCreate(Service service) throws IOException, YarnException { String serviceName = service.getName(); - ServiceApiUtil.validateNameFormat(serviceName, getConfig()); ServiceApiUtil.validateAndResolveService(service, fs, getConfig()); verifyNoLiveAppInRM(serviceName, "create"); Path appDir = checkAppNotExistOnHdfs(service);