use of es.bsc.compss.types.uri.MultiURI in project compss by bsc-wdc.
the class SharedLocation method getURIs.
@Override
public List<MultiURI> getURIs() {
List<MultiURI> uris = new LinkedList<>();
List<Resource> resList = SharedDiskManager.getAllMachinesfromDisk(this.diskName);
Resource[] resources;
synchronized (resList) {
resources = resList.toArray(new Resource[resList.size()]);
}
for (Resource host : resources) {
String diskPath = SharedDiskManager.getMounpoint(host, this.diskName);
if (!diskPath.endsWith(File.separator)) {
diskPath = diskPath + File.separator;
}
uris.add(new MultiURI(this.protocol, host, diskPath + this.path));
}
return uris;
}
use of es.bsc.compss.types.uri.MultiURI in project compss by bsc-wdc.
the class COMPSsRuntimeImpl method mainAccessToFile.
private String mainAccessToFile(String fileName, DataLocation loc, AccessMode am, String destDir) {
// Tell the AP that the application wants to access a file.
FileAccessParams fap = new FileAccessParams(am, loc);
DataLocation targetLocation = ap.mainAccessToFile(loc, fap, destDir);
// Checks on target
String path = (targetLocation == null) ? fileName : targetLocation.getPath();
DataLocation finalLocation = (targetLocation == null) ? loc : targetLocation;
if (finalLocation == null) {
ErrorManager.fatal(ERROR_FILE_NAME);
return null;
}
// Return the final target path
String finalPath;
MultiURI u = finalLocation.getURIInHost(Comm.getAppHost());
if (u != null) {
finalPath = u.getPath();
} else {
finalPath = path;
}
return finalPath;
}
Aggregations