Search in sources :

Example 1 with DeferredCopy

use of es.bsc.compss.types.data.operation.copy.DeferredCopy in project compss by bsc-wdc.

the class Dispatcher method processRequests.

public void processRequests() {
    DataOperation fOp;
    while (true) {
        fOp = queue.dequeue();
        if (fOp == null) {
            break;
        }
        // What kind of operation is requested?
        if (fOp instanceof ImmediateCopy) {
            // File transfer (copy)
            ImmediateCopy c = (ImmediateCopy) fOp;
            c.perform();
        } else if (fOp instanceof DeferredCopy) {
        // DO nothing
        } else {
            // fOp instanceof Delete
            Delete d = (Delete) fOp;
            performOperation(d);
        }
    }
}
Also used : DeferredCopy(es.bsc.compss.types.data.operation.copy.DeferredCopy) Delete(es.bsc.compss.types.data.operation.Delete) DataOperation(es.bsc.compss.types.data.operation.DataOperation) ImmediateCopy(es.bsc.compss.types.data.operation.copy.ImmediateCopy)

Example 2 with DeferredCopy

use of es.bsc.compss.types.data.operation.copy.DeferredCopy in project compss by bsc-wdc.

the class NIOWorkerNode method sendData.

@Override
public void sendData(LogicalData ld, DataLocation source, DataLocation target, LogicalData tgtData, Transferable reason, EventListener listener) {
    if (target.getHosts().contains(Comm.getAppHost())) {
        // Order petition directly
        if (tgtData != null) {
            MultiURI u = ld.alreadyAvailable(Comm.getAppHost());
            if (u != null) {
                // Already present at the master
                reason.setDataTarget(u.getPath());
                listener.notifyEnd(null);
                return;
            }
        }
        Copy c = new DeferredCopy(ld, null, target, tgtData, reason, listener);
        Data d = new Data(ld);
        if (source != null) {
            for (MultiURI uri : source.getURIs()) {
                try {
                    NIOURI nURI = (NIOURI) uri.getInternalURI(NIOAdaptor.ID);
                    if (nURI != null) {
                        d.getSources().add(nURI);
                    }
                } catch (UnstartedNodeException une) {
                // Ignore internal URI
                }
            }
        }
        String path = target.getURIInHost(Comm.getAppHost()).getPath();
        c.setFinalTarget(path);
        ld.startCopy(c, c.getTargetLoc());
        DataRequest dr = new MasterDataRequest(c, reason.getType(), d, path);
        commManager.addTransferRequest(dr);
        commManager.requestTransfers();
    } else {
        // Request to any other
        orderCopy(new DeferredCopy(ld, source, target, tgtData, reason, listener));
    }
}
Also used : DeferredCopy(es.bsc.compss.types.data.operation.copy.DeferredCopy) MultiURI(es.bsc.compss.types.uri.MultiURI) DeferredCopy(es.bsc.compss.types.data.operation.copy.DeferredCopy) Copy(es.bsc.compss.types.data.operation.copy.Copy) StorageCopy(es.bsc.compss.types.data.operation.copy.StorageCopy) UnstartedNodeException(es.bsc.compss.exceptions.UnstartedNodeException) LogicalData(es.bsc.compss.types.data.LogicalData) Data(es.bsc.compss.nio.commands.Data) MasterDataRequest(es.bsc.compss.nio.dataRequest.MasterDataRequest) DataRequest(es.bsc.compss.nio.dataRequest.DataRequest) MasterDataRequest(es.bsc.compss.nio.dataRequest.MasterDataRequest) NIOURI(es.bsc.compss.nio.NIOURI)

Aggregations

DeferredCopy (es.bsc.compss.types.data.operation.copy.DeferredCopy)2 UnstartedNodeException (es.bsc.compss.exceptions.UnstartedNodeException)1 NIOURI (es.bsc.compss.nio.NIOURI)1 Data (es.bsc.compss.nio.commands.Data)1 DataRequest (es.bsc.compss.nio.dataRequest.DataRequest)1 MasterDataRequest (es.bsc.compss.nio.dataRequest.MasterDataRequest)1 LogicalData (es.bsc.compss.types.data.LogicalData)1 DataOperation (es.bsc.compss.types.data.operation.DataOperation)1 Delete (es.bsc.compss.types.data.operation.Delete)1 Copy (es.bsc.compss.types.data.operation.copy.Copy)1 ImmediateCopy (es.bsc.compss.types.data.operation.copy.ImmediateCopy)1 StorageCopy (es.bsc.compss.types.data.operation.copy.StorageCopy)1 MultiURI (es.bsc.compss.types.uri.MultiURI)1