Package edu.vt.rt.hyflow.core.tm.undoLog

Examples of edu.vt.rt.hyflow.core.tm.undoLog.AbstractLoggableObject


    // self-check validation
    if(isAborted())
      throw new TransactionException();
    // add to read-set
    if(obj instanceof AbstractLoggableObject){
      AbstractLoggableObject loggable = (AbstractLoggableObject)obj;
      Object[] metadata = registery.get(txnId);
      synchronized(metadata){
        Logger.debug(loggable.getId() + ":added to readset of: " + this);
        readset.add(new ReadEntry(loggable));
      }
    }
    Logger.debug(this + ":Accessed R: " + obj);
  }
View Full Code Here


        List<WriteEntry> writeSet = ((List<WriteEntry>)metadata[WRITE_SET_INDEX]);
        Logger.debug(txnId + ": Writeset: " + writeSet.size());
        while(true)
          try {
            for(Iterator<WriteEntry> itr=writeSet.iterator(); itr.hasNext(); ){
              AbstractLoggableObject reference = itr.next().reference;
              if(reference instanceof AbstractDistinguishable){
                boolean exists = acquiredObjects.add((AbstractDistinguishable)reference);
                Logger.debug("Adding object:" + reference + " " + exists);
              }
              else
View Full Code Here

    if(metadata==null// already aborted
      return false;

    for(Iterator<WriteEntry> itr=((List<WriteEntry>)metadata[WRITE_SET_INDEX]).iterator(); itr.hasNext(); )
      try {
        AbstractLoggableObject loggable = itr.next().reference;
        while(!loggable.__own((Context)metadata[CONTEXT_INDEX])){  // try to set me as the owner
          int res = HyFlow.getConflictManager().resolve((Context)metadata[CONTEXT_INDEX], loggable.__getOwner());
          if(res==0)
            loggable.__release();
          if(res > 0)
            try {
              Thread.currentThread().sleep(res);
            } catch (InterruptedException e) {
              e.printStackTrace();
View Full Code Here

    // self-check validation
    if(isAborted())
      throw new TransactionException();
    // add to read-set
    if(obj instanceof AbstractLoggableObject){
      AbstractLoggableObject loggable = (AbstractLoggableObject)obj;
      while(!loggable.__isFree(getContextId())){
        Logger.debug(this + ":" + loggable.getId() + ":is not free : " + loggable.__getOwner());
       
        // resolve contention  R/W
        int res = HyFlow.getConflictManager().resolve(this, loggable.__getOwner());
        if(res==0)
          loggable.__release();
        if(res > 0)
          try {
            Thread.sleep(res);
          } catch (InterruptedException e) {
            e.printStackTrace();
          }
      }
     
      Object[] metadata = registery.get(txnId);
      synchronized(metadata){
        Logger.debug(loggable.getId() + ":added to readset of: " + this);
        readset.add(new ReadEntry(loggable));
      }
    }
   
    Logger.debug(this + ":Accessed R: " + obj);
View Full Code Here

    if(isAborted())
      throw new TransactionException();
    Logger.debug(this + ":Try access: " + obj);
    // add to write-set
    if(obj instanceof AbstractLoggableObject){
      AbstractLoggableObject loggable = (AbstractLoggableObject)obj;
      while(!loggable.__own(this)){  // try to set me as the owner
        // resolve contention  W/W
        int res = HyFlow.getConflictManager().resolve(this, loggable.__getOwner());
        if(res==0)
          loggable.__release();
        if(res > 0)
          try {
            Thread.sleep(res);
          } catch (InterruptedException e) {
            e.printStackTrace();
          }
      }

      Object[] metadata = registery.get(txnId);
      if(metadata==null){  // aborted
        loggable.__release();
        HyFlow.getLocator().release(loggable)//release owned object
      }
      synchronized(metadata){
        if(!isAborted()){
          Logger.debug(loggable.getId() + ":added to writeset of: " + this);
          writeset.add(new WriteEntry(loggable, field));
        }else{
          loggable.__release();
          HyFlow.getLocator().release(loggable)//release owned object
        }
      }
     
    }
View Full Code Here

        List<WriteEntry> writeSet = ((List<WriteEntry>)metadata[WRITE_SET_INDEX]);
        Logger.debug(txnId + ": Writeset: " + writeSet.size());
        while(true)
          try {
            for(Iterator<WriteEntry> itr=writeSet.iterator(); itr.hasNext(); ){
              AbstractLoggableObject reference = itr.next().reference;
              if(reference instanceof AbstractDistinguishable){
                boolean exists = acquiredObjects.add((AbstractDistinguishable)reference);
                Logger.debug("Adding object:" + reference + " " + exists);
              }
              else
View Full Code Here

TOP

Related Classes of edu.vt.rt.hyflow.core.tm.undoLog.AbstractLoggableObject

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.