YARN-7985. Removed duplicate service name validation in Yarn Service.
Contributed by Chandni Singh
This commit is contained in:
parent
315f48e791
commit
17f387e3c2
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user