Package com.sleepycat.je.log.entry

Examples of com.sleepycat.je.log.entry.LNLogEntry


        /* Don't count abortLsn as obsolete, this is done during commit. */
        if (oldLsn == logAbortLsn) {
            oldLsn = DbLsn.NULL_LSN;
        }

        LNLogEntry logEntry = new LNLogEntry(entryType,
                                             this,
                                             dbId,
                                             key,
                                             logAbortLsn,
               logAbortKnownDeleted,
View Full Code Here


        /* Read the whole entry out of the log. */
        Object o = env.getLogManager().getLogEntry(lsn);
        if (!(o instanceof LNLogEntry)) {
            return true;
        }
        LNLogEntry entry = (LNLogEntry)o;

        /* All deleted LNs are obsolete. */
        if (entry.getLN().isDeleted()) {
            return true;
        }
       
        /* Find the owning database. */
        DatabaseId dbId = entry.getDbId();
        DatabaseImpl db = env.getDbMapTree().getDb(dbId);

        /* The whole database is gone, so this LN is obsolete. */
        if (db == null || db.getIsDeleted()) {
            return true;
        }

        /*
         * Search down to the bottom most level for the parent of this LN.
         */
        BIN bin = null;
        try {
            Tree tree = db.getTree();
            TreeLocation location = new TreeLocation();
            boolean parentFound = tree.getParentBINForChildLN
                (location,
                 entry.getKey(),
                 entry.getDupKey(),
                 entry.getLN(),
                 false,  // splitsAllowed
                 true,   // findDeletedEntries
                 false,  // searchDupTree ???
                 false); // updateGeneration
            bin = location.bin;
View Full Code Here

  /*
   * Check the nodeid to see if we've already seen it or not.
   */
  if (entry instanceof LNLogEntry) {
      LNLogEntry lnEntry = (LNLogEntry) entry;
      LN ln = lnEntry.getLN();
      long nodeId = ln.getNodeId();
      boolean isDelDupLN =
    entryType.equals(LogEntryType.
         LOG_DEL_DUPLN_TRANSACTIONAL) ||
    entryType.equals(LogEntryType.LOG_DEL_DUPLN);
View Full Code Here

  boolean processThisEntry =
      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)) {
        throw new DatabaseException
      ("Already name mapped for dbId: " + dbId +
View Full Code Here

  boolean processThisEntry =
      checkProcessEntry(entry, entryType, true);
       
  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) {
View Full Code Here

        try {
            Set alreadyUndone = new HashSet();
            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. */
                undoLsn = undoEntry.getUserTxn().getLastLsn();
            }
        } catch (DatabaseException e) {
            Tracer.trace(envImpl, "Txn", "undo",
       "for node=" + nodeId + " LSN=" +
       DbLsn.getNoFormatString(undoLsn), e);
View Full Code Here

             * Note that these entries do not overlap with targetLogEntry.
             *
             * XXX We're doing a full load for now, since LNLogEntry does not
             * read the db and txn id in a partial load, only the node id.
             */
            LNLogEntry lnEntry = null;
            if (dbIdTrackingEntry != null) {
                /* This entry has a db id */
    lnEntry = dbIdTrackingEntry;
    lnEntry.readEntry(entryBuffer, currentEntrySize,
          currentEntryTypeVersion,
          true /* full load */);
    entryLoaded = true;
                MapLN mapLN = (MapLN) lnEntry.getMainItem();
                int dbId = mapLN.getDatabase().getId().getId();
                if (dbId > maxDbId) {
                    maxDbId = dbId;
                }
            }
            if (txnIdTrackingEntry != null) {
                /* This entry has a txn id */
                if (lnEntry == null) {
                    lnEntry = txnIdTrackingEntry;
                    lnEntry.readEntry(entryBuffer, currentEntrySize,
                                      currentEntryTypeVersion,
                                      true /* full load */);
                    entryLoaded = true;
                }
                long txnId = lnEntry.getTxnId().longValue();
                if (txnId > maxTxnId) {
                    maxTxnId = txnId;
                }
            }

View Full Code Here

                                            logAbortLsn,
                                            logAbortKnownDeleted,
                                            logTxn);
        } else {
            /* Not a deleted duplicate LN -- use a regular LNLogEntry. */
            return new LNLogEntry(entryType,
                                  this,
                                  dbId,
                                  key,
                                  logAbortLsn,
                                  logAbortKnownDeleted,
View Full Code Here

                    Node node = (Node) logEntry.getMainItem();
                    node.postFetchInit(databaseImpl, lsn);
                    /* Ensure keys are transactionally correct. [#15704] */
                    byte[] lnSlotKey = null;
                    if (logEntry instanceof LNLogEntry) {
                        LNLogEntry lnEntry = (LNLogEntry) logEntry;
                        lnSlotKey = containsDuplicates() ?
                            lnEntry.getDupKey() : lnEntry.getKey();
                    }
                    updateNode(idx, node, lnSlotKey);
                    isMiss = true;
                } catch (FileNotFoundException e) {
                    if (!isEntryKnownDeleted(idx) &&
View Full Code Here

  /*
   * Check the nodeid to see if we've already seen it or not.
   */
  if (entry instanceof LNLogEntry) {
      LNLogEntry lnEntry = (LNLogEntry) entry;
      LN ln = lnEntry.getLN();
      long nodeId = ln.getNodeId();
      boolean isDelDupLN =
    entryType.equals(LogEntryType.
         LOG_DEL_DUPLN_TRANSACTIONAL) ||
    entryType.equals(LogEntryType.LOG_DEL_DUPLN);
View Full Code Here

TOP

Related Classes of com.sleepycat.je.log.entry.LNLogEntry

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.