Package aleph.dir

Examples of aleph.dir.DirectoryManager.open()


      String node = array[index];
      if (node == null) {
        return notFound;
      }
      DirectoryManager locator = HyFlow.getLocator();
      return ((DistributedImmutableHashMap) locator.open(node, "r")).find(shift+5, hash, key, notFound);
    }

    @Override
    public DistributedImmutableHashMap put(int shift, int hash, Object key, Object value, Box addedLeaf) {
      DirectoryManager locator = HyFlow.getLocator();
View Full Code Here


      if (node == null) {  //If the index is currently empty
        locator.delete(this);
        return new ArrayNode(count+1, cloneAndSet(array, index, (String) (BitmapIndexedNode.EMPTY.put(shift+5, hash, key, value, addedLeaf)).getId()));
      }
      //Else add it later on in the tree
      final DistributedImmutableHashMap newNode = ((DistributedImmutableHashMap) locator.open(node, "r")).put(shift+5, hash, key, value, addedLeaf);
      if (newNode == null) {
        return this;
      }
      locator.delete(this);
      return new ArrayNode(count, cloneAndSet(array, index, (String) newNode.getId()));
View Full Code Here

      String node = array[index];
      if (node == null) {
        return this;
      }
      DirectoryManager locator = HyFlow.getLocator();
      final DistributedImmutableHashMap n = ((DistributedImmutableHashMap) locator.open(node, "r")).remove(shift+5, hash, key, removedLeaf);
      if (n == null) {
        locator.delete(this);
        if (count <= 8) { //Shrink back to BitmapIndexedNode
          return pack(index);
        }
View Full Code Here

      int index = index(bit);
      Object keyOrNull = array[2*index];
      Object valOrNode = array[2*index+1];
      if (keyOrNull == null) {  //index is another INode
        DirectoryManager locator = HyFlow.getLocator();
        return ((DistributedImmutableHashMap) locator.open((String)valOrNode, "r")).find(shift+5, hash, key, notFound);
      }
      if (key.equals(keyOrNull)) {
        return valOrNode;
      }
      return notFound;
View Full Code Here

      DirectoryManager locator = HyFlow.getLocator();
      if ((bitmap & bit) != 0) {  //We check to see if the index of the hashCode in the bitmap is set
        Object keyOrNull = array[2*index];
        Object valOrNode = array[2*index+1];
        if (keyOrNull == null) {  //If null, then valOrNode is a INode
          final DistributedImmutableHashMap newNode = ((DistributedImmutableHashMap) locator.open((String)valOrNode, "r")).put(shift+5, hash, key, value, addedLeaf);
          final String newNodeID = (String) newNode.getId();
          if(valOrNode.equals(newNodeID)) {
            return this;
          }
          locator.delete(this);
View Full Code Here

      }
      int index = index(bit);
      Object keyOrNull = array[2*index];
      Object valOrNode = array[2*index+1];
      if (keyOrNull == null) {  //Removing from another INode
        final DistributedImmutableHashMap n = ((DistributedImmutableHashMap) locator.open((String)valOrNode, "r")).remove(shift+5, hash, key, removedLeaf);
        if (n != null) {
          final String nID = (String) n.getId();
          if (valOrNode.equals(nID)) {
            return this;
          }
View Full Code Here

   */
  @Atomic
  @Override
  public boolean add(E value) {
    DirectoryManager locator = HyFlow.getLocator();
    HashSet<E> set = (HashSet<E>) locator.open(setID, "w");
    return set.add(value);
  }

  /* (non-Javadoc)
   * @see edu.vt.rt.datastructures.lang.DistributedSet#contains(java.io.Serializable)
View Full Code Here

   */
  @Atomic
  @Override
  public boolean contains(E value) {
    DirectoryManager locator = HyFlow.getLocator();
    HashSet<E> set = (HashSet<E>) locator.open(setID, "r");
    return set.contains(value);
  }

  /* (non-Javadoc)
   * @see edu.vt.rt.datastructures.lang.DistributedSet#create()
View Full Code Here

   */
  @Atomic
  @Override
  public boolean remove(E value) {
    DirectoryManager locator = HyFlow.getLocator();
    HashSet<E> set = (HashSet<E>) locator.open(setID, "w");
    return set.remove(value);
  }

}
View Full Code Here

   */
  @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;
    }
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.