Package edu.vt.rt.hyflow.core

Examples of edu.vt.rt.hyflow.core.AbstractDistinguishable


    }

    Logger.debug("Release Write-Set");
    for(AbstractDistinguishable obj: writeSet){
      if(LockTable.setAndReleaseLock( obj, newClock, locksMarker)){  // is it remote
        AbstractDistinguishable object = (AbstractDistinguishable)obj;
        GlobalObject key = ObjectsRegistery.getKey(object.getId());
        if(key==null){
          System.out.println("TTTTT:"+object.getId());
          continue;
        }
        Logger.debug("I'm new owner of " + key);
        key.setHome(PE.thisPE())// me is the new owner
        ObjectsRegistery.regsiterObject(key)// register key local
View Full Code Here


    Logger.debug("Release Write-Set");
    for(AbstractDistinguishable obj: writeSet){
      if(LockTable.setAndReleaseLock( obj, newClock, locksMarker)){  // is it remote
       
        AbstractDistinguishable object = (AbstractDistinguishable)obj;
        GlobalObject key = ObjectsRegistery.getKey(object.getId());
        if(key==null){
          System.out.println("TTTTT:"+object.getId());
          continue;
        }
       
        key.setHome(PE.thisPE())// me is the new owner
        ObjectsRegistery.regsiterObject(key)// register key local
        locator.newObject(key, object)// register at the directory manager
        PE.thisPE().populate(new RegisterObject(key))// populate me as the new owner
        Logger.debug("Populate me owner of " + key);
        // FIXME: if more than one local transaction at this node then we should release the object now not before changing its location
      }
    }

    //System.out.println(" Wake up other tasks " + tid);
    for(Object obj : objPrevOwnerAddressMap.keySet()) {
      //System.out.println("From my address " + PE.thisPE().getAddress() + " Send signal request to " + obj + " owner" + objPrevOwnerAddressMap.get(obj));

      if(!objPrevOwnerAddressMap.get(obj).equals(PE.thisPE().getAddress())) {
        //try {
          AbstractDistinguishable object = (AbstractDistinguishable)obj;
          GlobalObject key = ObjectsRegistery.getKey(object.getId());
          //CommunicationManager.getManager().send(objPrevOwnerAddressMap.get(obj), new SignalWaitingTxRequest(key, tid, obj, deadline_ts, period_ts));
          TransactionWaitQueue.remoteWaitQueueRequest(this, key, object);
        //} catch (IOException ex) {
        //  ex.printStackTrace();
        //}
View Full Code Here

          Logger.debug("Retrieve fail for no owner " + key);
          throw new NotRegisteredKeyException(key);
        }
        if(owner.equals(PE.thisPE().getAddress())){
          Logger.debug("Try get locally" + key);
          AbstractDistinguishable object = local.get(key);
          object.setShared(mode.equals("s"));
          if(object!=null){
            Logger.debug("Got locally " + key);
            return object;
          }
        }
       
        // contact owner
        new Retrieve(key, hash).send(owner);
        Logger.debug("Wait for object " + key);
        try {
          context.wait();
        } catch (InterruptedException e) {
          e.printStackTrace();
        }
        Logger.debug("Wait for object response " + key);
        Object[] data = (Object[])repliesQueue.get(hash);
        pendingObject = data[0];
        if(pendingObject==null){
          Logger.debug("Retrieve fail for no owner " + key);
          throw FAIL_RETRIEVE;
        }
        AbstractDistinguishable distinguishable = ((AbstractDistinguishable)pendingObject);
        distinguishable.setOwnerNode(owner);
        distinguishable.setShared(mode.equals("s"));
       
        int senderClock = (Integer)data[1];
        if(senderClock>=0)
          ((Context)context).forward(senderClock);
      }
View Full Code Here

          Logger.debug("Retrieve fail for no owner " + key);
          throw new NotRegisteredKeyException(key);
        }
        if(owner.equals(PE.thisPE().getAddress())){
          Logger.debug("Try get locally" + key);
          AbstractDistinguishable object = local.get(key);
          object.setShared(mode.equals("s"));
          if(object!=null){
            Logger.debug("Got locally " + key);
            return object;
          }
        }
       
        // contact owner
        new Retrieve(key, hash, deadline).send(owner);
        Logger.debug("Wait for object " + key);
        try {
          context.wait();
        } catch (InterruptedException e) {
          e.printStackTrace();
        }
        Logger.debug("Wait for object response " + key);
        Object[] data = (Object[])repliesQueue.get(hash);
        pendingObject = data[0];
        if(pendingObject==null){
          Logger.debug("Retrieve fail for no owner " + key);
          throw FAIL_RETRIEVE;
        }
        AbstractDistinguishable distinguishable = ((AbstractDistinguishable)pendingObject);
        distinguishable.setOwnerNode(owner);
        distinguishable.setShared(mode.equals("s"));
       
        int senderClock = (Integer)data[1];
        if(senderClock>=0)
          ((Context)context).forward(senderClock);
      }
