Package aleph.dir

Examples of aleph.dir.DirectoryManager


   * @see edu.vt.rt.datastructures.lang.DistributedSet#add(java.io.Serializable)
   */
  @Atomic
  @Override
  public boolean add(E item) {
    DirectoryManager locator = HyFlow.getLocator();
    IDContainer<DistributedImmutableBST<E>> container = (IDContainer<DistributedImmutableBST<E>>) locator.open(containerID, "r");
    final DistributedImmutableBST<E> tree = container.getItem();
    if (tree == null) {
      container.setItem(new DistributedImmutableBST(item));
      return true;
    }
    final DistributedImmutableBST<E> newTree = tree.add(item);
    if (newTree == tree) {
      return false;
    }
    container = (IDContainer<DistributedImmutableBST<E>>) locator.open(containerID, "w");
    container.setItem(newTree);
    return true;
  }
View Full Code Here


    new IDContainer<DistributedImmutableBST<E>>(containerID);
  }

  @Atomic
  private DistributedImmutableBST<E> getRoot() {
    DirectoryManager locator = HyFlow.getLocator();
    IDContainer<DistributedImmutableBST<E>> container = (IDContainer<DistributedImmutableBST<E>>) locator.open(containerID, "r");
    return container.getItem();
  }
View Full Code Here

   * @see edu.vt.rt.datastructures.lang.DistributedSet#remove(java.io.Serializable)
   */
  @Atomic
  @Override
  public boolean remove(E item) {
    DirectoryManager locator = HyFlow.getLocator();
    IDContainer<DistributedImmutableBST<E>> container = (IDContainer<DistributedImmutableBST<E>>) locator.open(containerID, "r");
    final DistributedImmutableBST<E> tree = container.getItem();
    if (tree == null) {
      return false;
    }
    final DistributedImmutableBST<E> newTree = tree.remove(item);
    if (newTree == tree) {
      return false;
    }
    container = (IDContainer<DistributedImmutableBST<E>>) locator.open(containerID, "w");
    container.setItem(newTree);
    return true;
  }
View Full Code Here

   * @see edu.vt.rt.datastructures.lang.DistributedSet#add(java.io.Serializable)
   */
  @Atomic
  @Override
  public boolean add(E value) {
    DirectoryManager locator = HyFlow.getLocator();
    BST<E> tree = (BST<E>) locator.open(treeID, "w");
    return tree.add(value);
  }
View Full Code Here

   * @see edu.vt.rt.datastructures.lang.DistributedSet#contains(java.io.Serializable)
   */
  @Atomic
  @Override
  public boolean contains(E value) {
    DirectoryManager locator = HyFlow.getLocator();
    BST<E> tree = (BST<E>) locator.open(treeID, "r");
    return tree.contains(value);
  }
View Full Code Here

   * @see edu.vt.rt.datastructures.lang.DistributedSet#remove(java.io.Serializable)
   */
  @Atomic
  @Override
  public boolean remove(E value) {
    DirectoryManager locator = HyFlow.getLocator();
    BST<E> tree = (BST<E>) locator.open(treeID, "w");
    return tree.remove(value);
  }
View Full Code Here

   * @see edu.vt.rt.datastructures.lang.DistributedSet#add(java.io.Serializable)
   */
  @Atomic
  @Override
  public boolean add(E value) {
    DirectoryManager locator = HyFlow.getLocator();
    IDContainer<ImmutableHashMap<E, E>> container = (IDContainer<ImmutableHashMap<E, E>>) locator.open(containerID, "r");
    final ImmutableHashMap<E, E> map = container.getItem();
    Box found = new Box(null);
    final ImmutableHashMap<E, E> newMap = map.put(value, value, found);
    if (found.value != null) {
      return false;
    }
    container = (IDContainer<ImmutableHashMap<E, E>>) locator.open(containerID, "w");
    container.setItem(newMap);
    return true;
  }
View Full Code Here

    container.setItem(new ImmutableHashMap<E, E>(null));
  }
 
  @Atomic
  private ImmutableHashMap<E, E> getHead() {
    DirectoryManager locator = HyFlow.getLocator();
    IDContainer<ImmutableHashMap<E, E>> container = (IDContainer<ImmutableHashMap<E, E>>) locator.open(containerID, "r");
    return container.getItem();
  }
View Full Code Here

   * @see edu.vt.rt.datastructures.lang.DistributedSet#remove(java.io.Serializable)
   */
  @Atomic
  @Override
  public boolean remove(E value) {
    DirectoryManager locator = HyFlow.getLocator();
    IDContainer<ImmutableHashMap<E, E>> container = (IDContainer<ImmutableHashMap<E, E>>) locator.open(containerID, "r");
    final ImmutableHashMap<E, E> map = container.getItem();
    Box found = new Box(null);
    final ImmutableHashMap<E, E> newMap = map.remove(value, found);
    if (found.value == null) {
      return false;
    }
    container = (IDContainer<ImmutableHashMap<E, E>>) locator.open(containerID, "w");
    container.setItem(newMap);
    return true;
  }
View Full Code Here

  }

  @Atomic
  private long sumAssests(int node){
    long balance = 0;
    DirectoryManager locator = HyFlow.getLocator();
    for(int i=0; i<localObjectsCount; i++){
      for(int j=0;j<node;j++){
        if(i%node==j){
          try {
            balance+=((LoanAccount) locator.open(j + "-" + i,"r")).checkBalance();
          } catch (Throwable e) {
            e.printStackTrace();
         
        }
      }
View Full Code Here

TOP

Related Classes of aleph.dir.DirectoryManager

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.