Package com.sleepycat.je.log

Examples of com.sleepycat.je.log.LogEntryHeader


        assert headerBuf.position() <= maxSize;

        if (headerBuf.position() == maxSize) {
            headerBuf.flip();
            try {
                header = new LogEntryHeader(headerBuf, logVersion);
            } catch (ChecksumException e) {
                throw newVerifyException(e);
            }

            /* If the header is invisible, turn off the invisible bit. */
 
View Full Code Here


        byte entryType = msgBuffer.get();
        int entryVersion = LogUtils.readInt(msgBuffer);
        int itemSize = LogUtils.readInt(msgBuffer);
        VLSN vlsn = new VLSN(LogUtils.readLong(msgBuffer));

        this.header = new LogEntryHeader(entryType, entryVersion,
                                         itemSize, vlsn);

        /* The entryBuffer is positioned at 0, and is limited to this entry. */
        ByteBuffer entryBuffer = msgBuffer.slice();
        entryBuffer.limit(itemSize);
View Full Code Here

                    int itemSize,
                    VLSN vlsn,
                    ByteBuffer entryBuffer)
        throws DatabaseException {

        header = new LogEntryHeader(entryType, entryVersion, itemSize, vlsn);
        logEntry = LogEntryType.findType(header.getType()).
            getNewLogEntry();
        logEntry.readEntry(envImpl, header, entryBuffer);

    }
View Full Code Here

     * VLSN->LSN mapping. Called outside the log write latch.
     * @throws DatabaseException
     */
    @Override
    public void registerVLSN(LogItem logItem) {
        LogEntryHeader header = logItem.getHeader();
        VLSN vlsn = header.getVLSN();

        if (LogEntryType.LOG_TXN_COMMIT.getTypeNum() == header.getType() ||
            LogEntryType.LOG_TXN_ABORT.getTypeNum() == header.getType()) {
            /* Track transaction end VLSNs */
            repNode.currentTxnEndVLSN(vlsn);
        }

        /*
         * Although the very first replicated entry of the system is never a
         * syncable log entry type, the first GlobalCBVLSN of the system must
         * start at 1. If we only track the first syncable entry, the
         * GlobalCBVLSN will start a a value > 1, and replicas that are
         * starting up from VLSN 1 will be caught in spurious network restores
         * because VLSN 1 < the GlobalCBVLSN. Therefore treat the VLSN 1 as a
         * syncable entry for the sake of the GlobalCBVLSN.
         */
        if (LogEntryType.isSyncPoint(header.getType()) ||
            VLSN.FIRST_VLSN.equals(vlsn)) {
            repNode.trackSyncableVLSN(vlsn, logItem.getNewLsn());
        }
        vlsnIndex.put(logItem);
    }
View Full Code Here

        byte entryType = msgBuffer.get();
        int entryVersion = LogUtils.readInt(msgBuffer);
        int itemSize = LogUtils.readInt(msgBuffer);
        VLSN vlsn = new VLSN(LogUtils.readLong(msgBuffer));

        this.header = new LogEntryHeader(entryType, entryVersion,
                                         itemSize, vlsn);

        /* The entryBuffer is positioned at 0, and is limited to this entry. */
        ByteBuffer entryBuffer = msgBuffer.slice();
        entryBuffer.limit(itemSize);
View Full Code Here

                    int itemSize,
                    VLSN vlsn,
                    ByteBuffer entryBuffer)
        throws DatabaseException {

        header = new LogEntryHeader(entryType, entryVersion, itemSize, vlsn);
        logEntry = LogEntryType.findType(header.getType()).
            getNewLogEntry();
        logEntry.readEntry(header, entryBuffer, true /* readFullItem */);

    }
View Full Code Here

     * VLSN->LSN mapping. Called outside the log write latch.
     * @throws DatabaseException
     */
    @Override
    public void registerVLSN(LogItem logItem) {
        LogEntryHeader header = logItem.getHeader();
        VLSN vlsn = header.getVLSN();

        if (LogEntryType.LOG_TXN_COMMIT.getTypeNum() ==
            header.getType()) {
            /* Track commit VLSNs */
            repNode.currentCommitVLSN(vlsn);
        }

        /*
         * Although the very first replicated entry of the system is never a
         * syncable log entry type, the first GlobalCBVLSN of the system must
         * start at 1. If we only track the first syncable entry, the
         * GlobalCBVLSN will start a a value > 1, and replicas that are
         * starting up from VLSN 1 will be caught in spurious network restores
         * because VLSN 1 < the GlobalCBVLSN. Therefore treat the VLSN 1 as a
         * syncable entry for the sake of the GlobalCBVLSN.
         */
        if (LogEntryType.isSyncPoint(header.getType()) ||
            VLSN.FIRST_VLSN.equals(vlsn)) {
            repNode.trackSyncableVLSN(vlsn, logItem.getNewLsn());
        }
        vlsnIndex.put(logItem);
    }
View Full Code Here

        assert headerBuf.position() <= maxSize;

        if (headerBuf.position() == maxSize) {
            headerBuf.flip();
            try {
                header = new LogEntryHeader(headerBuf, logVersion);
            } catch (ChecksumException e) {
                throw newVerifyException(e);
            }

            /* If the header is invisible, turn off the invisible bit. */
 
View Full Code Here

TOP

Related Classes of com.sleepycat.je.log.LogEntryHeader

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.