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

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


    super(storeHeader, heapRecordableManager, helperBinaryConversion);
  }

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


  }

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

  public ReferenceLink searchByReferenced(
      final DataRecordIdentifier referencedDataRecordIdentifier)
      throws GarbageException, ReferenceLinkGarbageException {
    final ReferenceLink referenceLink = new ReferenceLink(
        referencedDataRecordIdentifier);
    final GarbageReferenceLinkRBTNode node;
    final ReferenceLink foundReferenceLink;
    try {
      node = /**/(GarbageReferenceLinkRBTNode) garbageReferenceLinkTree
          .search(referenceLink);
      if (node == null) {
        foundReferenceLink = null;
        if (LOGGER.debugEnabled) {
          LOGGER.debug("reference link record for referenced data record #"
              + referencedDataRecordIdentifier + " not found");
        }
      } else {
        foundReferenceLink = node.getElement();
        if (LOGGER.debugEnabled) {
          LOGGER.debug("found reference link record "
              + node.getDataRecordIdentifier()
              + " for referenced "
              + referencedDataRecordIdentifier);
        }
      }
    } catch (RBTException exception) {
View Full Code Here

    return foundReferenceLink;
  }

  public void appendNewReferenceLink(final ReferenceLink referenceLink)
      throws GarbageException, ReferenceLinkGarbageException {
    GarbageReferenceLinkRBTNode node = referenceLink.getNode();
    if (node != null) {
      throw new GarbageException("already in file");
    }
    node = new GarbageReferenceLinkRBTNode(heapRecordableManager,
        helperBinaryConversion);
    try {
      referenceLink.setNode(node);
      node.setElement(referenceLink);
      heapRecordableManager.attach(node);
      garbageReferenceLinkTree.append(node);
      node.setStateHaveChanged();
    } catch (RBTException exception) {
      rbtExceptionCause(exception);
      throw new InternalError();// NOPMD unreachable code,
      // rbtExceptionCause always throw
      // exception
    } catch (HeapRecordableException exception) {
      throw new GarbageException(exception);
    }
    if (LOGGER.debugEnabled) {
      LOGGER.debug("add reference link record #"
          + node.getDataRecordIdentifier() + ", reference link "
          + referenceLink);
    }
  }
View Full Code Here

    }
  }

  public void deleteReferenceLink(final ReferenceLink referenceLink)
      throws GarbageException, ReferenceLinkGarbageException {
    final GarbageReferenceLinkRBTNode node = referenceLink.getNode();
    if (node == null) {
      throw new GarbageException("does not exist in file");
    }
    try {
      garbageReferenceLinkTree.deleteExistingNode(node);
      final DataRecordIdentifier dataRecordIdentifier = node
          .getDataRecordIdentifier();
      heapRecordableManager.delete(dataRecordIdentifier);
      if (LOGGER.debugEnabled) {
        LOGGER.debug("removed reference link record "
            + dataRecordIdentifier + " for data record object "
View Full Code Here

    }
  }

  public void updateReferenceLink(final ReferenceLink referenceLink)
      throws GarbageException {
    final GarbageReferenceLinkRBTNode node = referenceLink.getNode();
    if (node == null) {
      throw new GarbageException("does not exist in file");
    }
    try {
      node.setStateHaveChanged();
    } catch (HeapRecordableException exception) {
      throw new GarbageException(exception);
    }
    if (LOGGER.debugEnabled) {
      LOGGER.debug("update referece link record "
          + node.getDataRecordIdentifier());
    }
  }
View Full Code Here

      throws GarbageException, ReferenceLinkGarbageException {
    final List<DataRecordIdentifier> list;
    try {
      ReferenceLink referenceLink = new ReferenceLink(
          referencedDataRecordIdentifier);
      final GarbageReferenceLinkRBTNode node =
      /**/(GarbageReferenceLinkRBTNode) garbageReferenceLinkTree
          .search(referenceLink);
      if (node == null) {
        list = EMPTY_LIST;
        if (LOGGER.debugEnabled) {
          LOGGER.debug("not referencing of data record #"
              + referencedDataRecordIdentifier);
        }
      } else {
        referenceLink = node.getElement();
        list = referenceLink.getRefencingDataRecordIdentifier();
        if (LOGGER.debugEnabled) {
          LOGGER.debug("referencing of data record #"
              + referencedDataRecordIdentifier + " is " + list);
        }
View Full Code Here

TOP

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

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.