Package aleph.dir

Examples of aleph.dir.DirectoryManager.open()


      }while(next!=null);
//      System.out.println("NOT FOUND!");
      return false;
    } finally{
      if(prev!=null){
        Node lastPrev = ((Node)locator.open(prev, "r"))// reopen last node for read
        lastPrev.getValue(__transactionContext__)// force add to the readset
      }
      if(node!=null){
        Node last = ((Node)locator.open(node.getId(), "r"))// reopen last node for read
        last.getValue(__transactionContext__)// force add to the readset
View Full Code Here


      if(prev!=null){
        Node lastPrev = ((Node)locator.open(prev, "r"))// reopen last node for read
        lastPrev.getValue(__transactionContext__)// force add to the readset
      }
      if(node!=null){
        Node last = ((Node)locator.open(node.getId(), "r"))// reopen last node for read
        last.getValue(__transactionContext__)// force add to the readset
      }
      try {
        edu.vt.rt.hyflow.benchmark.Benchmark.processingDelay();
      } catch (InterruptedException e) {
View Full Code Here

    throw new TransactionException("Failed to commit the transaction in the defined retries.");
  }
  public int sum(Context __transactionContext__){
    try{
      DirectoryManager locator = HyFlow.getLocator();
      return sum((Node)locator.open(HEAD), __transactionContext__) + 1;
    } finally{
      try {
        edu.vt.rt.hyflow.benchmark.Benchmark.processingDelay();
      } catch (InterruptedException e) {
        // TODO Auto-generated catch block
View Full Code Here

 
  private int sum(Node node, Context __transactionContext__){
    int sum = node.getValue(__transactionContext__);
    DirectoryManager locator = HyFlow.getLocator();
    if(node.getLeftChild(__transactionContext__)!=null)
      sum += sum((Node)locator.open(node.getLeftChild(__transactionContext__)), __transactionContext__);
    if(node.getRightChild(__transactionContext__)!=null)
      sum += sum((Node)locator.open(node.getRightChild(__transactionContext__)), __transactionContext__);
    return sum;
  }
View Full Code Here

    int sum = node.getValue(__transactionContext__);
    DirectoryManager locator = HyFlow.getLocator();
    if(node.getLeftChild(__transactionContext__)!=null)
      sum += sum((Node)locator.open(node.getLeftChild(__transactionContext__)), __transactionContext__);
    if(node.getRightChild(__transactionContext__)!=null)
      sum += sum((Node)locator.open(node.getRightChild(__transactionContext__)), __transactionContext__);
    return sum;
  }

}
View Full Code Here

    if(nodeId==1){ // just one node view output
      System.out.println("Sleep till transactions complete");
      Thread.sleep(10000);
      for(int i=1; i<args.length; i++){
       
        BankAccount account = (BankAccount)locator.open(args[i], "r");
        System.out.println(account.checkBalance());
        locator.release(account);

        BankAccount account2 = (BankAccount)locator.open(args[i], "r");
        System.out.println(account2.checkBalance());
View Full Code Here

       
        BankAccount account = (BankAccount)locator.open(args[i], "r");
        System.out.println(account.checkBalance());
        locator.release(account);

        BankAccount account2 = (BankAccount)locator.open(args[i], "r");
        System.out.println(account2.checkBalance());
        locator.release(account2);
      }
    }
   
View Full Code Here

    account .deposit(50);

    DirectoryManager locator = HyFlow.getLocator();
   
    System.out.println("Acquire1");
    BankAccount account1 = (BankAccount)locator.open("5-123");
    System.out.println("Release1");
//    locator.release(account1);
   
    System.out.println("Acquire2");
    BankAccount account2 = (BankAccount)locator.open("5-123");
View Full Code Here

    BankAccount account1 = (BankAccount)locator.open("5-123");
    System.out.println("Release1");
//    locator.release(account1);
   
    System.out.println("Acquire2");
    BankAccount account2 = (BankAccount)locator.open("5-123");
    System.out.println("Release2");
    locator.release(account1);
   
    System.out.println("Complete Test");
    System.exit(0);
View Full Code Here

    Thread.sleep(1000);
   
    // Remote accounts
    DirectoryManager locator = HyFlow.getLocator();
    for(int i=1; i<args.length; i++){
        BankAccount account = (BankAccount)locator.open(args[i]);
        if(account!=null){
          account.deposit(50);
          System.out.println(account.withdraw(10*Integer.parseInt(args[0])));
          locator.release(account);
        }
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.