use of org.ow2.proactive.scheduler.job.TaskDataSpaceApplication in project scheduling by ow2-proactive.
the class SchedulerDataspace method init.
public void init(JobId jobId, TaskId taskId, String user) throws Exception {
dataSpaceServiceStarter = DataSpaceServiceStarter.getDataSpaceServiceStarter();
dataSpaceServiceStarter.startNamingService();
taskDataSpaceApplication = new TaskDataSpaceApplication(taskId.toString(), dataSpaceServiceStarter.getNamingService());
taskDataSpaceApplication.startDataSpaceApplication(null, null, null, null, user, jobId);
}
use of org.ow2.proactive.scheduler.job.TaskDataSpaceApplication in project scheduling by ow2-proactive.
the class TestDataSpaceConfiguration method runStarter.
public Boolean runStarter() throws Exception {
File spFile = new File(IOSPACE);
File spFileWithUserDir = new File(IOSPACE, username);
spFile.mkdirs();
spFileWithUserDir.mkdirs();
spFileWithUserDir.deleteOnExit();
spFile.deleteOnExit();
filesServerIn = new FileSystemServerDeployer("space", IOSPACE, true, true);
String[] spaceurls = filesServerIn.getVFSRootURLs();
String[] userdirUrls = DataSpaceServiceStarter.urlsWithUserDir(spaceurls, username);
ArrayList<String> expected = new ArrayList<>();
expected.addAll(Arrays.asList(spaceurls));
ArrayList<String> expectedWithUserDir = new ArrayList<>();
expectedWithUserDir.addAll(Arrays.asList(userdirUrls));
PASchedulerProperties.DATASPACE_DEFAULTINPUT_URL.updateProperty(DataSpaceServiceStarter.urlsToDSConfigProperty(spaceurls));
PASchedulerProperties.DATASPACE_DEFAULTINPUT_LOCALPATH.updateProperty(IOSPACE);
PASchedulerProperties.DATASPACE_DEFAULTINPUT_HOSTNAME.updateProperty(HOSTNAME);
PASchedulerProperties.DATASPACE_DEFAULTOUTPUT_URL.updateProperty(DataSpaceServiceStarter.urlsToDSConfigProperty(spaceurls));
PASchedulerProperties.DATASPACE_DEFAULTOUTPUT_LOCALPATH.updateProperty(IOSPACE);
PASchedulerProperties.DATASPACE_DEFAULTOUTPUT_HOSTNAME.updateProperty(HOSTNAME);
PASchedulerProperties.DATASPACE_DEFAULTGLOBAL_URL.updateProperty(DataSpaceServiceStarter.urlsToDSConfigProperty(spaceurls));
PASchedulerProperties.DATASPACE_DEFAULTGLOBAL_LOCALPATH.updateProperty(IOSPACE);
PASchedulerProperties.DATASPACE_DEFAULTGLOBAL_HOSTNAME.updateProperty(HOSTNAME);
PASchedulerProperties.DATASPACE_DEFAULTUSER_URL.updateProperty(DataSpaceServiceStarter.urlsToDSConfigProperty(spaceurls));
PASchedulerProperties.DATASPACE_DEFAULTUSER_LOCALPATH.updateProperty(IOSPACE);
PASchedulerProperties.DATASPACE_DEFAULTUSER_HOSTNAME.updateProperty(HOSTNAME);
DataSpaceServiceStarter dsServiceStarter = DataSpaceServiceStarter.getDataSpaceServiceStarter();
dsServiceStarter.startNamingService();
Set<SpaceInstanceInfo> predefinedSpaces = new HashSet<>();
NamingService namingService = dsServiceStarter.getNamingService();
TaskDataSpaceApplication jdsa = new TaskDataSpaceApplication(appid, dsServiceStarter.getNamingService());
jdsa.startDataSpaceApplication(null, null, null, null, username, null);
DataSpacesNodes.configureApplication(PAActiveObject.getNode(), appid, dsServiceStarter.getNamingServiceURL());
DataSpacesFileObject INPUT = PADataSpaces.resolveDefaultInput();
DataSpacesFileObject OUTPUT = PADataSpaces.resolveDefaultOutput();
DataSpacesFileObject GLOBAL = PADataSpaces.resolveOutput(SchedulerConstants.GLOBALSPACE_NAME);
DataSpacesFileObject USER = PADataSpaces.resolveOutput(SchedulerConstants.USERSPACE_NAME);
Assert.assertEquals(expectedWithUserDir, INPUT.getAllRealURIs());
Assert.assertEquals(expectedWithUserDir, OUTPUT.getAllRealURIs());
Assert.assertEquals(expected, GLOBAL.getAllRealURIs());
Assert.assertEquals(expectedWithUserDir, USER.getAllRealURIs());
jdsa.terminateDataSpaceApplication();
return true;
}
use of org.ow2.proactive.scheduler.job.TaskDataSpaceApplication in project scheduling by ow2-proactive.
the class InternalJob method startDataSpaceApplication.
/**
* Start dataspace configuration and application
*/
public void startDataSpaceApplication(NamingService namingService, List<InternalTask> tasks) {
if (taskDataSpaceApplications == null) {
taskDataSpaceApplications = new HashMap<>();
}
for (InternalTask internalTask : tasks) {
long taskId = internalTask.getId().longValue();
// if a task restart due to a failure for instance
if (!taskDataSpaceApplications.containsKey(taskId)) {
String appId = internalTask.getId().toString();
TaskDataSpaceApplication taskDataSpaceApplication = new TaskDataSpaceApplication(appId, namingService);
taskDataSpaceApplications.put(taskId, taskDataSpaceApplication);
taskDataSpaceApplication.startDataSpaceApplication(getInputSpace(), getOutputSpace(), getGlobalSpace(), getUserSpace(), getOwner(), getId());
}
}
}
Aggregations