View Full Code Here

    Network.linkDelay(false, from);
    try {
      int localClock = LocalClock.get();
      if(senderClock>localClock)
        LocalClock.advance(senderClock);
      AbstractDistinguishable object = TrackerDirectory.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;
View Full Code Here

    boolean success = false;
    try {
      int localClock = LocalClock.get();
      if(senderClock>localClock)
        LocalClock.advance(senderClock);
      AbstractDistinguishable object = ((TrackerDirectory)DirectoryManager.getManager()).getLocalObject(key);
      if(object!=null){
        if(!lock){
          LockTable.unLock(object, null);
          Logger.debug("Remote Unlocked " + key);
          return;
View Full Code Here

        Map<Object, AbstractDistinguishable> set = new HashMap<Object, AbstractDistinguishable>();
        for(ReadObjectAccess field: readSet){
          Object obj = field.getObject();
          if(obj!=null){
              if(obj instanceof AbstractDistinguishable){
                AbstractDistinguishable dist = (AbstractDistinguishable) obj;
                if(dist.isShared()){
                    Logger.debug("Skip " + obj);
                  continue;
                }
                set.put(dist.getId(), dist);
              }
            Logger.debug("Add " + obj);
          }
          else
            break;
        }
        Logger.debug("Readlist " + set.size());
       
          for (AbstractDistinguishable obj: set.values()) {
            if(LockTable.checkLock( obj, clock, false)<0){
              AbstractDistinguishable object = (AbstractDistinguishable)obj;
              try {
                try {
              CommunicationManager.getManager().send(obj.getOwnerNode(), new ValidateRequest(obj.getId(), hashCode));
            } catch (IOException e) {
              e.printStackTrace();
View Full Code Here

    Map<Object, AbstractDistinguishable> set = new HashMap<Object, AbstractDistinguishable>();
    System.out.println("Constructing Sorted list");
    for(WriteObjectAccess field: this){
      Object obj = field.getObject();
      if(obj instanceof AbstractDistinguishable){
        AbstractDistinguishable dist = (AbstractDistinguishable) obj;
        set.put(dist.getId(), dist);
      }
    }
    System.out.println("Writelist " + set.size());
    AbstractDistinguishable[] items = set.values().toArray(new AbstractDistinguishable[0]);
    Arrays.sort(items, new Comparator<AbstractDistinguishable>() {
View Full Code Here

    boolean success = false;
    try {
      int localClock = LocalClock.get();
      if(senderClock>localClock)
        LocalClock.advance(senderClock);
      AbstractDistinguishable object = ((DTL2Directory)DirectoryManager.getManager()).getLocalObject(key);
      if(object!=null){
        if(!lock){
          LockTable.unLock(object, null);
          Logger.debug("Remote Unlocked " + key);
          return;
View Full Code Here

    try {
      try {
        int localClock = LocalClock.get();
        if(senderClock>localClock)
          LocalClock.advance(senderClock);
        AbstractDistinguishable object = ((DTL2Directory)DirectoryManager.getManager()).getLocalObject(key);
        if(object!=null){
          if(!lock){
            LockTable.unLock(object, null);
            return;
          }
View Full Code Here

TOP

Related Classes of edu.vt.rt.hyflow.core.AbstractDistinguishable

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.