Package com.sleepycat.je.log.entry

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


     * @return the prevOffset field stored in the file header.
     */
    long getFileHeaderPrevOffset(long fileNum)
        throws IOException, DatabaseException {
       
        LogEntry headerEntry =
            envImpl.getLogManager().getLogEntry(DbLsn.makeLsn(fileNum, 0));
        FileHeader header = (FileHeader) headerEntry.getMainItem();
        return header.getLastEntryInPrevFileOffset();
    }
View Full Code Here


        sb.append("\" ");
        currentEntryHeader.dumpLogNoTag(sb, verbose);
        sb.append("\">");

        /* Read the entry and dump it into a string buffer. */
        LogEntry entry = lastEntryType.getSharedLogEntry();
        entry.readEntry(currentEntryHeader, entryBuffer, true); // readFullItem
        boolean dumpIt = true;
        if (targetTxnIds.size() > 0) {
            if (lastEntryType.isTransactional()) {
                if (!targetTxnIds.contains
                    (Long.valueOf(entry.getTransactionId()))) {
                    /* Not in the list of txn ids. */
                    dumpIt = false;
                }
            } else {
                /* If -tx spec'd and not a transactional entry, don't dump. */
                dumpIt = false;
            }
        }

        if (dumpIt) {
            entry.dumpEntry(sb, verbose);
            sb.append("</entry>");
            System.out.println(sb.toString());
        }

        return true;
View Full Code Here

        LogEntryType type = LogEntryType.findType(header.getType());
        if (type == null) {
            throw EnvironmentFailureException.unexpectedState
                ("Unknown header type:" + header.getType());
        }
        LogEntry entry = type.getNewLogEntry();
        buffer.mark();
        entry.readEntry(header, buffer, true /* readFullItem */);
        buffer.reset();
        return entry;
    }
View Full Code Here

    }

    /* For unit test support. */
    OutputWireRecord(InputWireRecord input) {
        this.header = input.header;
        LogEntry entry = input.getLogEntry();
        this.entryBuffer = ByteBuffer.allocate(entry.getSize());
        entry.writeEntry(header, entryBuffer);
        entryBuffer.flip();
    }
View Full Code Here

        if (!header.logicalEquals(input.header)) {
            return false;
        }

        LogEntry entry = instantiateEntry(entryBuffer);
        return entry.logicalEquals(input.getLogEntry());
    }
View Full Code Here

        if (!header.logicalEquals(otherRecord.header)) {
            return false;
        }

        LogEntry entry = instantiateEntry(entryBuffer);
        LogEntry otherEntry =
            otherRecord.instantiateEntry(otherRecord.entryBuffer);
        return entry.logicalEquals(otherEntry);
    }
View Full Code Here

    public String dump()
        throws DatabaseException {

        StringBuilder sb = new StringBuilder();
        header.dumpRep(sb);
        LogEntry logEntry = instantiateEntry(entryBuffer);
        logEntry.dumpRep(sb);
        return sb.toString();
    }
View Full Code Here

        if (!LogEntryType.LOG_TXN_COMMIT.equalsType(header.getType())) {
            return 0;
        }

        LogEntry commitEntry = instantiateEntry(entryBuffer);
        return commitEntry.getTransactionId();
    }
View Full Code Here

     * Returns the timestamp associated with the entry that we sync'ed on.
     */
    public long getTimeStamp()
        throws DatabaseException {

        LogEntry txnEndEntry = instantiateEntry(entryBuffer);
        if (txnEndEntry instanceof TxnEnd) {
            return ((TxnEnd) txnEndEntry.getMainItem()).getTime().getTime();
        }
        return 0L;
    }
View Full Code Here

     * @throws RuntimeException if there are any sequences that are not
     * negative.
     */
    public boolean verifyNegativeSequences(String debugTag) {

        LogEntry entry = null;
        try {
            entry = instantiateEntry(entryBuffer);
        } catch (DatabaseException e) {
            throw EnvironmentFailureException.unexpectedException(e);
        }

        if (entry.getTransactionId() >= 0) {
            throw EnvironmentFailureException.unexpectedState
                (debugTag + " txn id should be negative: " + entry);
        }

        if (entry instanceof LNLogEntry) {
View Full Code Here

TOP

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

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.