Search in sources :

Example 11 with MultiURI

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;
}
Also used : MultiURI(es.bsc.compss.types.uri.MultiURI) Resource(es.bsc.compss.types.resources.Resource) LinkedList(java.util.LinkedList)

Example 12 with MultiURI

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;
}
Also used : MultiURI(es.bsc.compss.types.uri.MultiURI) DataLocation(es.bsc.compss.types.data.location.DataLocation) FileAccessParams(es.bsc.compss.types.data.AccessParams.FileAccessParams)

Aggregations

MultiURI (es.bsc.compss.types.uri.MultiURI)12 LogicalData (es.bsc.compss.types.data.LogicalData)5 DataLocation (es.bsc.compss.types.data.location.DataLocation)5 Resource (es.bsc.compss.types.resources.Resource)5 LinkedList (java.util.LinkedList)5 UnstartedNodeException (es.bsc.compss.exceptions.UnstartedNodeException)3 CopyException (es.bsc.compss.exceptions.CopyException)2 Data (es.bsc.compss.nio.commands.Data)2 Copy (es.bsc.compss.types.data.operation.copy.Copy)2 File (java.io.File)2 IOException (java.io.IOException)2 StorageException (storage.StorageException)2 CannotLoadException (es.bsc.compss.exceptions.CannotLoadException)1 GATCopyException (es.bsc.compss.gat.master.exceptions.GATCopyException)1 NIOURI (es.bsc.compss.nio.NIOURI)1 DataRequest (es.bsc.compss.nio.dataRequest.DataRequest)1 MasterDataRequest (es.bsc.compss.nio.dataRequest.MasterDataRequest)1 SerializedObjectException (es.bsc.compss.nio.exceptions.SerializedObjectException)1 FileAccessParams (es.bsc.compss.types.data.AccessParams.FileAccessParams)1 PersistentLocation (es.bsc.compss.types.data.location.PersistentLocation)1