Package net.sf.joafip.store.entity.garbage

Examples of net.sf.joafip.store.entity.garbage.DataRecordIdentifierRBTNode


  public boolean addToGarbage(final DataRecordIdentifier dataRecordIdentifier)
      throws GarbageException {
    try {
      final boolean added;
      if (toGarbageTree.search(dataRecordIdentifier) == null) {
        final DataRecordIdentifierRBTNode node = new DataRecordIdentifierRBTNode(
            helperBinaryConversion, heapRecordableManager);
        heapRecordableManager.attach(node);
        node.setElement(dataRecordIdentifier);
        if (LOGGER.debugEnabled) {
          LOGGER.debug("added to garbage record "
              + node.getDataRecordIdentifier()
              + " for object data record " + dataRecordIdentifier);
        }
        toGarbageTree.append(node);
        added = true;
      } else {
View Full Code Here


  public boolean removeToGarbage(
      final DataRecordIdentifier dataRecordIdentifier)
      throws GarbageException {
    final boolean removed;
    try {
      final DataRecordIdentifierRBTNode removedNode =
      /**/(DataRecordIdentifierRBTNode) toGarbageTree
          .deleteGetRemoved(dataRecordIdentifier);
      if (removedNode == null) {
        removed = false;
      } else {
        removed = true;
        heapRecordableManager.delete(removedNode
            .getDataRecordIdentifier());
        if (LOGGER.debugEnabled) {
          LOGGER.debug("removed to garbage record "
              + removedNode.getDataRecordIdentifier());
        }
      }
    } catch (RBTException exception) {
      throw new GarbageException(exception);
    } catch (HeapRecordableException exception) {
View Full Code Here

   * @throws GarbageException
   */
  public DataRecordIdentifier pollFirstToGarbage() throws GarbageException {
    final DataRecordIdentifier toGarbageDataRecordIdentifier;
    try {
      final DataRecordIdentifierRBTNode first =
      /**/(DataRecordIdentifierRBTNode) toGarbageTree.first();
      if (first == null) {
        toGarbageDataRecordIdentifier = null;
        if (LOGGER.debugEnabled) {
          LOGGER.debug("no first to garbage");
        }
      } else {
        toGarbageDataRecordIdentifier = first.getElement();
        final DataRecordIdentifier firstNodeDataRecordIdentifier = first
            .getDataRecordIdentifier();
        toGarbageTree.deleteExistingNode(first);
        heapRecordableManager.delete(firstNodeDataRecordIdentifier);
        if (LOGGER.debugEnabled) {
          LOGGER.debug("object data record #"
View Full Code Here

  @Fortest
  public List<DataRecordIdentifierRBTNode> getToGarbage()
      throws GarbageException {
    final List<DataRecordIdentifierRBTNode> list =
    /**/new LinkedList<DataRecordIdentifierRBTNode>();
    DataRecordIdentifierRBTNode node;
    try {
      for (IRBTNode<DataRecordIdentifier> rbtNode : toGarbageTree) {
        node = (DataRecordIdentifierRBTNode) rbtNode;
        list.add(node);
      }
View Full Code Here

    super(storeHeader, heapRecordableManager, helperBinaryConversion);
  }

  @Override
  public IRBTNode<DataRecordIdentifier> newSentinel() {
    return new DataRecordIdentifierRBTNode(helperBinaryConversion);
  }
View Full Code Here

  }

  @Override
  protected IHeapRecordable newIHeapRecordableRBTNode(
      final HeapRecordableManager heapRecordableManager) {
    return new DataRecordIdentifierRBTNode(helperBinaryConversion,
        heapRecordableManager);
  }
View Full Code Here

  public boolean addVisited(final DataRecordIdentifier dataRecordIdentifier)
      throws GarbageException {
    try {
      final boolean added;
      if (visitedTree.search(dataRecordIdentifier) == null) {
        final DataRecordIdentifierRBTNode node = new DataRecordIdentifierRBTNode(
            helperBinaryConversion, heapRecordableManager);
        heapRecordableManager.attach(node);
        node.setElement(dataRecordIdentifier);
        visitedTree.append(node);
        added = true;
      } else {
        added = false;
      }
View Full Code Here

  }

  public DataRecordIdentifier pollFirstVisited() throws GarbageException {
    final DataRecordIdentifier dataRecordIdentifier;
    try {
      final DataRecordIdentifierRBTNode first =
      /**/(DataRecordIdentifierRBTNode) visitedTree.first();
      if (first == null) {
        dataRecordIdentifier = null;
      } else {
        dataRecordIdentifier = first.getElement();
        final DataRecordIdentifier firstDataRecordIdentifier = first
            .getDataRecordIdentifier();
        visitedTree.deleteExistingNode(first);
        heapRecordableManager.delete(firstDataRecordIdentifier);
      }
    } catch (RBTException exception) {
View Full Code Here

  public boolean addCandidate(final DataRecordIdentifier dataRecordIdentifier)
      throws GarbageException {
    try {
      final boolean added;
      if (garbageCandidateTree.search(dataRecordIdentifier) == null) {
        final DataRecordIdentifierRBTNode node = new DataRecordIdentifierRBTNode(
            helperBinaryConversion, heapRecordableManager);
        heapRecordableManager.attach(node);
        node.setElement(dataRecordIdentifier);
        if (LOGGER.debugEnabled) {
          LOGGER.debug("added garbage candidate record "
              + node.getDataRecordIdentifier()
              + " for object data record " + dataRecordIdentifier);
        }
        garbageCandidateTree.append(node);
        added = true;
      } else {
View Full Code Here

  public boolean removeCandidate(
      final DataRecordIdentifier dataRecordIdentifier)
      throws GarbageException {
    final boolean removed;
    try {
      final DataRecordIdentifierRBTNode removedNode =
      /**/(DataRecordIdentifierRBTNode) garbageCandidateTree
          .deleteGetRemoved(dataRecordIdentifier);
      if (removedNode == null) {
        removed = false;
      } else {
        removed = true;
        heapRecordableManager.delete(removedNode
            .getDataRecordIdentifier());
        if (LOGGER.debugEnabled) {
          LOGGER.debug("removed garbage candidate record "
              + removedNode.getDataRecordIdentifier());
        }
      }
    } catch (RBTException exception) {
      throw new GarbageException(exception);
    } catch (HeapRecordableException exception) {
View Full Code Here

TOP

Related Classes of net.sf.joafip.store.entity.garbage.DataRecordIdentifierRBTNode

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.