Package com.sleepycat.je.tree

Examples of com.sleepycat.je.tree.Node


                         */
                        for (int i = origCursor.getIndex() + 1;
                             i < origBIN.getNEntries();
                             i++) {
                            if (!origBIN.isEntryKnownDeleted(i)) {
                                final Node n = origBIN.fetchTarget(i);
                                if (n != null) {
                                    final LN ln = (LN) n;
                                    /* See comment above about locking. */
                                    if (!ln.isDeleted()) {
                                        ret = true;
                                        break;
                                    }
                                }
                            }
                        }
                    }
                } else {
                    if (origCursor.getIndex() > 0) {

                        /*
                         * We were adjusted to something other than the
                         * first entry so some insertion happened.
                         */
                        for (int i = 0; i < origCursor.getIndex(); i++) {
                            if (!origBIN.isEntryKnownDeleted(i)) {
                                final Node n = origBIN.fetchTarget(i);
                                if (n != null) {
                                    final LN ln = (LN) n;
                                    /* See comment above about locking. */
                                    if (!ln.isDeleted()) {
                                        ret = true;
View Full Code Here


         * not in memory.
         */
        for (int i = 0; i < in.getNEntries(); i += 1) {

            long lsn = in.getLsn(i);
            Node node = in.getTarget(i);
            boolean nodeInCache = node != null;
            byte[] lnKey =
                (!nodeInCache || node.isLN()) ? in.getKey(i) : null;

            if (in.isEntryPendingDeleted(i) ||
                in.isEntryKnownDeleted(i)) {

                /* Dirty LNs (deferred write) get special treatment. */
 
View Full Code Here

     */
    private void fetchAndProcessLSN(long lsn, LSNAccumulator pendingLSNs)
        throws DatabaseException {

        lnKeyEntry.setData(null);
        Node node = fetchLSNHandleExceptions(lsn, lnKeyEntry, pendingLSNs);
        if (node == null) {
            return;
        }
        boolean isIN = (node instanceof IN);
        IN in = null;
        try {
            if (isIN) {
                in = (IN) node;
                in.latch(CacheMode.UNCHANGED);
            }
            callProcessLSNHandleExceptions
                (lsn, node.getGenericLogType(), node, lnKeyEntry.getData());

            if (isIN) {
                accumulateLSNs(in, pendingLSNs);
            }
        } finally {
View Full Code Here

                lnKey = lnEntry.getKey();
                lnKeyEntry.setData(lnKey);
            }

            /* Get the Node from the LogEntry. */
            Node ret = (Node) entry.getResolvedItem(dbImpl);

            /*
             * For an IN Node, set the database so it will be passed down to
             * nested fetches.
             */
            long lastLoggedLsn = lsn;
            if (ret instanceof IN) {
                IN retIn = (IN) ret;
                retIn.setDatabase(dbImpl);
            }

            /*
             * If there is a delta, then this is a BIN to which the delta must
             * be applied.  The delta LSN is the last logged LSN.
             */
            BINDelta delta = inEntry.getDelta();
            if (delta != null) {
                assert lsn == delta.getLastFullLsn();
                assert ret instanceof BIN;
                delta.reconstituteBIN(dbImpl, (BIN) ret);
                lastLoggedLsn = inEntry.getDeltaLsn();
            }

            /* During a preload, finally place the Node into the Tree. */
            if (fetchAndInsertIntoTree()) {
                ret.postFetchInit(dbImpl, lastLoggedLsn);
                in.updateNode(index, ret, lnKey);
            }
            return ret;
        } finally {
            if (!isLatchedAlready) {
View Full Code Here

        final boolean isDeleted;
        if (isLNDeleted(bin, index)) {
            deleteSlot();
            return;
        }
        final Node node = bin.fetchTarget(index);
        if (!node.containsDuplicates()) {
            if (DEBUG) {
                System.out.println("DupConvert BIN LN " +
                                   Key.dumpString(bin.getKey(index), 0));
            }
            /* Fetching a non-deleted LN updates the slot key; we're done. */
 
View Full Code Here

                        if (bin.isEntryPendingDeleted(i) ||
                            bin.isEntryKnownDeleted(i)) {
                            continue;
                        }

                        Node child = bin.getTarget(i);
                        if (child == null || child.isLN()) {
                            byte[] lnKey = bin.getKey(i);
                            try {
                                KeyAndData e = new KeyAndData(lnKey);
                                while (!queue.offer(e, offerTimeout,
                                                    TimeUnit.MILLISECONDS)) {
View Full Code Here

                if (in.isEntryPendingDeleted(i) ||
                    in.isEntryKnownDeleted(i)) {
                    continue;
                }

                final Node node = in.getTarget(i);
                if (node != null && node.isIN()) {
                    final IN child = (IN) node;
                    child.latchShared(CacheMode.UNCHANGED);
                    try {
                        gatherInMemoryINs1(child, ins);
                    } finally {
View Full Code Here

            /*
             * Fetch the node, if necessary.  If it was not resident and it is
             * an evictable LN, we will clear it after we migrate it.
             */
      Node node = null;
      if (!bin.isEntryKnownDeleted(index)) {
                node = bin.getTarget(index);
                if (node == null) {
                    /* If fetchTarget returns null, a deleted LN was cleaned.*/
                    node = bin.fetchTarget(index);
                    clearTarget = node instanceof LN &&
                        !db.getId().equals(DbTree.ID_DB_ID);
                }
            }

      /* Don't migrate knownDeleted or deleted cleaned LNs.  */
            if (node == null) {
                if (wasCleaned) {
                    nLNsDead++;
                }
                obsolete = true;
                completed = true;
                return;
      }

            /* Determine whether this is a DupCountLN or a regular LN. */
            boolean lnIsDupCountLN = node.containsDuplicates();
      if (lnIsDupCountLN) {
    parentDIN = (DIN) node;
    parentDIN.latch(false);
                ChildReference dclRef = parentDIN.getDupCountLNRef();
                lsn = dclRef.getLsn();
View Full Code Here

        }

        int dupRootCount = 1;

        /* If fetchTarget returns null, a deleted LN was cleaned. */
        Node n = bin.fetchTarget(index);
        if (n != null && n.containsDuplicates()) {
            DIN dupRoot = (DIN) n;
            /* Latch couple down the tree. */
            dupRoot.latch();
      releaseBIN();
            DupCountLN dupCountLN = (DupCountLN)
View Full Code Here

                        /*
                         * See if we need to descend further.  If fetchTarget
                         * returns null, a deleted LN was cleaned.
                         */
                        Node n = null;
                        if (!in.isEntryKnownDeleted(index)) {
                            n = in.fetchTarget(index);
                        }

                        if (n != null && n.containsDuplicates()) {
                            DIN dupRoot = (DIN) n;
                            dupRoot.latch();
                            in.releaseLatch();
                            in = null;
                            found = positionFirstOrLast(first, dupRoot);
View Full Code Here

TOP

Related Classes of com.sleepycat.je.tree.Node

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.