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);
}
}
}
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));
}
}
Aggregations