use of es.bsc.compss.types.data.LogicalData in project compss by bsc-wdc.
the class Resource method getData.
/**
* Retrieves a given data
*
* @param dataId
* @param target
* @param tgtData
* @param reason
* @param listener
*/
public void getData(String dataId, DataLocation target, LogicalData tgtData, Transferable reason, EventListener listener) {
LogicalData ld = Comm.getData(dataId);
getData(ld, target, tgtData, reason, listener);
}
use of es.bsc.compss.types.data.LogicalData in project compss by bsc-wdc.
the class AccessProcessor method obtainObject.
/**
* Adds a request to obtain an object from a worker to the master
*
* @param oaId
* @return
*/
private Object obtainObject(DataAccessId oaId) {
LOGGER.debug("Obtain object with id " + oaId);
// Ask for the object
Semaphore sem = new Semaphore(0);
TransferObjectRequest tor = new TransferObjectRequest(oaId, sem);
if (!requestQueue.offer(tor)) {
ErrorManager.error(ERROR_QUEUE_OFFER + "obtain object");
}
// Wait for response
sem.acquireUninterruptibly();
// Get response
Object oUpdated = tor.getResponse();
if (oUpdated == null) {
/*
* The Object didn't come from a WS but was transferred from a worker, we load it from its storage (file or
* persistent)
*/
LogicalData ld = tor.getLogicalDataTarget();
try {
ld.loadFromStorage();
oUpdated = ld.getValue();
} catch (CannotLoadException e) {
LOGGER.fatal(ERROR_OBJECT_LOAD_FROM_STORAGE + ": " + ((ld == null) ? "null" : ld.getName()), e);
ErrorManager.fatal(ERROR_OBJECT_LOAD_FROM_STORAGE + ": " + ((ld == null) ? "null" : ld.getName()), e);
}
}
return oUpdated;
}
Aggregations