Package aleph.comm

Examples of aleph.comm.Address


      }
*/
      level++;
//      System.out.println("child at level "+ level+" : " + logic.get(level).childpath.get(key));
           
      Address homeParent = ((Ballistic)DirectoryManager.getManager()).getHomeParent(level);
      if (homeParent != null)
      {
        try {
          System.out.println("calling resgister");
          send(homeParent);
View Full Code Here


  //    System.out.println("We go up at node " + nodeID + " at level " + level);
      List<List<Integer>> parents = struc.getStructure(lookup_distance,move_distance, nodeID, level);
     
      if(parents != null)
      {
        Address home = Network.getAddress(parents.get(2).get(0).toString());
        Address ph = null ;
       
        int i;
        //move or lookup condition
        int j=0;
        if(cut==true)
View Full Code Here

       
      }
      else
      {
 
        Address p = logic.get(level).childpath.get(key) ;
  //      System.out.println("the logical node at level "+level + "contains the address " +logic.get(level).childpath.get(key));
       
        if(cut==true)
        {
  /*        System.out.println("we remove the address "+logic.get(level).childpath.get(key).toString() +"at level "+level);
View Full Code Here

 
  // This is the lookup function
  void lookup(GlobalObject key) throws IOException
  {
//    System.out.println("lnode " + nodeID + " at level 0");
    Address home = getHomeParent(0);
    Address original_caller = PE.thisPE().getAddress();
    System.out.println("We call up with lookup");
    // We call the up function with the boolean FALSE for lookup
    CommunicationManager.getManager().send(home, new Up(1,false,original_caller,key,0));
  }
View Full Code Here

  void move(GlobalObject key) throws IOException
  {
//    System.out.println("unode " + nodeID + " at level 0");

    // We get the home parent of the node
    Address home = getHomeParent(0);
    // we set up the new path
    CommunicationManager.getManager().send(home, new addchild(PE.thisPE().getAddress(),1,key));
   
//    System.out.println("We call up with move");
    // We call the up function with the boolean FALSE for lookup
    Address original_caller = PE.thisPE().getAddress();
    CommunicationManager.getManager().send(home, new Up(1,true,original_caller,key,0));
  }
View Full Code Here

    AbstractDistinguishable[] writeSet = this.writeSet.sortedItems();
    try
    {
      for(AbstractDistinguishable obj : writeSet){
        Object key = obj.getId();
        Address owner = obj.getOwnerNode();
        Logger.debug("Validating: " + key);
       
        if(!LockTable.lock(obj, locksMarker)){
          LockTable.remoteLockRequest(this, key, owner);
          if(!pendingLock){
View Full Code Here

  @Override
  public void register(AbstractDistinguishable object) {
    Object key = object.getId();
    local.put(key, object);
    try {
      Address tracker = getTracker(key);
      Logger.debug("Register tracker of " + key + " at " + tracker);
      new Register(key).send(tracker)// register me as the owner
    } catch (IOException e) {
      e.printStackTrace();
    }
View Full Code Here

      synchronized(context){
        long hash = context.hashCode()+System.currentTimeMillis();
        pendingContexts.put(hash, context);
       
        // get tracker
        Address tracker = getTracker(key);
        new WhoOwner(key, hash).send(tracker);
        Logger.debug("Wait for owner of " + key + " at " + tracker);
        try {
          context.wait();
        } catch (InterruptedException e) {
          e.printStackTrace();
        }
        Logger.debug("Wait for owner response " + key);
        Address owner = (Address)repliesQueue.get(hash);
        if(owner==null){
          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);
View Full Code Here

      synchronized(context){
        long hash = context.hashCode()+System.currentTimeMillis();
        pendingContexts.put(hash, context);
       
        // get tracker
        Address tracker = getTracker(key);
        new WhoOwner(key, hash).send(tracker);
        Logger.debug("Wait for owner of " + key + " at " + tracker);
        try {
          context.wait();
        } catch (InterruptedException e) {
          e.printStackTrace();
        }
        Logger.debug("Wait for owner response " + key);
        Address owner = (Address)repliesQueue.get(hash);
        if(owner==null){
          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);
View Full Code Here

  public void run() {
    Network.linkDelay(false, from);
    try {
     
      for(int i=0; i<5; i++){
        Address owner = TrackerDirectory.directory.get(key);
        if(owner!=null){
          new Owner(owner, hash).send(from);
          return;
        }
        try {
View Full Code Here

TOP

Related Classes of aleph.comm.Address

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.