YARN-7985. Removed duplicate service name validation in Yarn Service.

Contributed by Chandni Singh
This commit is contained in:
Eric Yang 2018-02-28 20:48:55 -05:00
parent 315f48e791
commit 17f387e3c2
2 changed files with 4 additions and 4 deletions

View File

@ -26,6 +26,7 @@ import org.apache.hadoop.yarn.exceptions.YarnException;
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 class ServiceClientTest extends ServiceClient {
}
@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);
}

View File

@ -210,7 +210,6 @@ public class ServiceClient extends AppAdminClient implements SliderExitCodes,
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);