Package com.sleepycat.je.log.entry

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


        mapTreeRootLatch.acquire();
        try {
            if (ifBeforeLsn == DbLsn.NULL_LSN ||
                DbLsn.compareTo(mapTreeRootLsn, ifBeforeLsn) < 0) {
                mapTreeRootLsn = logManager.log
                    (new SingleItemEntry(LogEntryType.LOG_ROOT,
                                         dbMapTree),
                     ReplicationContext.NO_REPLICATE);
            }
        } finally {
            mapTreeRootLatch.release();
View Full Code Here


                /*
                 * The root entry targetted for cleaning is in use.  Write a
                 * new copy.
                 */
                mapTreeRootLsn = logManager.log
                    (new SingleItemEntry(LogEntryType.LOG_ROOT,
                                         dbMapTree),
                     ReplicationContext.NO_REPLICATE);
            }
        } finally {
            mapTreeRootLatch.release();
View Full Code Here

     */
    public long forceLogFileFlip()
        throws DatabaseException {

        return logManager.logForceFlip
            (new SingleItemEntry(LogEntryType.LOG_TRACE,
                                 new Trace("File Flip")));
    }
View Full Code Here

                            DatabaseImpl dbImpl)
        throws DatabaseException {

        if (!dbImpl.isDeferredWriteMode()) {
            logManager.log(
               new SingleItemEntry(LogEntryType.LOG_IN_DUPDELETE_INFO, this),
               ReplicationContext.NO_REPLICATE);
        }
    }
View Full Code Here

                            DatabaseImpl dbImpl)
        throws DatabaseException {

        if (!dbImpl.isDeferredWriteMode()) {
            logManager.log
                (new SingleItemEntry(LogEntryType.LOG_IN_DELETE_INFO,
                                     this),
                 ReplicationContext.NO_REPLICATE);
        }
    }
View Full Code Here

        }

        if (doDeltaLog) {
            item.provisional = Provisional.NO;
            item.oldLsn = DbLsn.NULL_LSN;
            item.entry = new SingleItemEntry(getBINDeltaType(), deltaInfo);
            item.isDelta = true;
        } else {
            /* Log a full version of the IN. */
            super.beforeLog(logManager, item, context);
        }
View Full Code Here

            envImpl.getTxnManager().notePrepare();
            if (writeInfo == null) {
                return XAResource.XA_RDONLY;
            }

            SingleItemEntry prepareEntry =
                new SingleItemEntry(LogEntryType.LOG_TXN_PREPARE,
                                    new TxnPrepare(id,xid));
            /* Flush required. */
            LogManager logManager = envImpl.getLogManager();
            logManager.logForceFlush(prepareEntry,
                                     true,  // fsyncrequired
View Full Code Here

        throws DatabaseException {

        LogManager logManager = envImpl.getLogManager();
        assert checkForValidReplicatorNodeId();

        SingleItemEntry commitEntry =
            new SingleItemEntry(LogEntryType.LOG_TXN_COMMIT,
                                new TxnCommit(id,
                                              lastLoggedLsn,
                                              getReplicatorNodeId()));

        LogItem item = new LogItem();
View Full Code Here

                try {
                    if (updateLoggedForTxn()) {
                        assert checkForValidReplicatorNodeId();
                        assert (commitLsn == NULL_LSN) &&
                               (abortLsn == NULL_LSN);
                        SingleItemEntry abortEntry =
                            new SingleItemEntry
                                (LogEntryType.LOG_TXN_ABORT,
                                 new TxnAbort(id, lastLoggedLsn,
                                              getReplicatorNodeId()));
                        abortLsn = forceFlush ?
                            envImpl.getLogManager().
View Full Code Here

            long firstActiveLsn = DbLsn.NULL_LSN;

            synchronized (envImpl.getEvictor()) {

                /* Log the checkpoint start. */
                SingleItemEntry startEntry =
                    new SingleItemEntry(LogEntryType.LOG_CKPT_START,
                                        new CheckpointStart(checkpointId,
                                                            invokingSource));
                checkpointStart =
                    logManager.log(startEntry,
                                   ReplicationContext.NO_REPLICATE);

                /*
                 * Note the first active LSN point. The definition of
                 * firstActiveLsn is that all log entries for active
                 * transactions are equal to or after that LSN.
                 */
                firstActiveLsn = envImpl.getTxnManager().getFirstActiveLsn();

                if (firstActiveLsn == DbLsn.NULL_LSN) {
                    firstActiveLsn = checkpointStart;
                } else {
                    if (DbLsn.compareTo(checkpointStart, firstActiveLsn) < 0) {
                        firstActiveLsn = checkpointStart;
                    }
                }

                /*
                 * Find the set of dirty INs that must be logged.  Update the
                 * highestFlushLevels volatile field so it will be seen by the
                 * evictor, before starting to flush dirty nodes.
                 */
                highestFlushLevels = dirtyMap.selectDirtyINsForCheckpoint
                    (flushAll, flushExtraLevel);
            }

            /*
             * Add the dirty map to the memory budget, outside the evictor
             * synchronization section.
             */
            dirtyMap.addCostToMemoryBudget();

            /* Call hook after dirty map creation and before flushing. */
            TestHookExecute.doHookIfSet(beforeFlushHook);

            /* Flush IN nodes. */
            boolean allowDeltas = !config.getMinimizeRecoveryTime();
            flushDirtyNodes(envImpl, dirtyMap, highestFlushLevels, allowDeltas,
                            checkpointStart, highPriority, flushStats);

            /*
             * Flush MapLNs if not already done by flushDirtyNodes.  Only flush
             * a database if it has not already been flushed since checkpoint
             * start.  Lastly, flush the DB mapping tree root.
             */
            dirtyMap.flushMapLNs(checkpointStart);
            dirtyMap.flushRoot(checkpointStart);

            /*
             * Flush replication information if necessary so that the VLSNIndex
             * cache is flushed and is recoverable.
             */
            envImpl.preCheckpointEndFlush();

            /*
             * Flush utilization info AFTER flushing IN nodes to reduce the
             * inaccuracies caused by the sequence FileSummaryLN-LN-BIN.
             */
            envImpl.getUtilizationProfile().flushFileUtilization
                (envImpl.getUtilizationTracker().getTrackedFiles());

            DbTree dbTree = envImpl.getDbTree();
            boolean willDeleteFiles = !cleanerState.isEmpty();
            CheckpointEnd ckptEnd = new CheckpointEnd
                (invokingSource, checkpointStart, envImpl.getRootLsn(),
                 firstActiveLsn,
                 envImpl.getNodeSequence().getLastLocalNodeId(),
                 envImpl.getNodeSequence().getLastReplicatedNodeId(),
                 dbTree.getLastLocalDbId(), dbTree.getLastReplicatedDbId(),
                 envImpl.getTxnManager().getLastLocalTxnId(),
                 envImpl.getTxnManager().getLastReplicatedTxnId(),
                 checkpointId,
                 willDeleteFiles);

            SingleItemEntry endEntry =
                new SingleItemEntry(LogEntryType.LOG_CKPT_END, ckptEnd);

            /*
             * Log checkpoint end and update state kept about the last
             * checkpoint location. Send a trace message *before* the
             * checkpoint end log entry. This is done so that the normal trace
View Full Code Here

TOP

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

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.