Examples of LN


Examples of com.sleepycat.je.tree.LN

      checkProcessEntry(entry, entryType, false);

  if (processThisEntry &&
      (entry instanceof LNLogEntry)) {
      LNLogEntry lnEntry = (LNLogEntry) entry;
      LN ln = lnEntry.getLN();
      if (ln instanceof NameLN) {
    String name = new String(lnEntry.getKey());
    Integer dbId = new Integer(((NameLN) ln).getId().getId());
    if (dbIdToName.containsKey(dbId) &&
        !((String) dbIdToName.get(dbId)).equals(name)) {
View Full Code Here

Examples of com.sleepycat.je.tree.LN

  if (processThisEntry) {
      LNLogEntry lnEntry = (LNLogEntry) entry;
      Integer dbId = new Integer(lnEntry.getDbId().getId());
      PrintStream out = getOutputStream(dbId);
          
            LN ln = lnEntry.getLN();
            byte[] keyData = lnEntry.getKey();
            byte[] data = ln.getData();
            if (data != null) {
                dumpOne(out, keyData, formatUsingPrintable);
                dumpOne(out, data, formatUsingPrintable);
    if ((++flushCounter % FLUSH_INTERVAL) == 0) {
        out.flush();
View Full Code Here

Examples of com.sleepycat.je.tree.LN

            /*
             * LNs
             */
            String data = "abcdef";
            LN ln = new LN(data.getBytes());
            LN lnFromLog = new LN();
            writeAndRead(buffer, ln, lnFromLog);
            lnFromLog.verify(null);
            assertTrue(ln.marshallOutsideWriteLatch());

            FileSummaryLN fsLN = new FileSummaryLN(new FileSummary());
            FileSummaryLN fsLNFromLog = new FileSummaryLN();
            writeAndRead(buffer, fsLN, fsLNFromLog);
View Full Code Here

Examples of com.sleepycat.je.tree.LN

            /* Add provisional entries, which should get ignored. */
            lsn = bin.logProvisional(logManager, in);

            /* Add a LN, to stress the node tracking. */
            LN ln = new LN(data);
            lsn = ln.log(envImpl,
                         DbInternal.dbGetDatabaseImpl(db).getId(),
                         key, DbLsn.NULL_LSN, null);

            /*
       * Add an IN delete entry, it should get picked up by the reader.
View Full Code Here

Examples of com.sleepycat.je.tree.LN

            testLsns.add(new Long(logManager.log(loggableObj)));

            /* Add an LN. */
            byte [] data = new byte[i+1];
            Arrays.fill(data, (byte)(i+1));
            loggableObj = new LN(data);

            testObjs.add(loggableObj);
            testLsns.add(new Long(logManager.log(loggableObj)));
        }

View Full Code Here

Examples of com.sleepycat.je.tree.LN

                            }
                        } else {
                            foundSomething = true;
                            if (!containsDuplicates && exactSearch) {
        /* Lock LN (will unlatch), check if deleted. */
        LN ln = (LN) n;
        long oldLsn = bin.getLsn(index);
        LockResult lockResult = lockLN(ln, lockType);
        ln = lockResult.getLN();
        latchBIN();

View Full Code Here

Examples of com.sleepycat.je.tree.LN

                    found = !exactSearch;
                }
            }
        } else {
      /* Not a duplicate, but checking for both key and data match. */
            LN ln = (LN) n;

      /* Lock LN (will unlatch), check if deleted. */
      LockResult lockResult = lockLN(ln, lockType);
      ln = lockResult.getLN();
      latchBIN();

      if (ln == null) {
                found = !exactSearch;
      } else {

    /* Don't set abort LSN for read operation. [#13158] */
    dupBin = null;
    dupIndex = -1;

                /*
                 * The comparison logic below mimics IN.findEntry as used above
                 * for duplicates.
                 */
    int cmp = Key.compareKeys(ln.getData(), data);
                if (cmp == 0 || (cmp <= 0 && !exactSearch)) {
                    if (cmp == 0) {
                        exact = true;
                    }
                    found = true;
View Full Code Here

Examples of com.sleepycat.je.tree.LN

            } else {
                return OperationStatus.NOTFOUND;
            }
        }

        LN ln = (LN) n;

  assert TestHookExecute.doHookIfSet(testHook);

        /*
         * Lock the LN (will unlatch).  For dirty-read, the data of the LN can
         * be set to null at any time.  Cache the data in a local variable so
         * its state does not change before calling setDbt further below.
         */
  LockResult lockResult = lockLN(ln, lockType);
  ln = lockResult.getLN();
        byte[] lnData = (ln != null) ? ln.getData() : null;
        if (ln == null || lnData == null) {
            if (treeStatsAccumulator != null) {
                treeStatsAccumulator.incrementDeletedLNCount();
            }
            return OperationStatus.KEYEMPTY;
View Full Code Here

Examples of com.sleepycat.je.tree.LN

            TreeLocation location = new TreeLocation();
            while (undoLsn != DbLsn.NULL_LSN) {

                LNLogEntry undoEntry =
        (LNLogEntry) logManager.getLogEntry(undoLsn);
                LN undoLN = undoEntry.getLN();
                nodeId = new Long(undoLN.getNodeId());

                /*
                 * Only process this if this is the first time we've seen this
                 * node. All log entries for a given node have the same
                 * abortLsn, so we don't need to undo it multiple times.
                 */
                if (!alreadyUndone.contains(nodeId)) {
                    alreadyUndone.add(nodeId);
                    DatabaseId dbId = undoEntry.getDbId();
                    DatabaseImpl db = (DatabaseImpl) undoDatabases.get(dbId);
                    undoLN.postFetchInit(db, undoLsn);
                    long abortLsn = undoEntry.getAbortLsn();
                    boolean abortKnownDeleted =
                        undoEntry.getAbortKnownDeleted();
                    try {
                        RecoveryManager.undo(Level.FINER,
                                             db,
                                             location,
                                             undoLN,
                                             undoEntry.getKey(),
                                             undoEntry.getDupKey(),
                                             undoLsn,
                                             abortLsn,
                                             abortKnownDeleted,
                                             null, false);
                    } finally {
                        if (location.bin != null) {
                            location.bin.releaseLatchIfOwner();
                        }
                    }
           
                    /*
                     * The LN undone is counted as obsolete if it was not
                     * deleted.
                     */
                    if (!undoLN.isDeleted()) {
                        logManager.countObsoleteNode(undoLsn, null);
                    }
                }

                /* Move on to the previous log entry for this txn. */
 
View Full Code Here

Examples of com.sleepycat.je.tree.LN

        Locker autoTxn = null;
        try {
            /* Insert it into name -> id db. */
            nameCursor = new CursorImpl(nameDatabase, locker);
            nameCursor.setAllowEviction(allowEviction);
            LN nameLN = new NameLN(newId);
            nameCursor.putLN(databaseName.getBytes("UTF-8"),
           nameLN, false);

            /*
             * If this is a non-handle use, no need to record any handle locks.
             */
            if (databaseHandle != null) {
                locker.addToHandleMaps(new Long(nameLN.getNodeId()),
                                       databaseHandle);
            }

            /* Insert it into id -> name db, in auto commit mode. */
            autoTxn = new AutoTxn(envImpl, new TransactionConfig());
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.