Examples of LNLogEntry


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

        /* Read the whole entry out of the log. */
        Object o = env.getLogManager().getLogEntryHandleFileNotFound(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.getDbTree().getDb(dbId);

        /*
         * Search down to the bottom most level for the parent of this LN.
         */
        BIN bin = null;
        try {

            /*
             * The whole database is gone, so this LN is obsolete. No need
             * to worry about delete cleanup; this is just verification and
             * no cleaning is done.
             */
            if (db == null || db.isDeleted()) {
                return true;
            }

            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 ???
                 CacheMode.UNCHANGED);
            bin = location.bin;
View Full Code Here

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

        /*
         * Process db and txn id tracking entries.  Note that these entries do
         * not overlap with targetLogEntry.
         */
        LNLogEntry lnEntry = null;
        if (dbIdTrackingEntry != null) {
            /* This entry has a db id */
            lnEntry = dbIdTrackingEntry;

            /*
             * Do a full load to get DB ID from DatabaseImpl. Note that while a
             * partial read gets the database id for the database that owns
             * this LN, it doesn't get the database id for the database
             * contained by a MapLN. That's what we're trying to track.
             */
            lnEntry.readEntry(currentEntryHeader,
                              entryBuffer,
                              true); // readFullItem
            entryLoaded = true;
            MapLN mapLN = (MapLN) lnEntry.getMainItem();
            DatabaseId dbId = mapLN.getDatabase().getId();
            int dbIdVal = dbId.getId();
            maxDbId = (dbIdVal > maxDbId) ? dbIdVal : maxDbId;
            minReplicatedDbId = (dbIdVal < minReplicatedDbId) ?
                dbIdVal : minReplicatedDbId;

            /*
             * When a MapLN is encountered, reset the tracked information for
             * that database.  This clears what we accummulated previously for
             * the database during this recovery pass.
             */
            dbIdToReset = dbId;

            /* Save the LSN of the MapLN for use by undo/redo. */
            tracker.saveLastLoggedMapLN(dbId, getLastLsn());
        }

        if (txnIdTrackingEntry != null) {
            /* This entry has a txn id */
            if (lnEntry == null) {
                /* Do a partial load since we only need the txn ID. */
                lnEntry = txnIdTrackingEntry;
                lnEntry.readEntry(currentEntryHeader,
                                  entryBuffer,
                                  false); // readFullItem
                entryLoaded = true;
            }
            long txnId = lnEntry.getTxnId().longValue();
            maxTxnId = (txnId > maxTxnId) ? txnId : maxTxnId;
            minReplicatedTxnId = (txnId < minReplicatedTxnId) ?
                txnId : minReplicatedTxnId;
        }

View Full Code Here

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

        summary.totalCount += 1;
        summary.totalSize += size;

        if (entry instanceof LNLogEntry) {
            LNLogEntry lnEntry = (LNLogEntry) entry;
            if (DEBUG) {
                int otherSize = lnEntry.getLN().getLastLoggedSize();
                if (size != otherSize) {
                    System.out.println
                        ("LogReader.getLastEntrySize=" + size +
                         " LN.getLastLoggedSize=" + otherSize +
                         " " + lnEntry.getLogType());
                }
            }
            if (lastEntryType.isTransactional()) {
                Long txnId = Long.valueOf(lnEntry.getTransactionId());
                List<Object> txnEntries = txns.get(txnId);
                if (txnEntries == null) {
                    txnEntries = new ArrayList<Object>();
                    txns.put(txnId, txnEntries);
                }
View Full Code Here

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

    }

    private void applyTxn(List<Object> entries, boolean commit) {
        for (int i = 0; i < entries.size(); i += 2) {
            ExtendedFileSummary summary = (ExtendedFileSummary) entries.get(i);
            LNLogEntry lnEntry = (LNLogEntry) entries.get(i + 1);
            LN ln = lnEntry.getLN();
            int size = ln.getLastLoggedSize();

            summary.totalLNCount += 1;
            summary.totalLNSize += size;

            if (!commit || ln.isDeleted()) {
                summary.obsoleteLNCount += 1;
                summary.recalcObsoleteLNSize += size;
            }

            if (commit) {
                Long nodeId = Long.valueOf(lnEntry.getNodeId());
                countObsoleteNode(nodeId);
                if (ln.isDeleted()) {
                    activeNodes.remove(nodeId);
                } else {
                    putActiveNode(nodeId, size, summary,
                                  lnEntry.getDbId().getId(),
                                  true);
                }
            }

            /* Process Database truncate or remove. */
 
View Full Code Here

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

        }

        if (lastEntryType == LogEntryType.LOG_LN_TRANSACTIONAL ||
            lastEntryType == LogEntryType.LOG_LN) {
            /* Read the entry into the ByteBuffer. */
            LNLogEntry entry = (LNLogEntry) lastEntryType.getSharedLogEntry();
            entry.readEntry(currentEntryHeader,
                            entryBuffer, true /*readFullItem*/);
            int keyLen = entry.getKey().length;
            realTotalKeyBytes += keyLen;
            if (!entry.isDeleted()) {
                int dataLen = entry.getLN().getData().length;
                realTotalDataBytes += dataLen;
            }
        }

        entryBuffer.position(nextEntryPosition);
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.