Logger.debug(mode + "| Retrieve request received from " + from + " for " + key + "[" + key.hashCode() + "]");
key.setHome(PE.thisPE()); // adjust the PE error
int localClock = LocalClock.get();
if(senderClock>localClock)
LocalClock.advance(senderClock);
AbstractDistinguishable object = DTL2Directory.local.get(key);
if(object==null)
Logger.debug("Null local object!");
else if(LockTable.isAvailable(object)){ // check if currently locked
Logger.debug("Locked object");
object = null;
}else{
GlobalObject globalObject = ObjectsRegistery.getKey(object.getId());
if(globalObject==null){
Logger.debug("Deleted object.");
object = null;
}else if(globalObject.getVersion()!=key.getVersion()){
Logger.debug("Old GlobalObject was used to retreive object, retry later.");
object = null;
}
}
int lockVersion = object==null ? 0 : LockTable.getLockVersion(object);
Logger.debug("Sending object " + object + "@" + lockVersion + " back");
// check for earleir deadline transactions already in queue
if(object != null && txMode.equals("w")) {
String ObjID = object.toString().substring(0, object.toString().indexOf("---"));
boolean addResult = CoarseObjectThreadMap.addThreadEntry(ObjID, deadline, threadID, context.hashCode(), from); // "from" because request received from "from"
if(addResult == false)
flagEarlierTx = DTL2Directory.EARLIER_TX_PRESENT;
}