Examples of LogEntry


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

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

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

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

    public String dump()
        throws DatabaseException {

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

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

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

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

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

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

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

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

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

        LogEntry entry = null;
        try {
            entry = instantiateEntry(envImpl, 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) {
            if (LogEntryType.LOG_NAMELN_TRANSACTIONAL.equalsType
                (getEntryType())) {
                LNLogEntry lnEntry = (LNLogEntry) entry;
                lnEntry.postFetchInit(false /*isDupDb*/);
                NameLN nameLN = (NameLN) lnEntry.getLN();
                if (nameLN.getId().getId() >= 0) {
                    throw EnvironmentFailureException.unexpectedState
                        (debugTag + " db id should be negative: " + entry);
                }
            } else {
                if (entry.getDbId().getId() >= 0) {
                    throw EnvironmentFailureException.unexpectedState
                        (debugTag + " db id should be negative: " + entry);
                }
            }
        }
View Full Code Here

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

                if (!isLatchOwnerForWrite()) {
                    throw RelatchRequiredException.relatchRequiredException;
                }

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

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

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

        /* Read the entry and dump it into a string buffer. */
        LogEntry entry = lastEntryType.getSharedLogEntry();
        entry.readEntry(envImpl, currentEntryHeader, entryBuffer);
        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

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

    protected boolean processEntry(ByteBuffer entryBuffer)
        throws DatabaseException {

        final LogEntryType lastEntryType =
            LogEntryType.findType(currentEntryHeader.getType());
        final LogEntry entry = lastEntryType.getNewLogEntry();
        entry.readEntry(envImpl, currentEntryHeader, entryBuffer);

        ExtendedFileSummary summary =
                (ExtendedFileSummary) summaries.get(window.currentFileNum());
        if (summary == null) {
            summary = new ExtendedFileSummary();
            summaries.put(window.currentFileNum(), summary);
        }

        final int size = getLastEntrySize();

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

        if (entry instanceof LNLogEntry) {
            final LNLogEntry lnEntry = (LNLogEntry) entry;
            if (DEBUG) {
                final int otherSize = lnEntry.getLastLoggedSize();
                if (size != otherSize) {
                    System.out.println
                        ("LogReader.getLastEntrySize=" + size +
                         " LNEntry.getLastLoggedSize=" + otherSize +
                         " " + lnEntry.getLogType());
                }
            }

            /* Save transactional entry, apply non-transactional entry. */
            if (lastEntryType.isTransactional()) {
                final Long txnId = Long.valueOf(lnEntry.getTransactionId());
                List<Object> txnEntries = txns.get(txnId);
                if (txnEntries == null) {
                    txnEntries = new ArrayList<Object>();
                    txns.put(txnId, txnEntries);
                }
                txnEntries.add(summary);
                txnEntries.add(lnEntry);
            } else {
                twoEntryList.set(0, summary);
                twoEntryList.set(1, lnEntry);
                applyTxn(twoEntryList, true);
            }
        } else if (entry instanceof INLogEntry) {

            /* Count IN. */
            final INLogEntry inEntry = (INLogEntry) entry;
            final Long nodeId = Long.valueOf(inEntry.getNodeId());
            summary.totalINCount += 1;
            summary.totalINSize += size;
            countObsoleteIN(nodeId);
            putActiveIN(nodeId, size, summary, inEntry.getDbId().getId());

        } else if (entry instanceof BINDeltaLogEntry) {

            /* Count Delta as IN. */
            summary.totalINCount += 1;
            summary.totalINSize += size;

        } else if (entry instanceof SingleItemEntry) {

            /* Count deleted IN. */
            final Object item = ((SingleItemEntry) entry).getMainItem();
            final long deletedNodeId;
            if (item instanceof INDeleteInfo) {
                deletedNodeId = ((INDeleteInfo) item).getDeletedNodeId();
            } else if (item instanceof INDupDeleteInfo) {
                deletedNodeId = ((INDupDeleteInfo) item).getDeletedNodeId();
            } else {
                deletedNodeId = Node.NULL_NODE_ID;
            }
            if (deletedNodeId != Node.NULL_NODE_ID) {
                final Long nodeId = deletedNodeId;
                countObsoleteIN(nodeId);
                activeINs.remove(nodeId);
            }

            /* Apply transaction on commit or abort. */
            if (item instanceof TxnEnd) {
                final Long txnId = Long.valueOf(entry.getTransactionId());
                final List<Object> txnEntries = txns.remove(txnId);
                if (txnEntries != null) {
                    applyTxn(txnEntries, item instanceof TxnCommit);
                }
            }
View Full Code Here

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

    protected boolean processEntry(ByteBuffer entryBuffer)
        throws DatabaseException {

        LogEntryType lastEntryType =
            LogEntryType.findType(currentEntryHeader.getType());
        LogEntry entry = lastEntryType.getSharedLogEntry();
        entry.readEntry(envImpl, currentEntryHeader, entryBuffer);
        processEntryCallback(entry, lastEntryType);
        return true;
    }
View Full Code Here

Examples of com.twitter.zipkin.gen.LogEntry

        return false;
    }

    private LogEntry create(final Span span) throws TException {
        final String spanAsString = base64.encodeToString(spanToBytes(span));
        return new LogEntry("zipkin", spanAsString);
    }
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.