use of es.bsc.compss.types.resources.Resource in project compss by bsc-wdc.
the class PersistentLocation method getHosts.
@Override
public List<Resource> getHosts() {
LOGGER.debug("Get PSCO locations for " + this.id);
// Retrieve locations from Back-end
List<String> locations = null;
try {
locations = StorageItf.getLocations(this.id);
} catch (StorageException e) {
ErrorManager.error("ERROR: Cannot retrieve locations of " + this.id + " from Storage Back-end");
}
if (locations == null) {
ErrorManager.error("ERROR: Cannot retrieve locations of " + this.id + " from Storage Back-end");
}
// Get hosts
List<Resource> hosts = new LinkedList<>();
for (String hostName : locations) {
Resource host = Resource.getResource(hostName);
if (host != null) {
hosts.add(host);
} else {
LOGGER.warn("Storage Back-End returned non-registered host " + hostName);
}
}
return hosts;
}
use of es.bsc.compss.types.resources.Resource 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;
}
Aggregations