Package com.persistit.JournalManager

Examples of com.persistit.JournalManager.TransactionMapItem


                    for (final Map.Entry<Integer, TreeDescriptor> entry : map.entrySet()) {
                        postMessage(String.format("%,5d -> %s", entry.getKey(), entry.getValue()), LOG_NORMAL);
                    }
                }
                if (ts != -1) {
                    final TransactionMapItem item = _persistit.getJournalManager().queryTransactionMap(ts);
                    postMessage(String.format("TransactionMapItem for ts=%,d -> %s", ts, item), LOG_NORMAL);
                }
                if (pageAddress != -1) {
                    postMessage("Page Nodes", LOG_NORMAL);
                    if (volumeHandle != -1) {
View Full Code Here


                    for (final Map.Entry<Integer, TreeDescriptor> entry : map.entrySet()) {
                        postMessage(String.format("%,5d -> %s", entry.getKey(), entry.getValue()), LOG_NORMAL);
                    }
                }
                if (ts != -1) {
                    final TransactionMapItem item = _persistit.getJournalManager().queryTransactionMap(ts);
                    postMessage(String.format("TransactionMapItem for ts=%,d -> %s", ts, item), LOG_NORMAL);
                }
                if (pageAddress != -1) {
                    postMessage("Page Nodes", LOG_NORMAL);
                    if (volumeHandle != -1) {
View Full Code Here

            final long commitTimestamp = TM.getEntryCommitTimestamp(_readBuffer, index);
            final long journalAddress = TM.getEntryJournalAddress(_readBuffer, index);
            final long lastRecordAddress = TM.getLastRecordAddress(_readBuffer, index);

            if (!isZombieTransaction(journalAddress)) {
                final TransactionMapItem ts = new TransactionMapItem(startTimestamp, journalAddress);
                final Long key = Long.valueOf(startTimestamp);
                ts.setCommitTimestamp(commitTimestamp);
                ts.setLastRecordAddress(lastRecordAddress);
                if (_recoveredTransactionMap.put(key, ts) != null) {
                    throw new CorruptJournalException("Redundant record in TransactionMap record " + ts + " entry "
                            + (count - remaining + 1) + " at " + addressToString(address, startTimestamp));

                }
View Full Code Here

        _lastValidCheckpointJournalAddress = address;

        for (final Iterator<Map.Entry<Long, TransactionMapItem>> iterator = _recoveredTransactionMap.entrySet()
                .iterator(); iterator.hasNext();) {
            final Map.Entry<Long, TransactionMapItem> entry = iterator.next();
            final TransactionMapItem ts = entry.getValue();
            if (ts.isCommitted() && ts.getCommitTimestamp() < timestamp) {
                iterator.remove();
            } else if (_abortedTransactionMap.get(ts.getStartTimestamp()) != null) {
                iterator.remove();
                _abortedTransactionMap.remove(ts.getStartTimestamp());
            } else if (isZombieTransaction(ts.getStartAddress())) {
                iterator.remove();
            }
        }

        _persistit.getLogBase().checkpointRecovered
View Full Code Here

            //
            // Count committed and uncommitted transactions.
            //
            for (final Iterator<TransactionMapItem> iterator = _recoveredTransactionMap.values().iterator(); iterator
                    .hasNext();) {
                final TransactionMapItem item = iterator.next();
                if (item.isCommitted()) {
                    _committedTransactionCount++;
                } else if (item.getStartTimestamp() < _lastValidCheckpoint.getTimestamp()) {
                    _uncommittedTransactionCount++;
                    try {
                        _persistit.getTransactionIndex().injectAbortedTransaction(item.getStartTimestamp());
                    } catch (final InterruptedException ie) {
                        throw new PersistitInterruptedException(ie);
                    }
                } else {
                    /*
 
View Full Code Here

        if (isZombieTransaction(address)) {
            return;
        }
        if (commitTimestamp == ABORTED) {
            TransactionMapItem item = _abortedTransactionMap.get(key);
            if (item == null) {
                item = new TransactionMapItem(startTimestamp, address);
                item.setCommitTimestamp(ABORTED);
                _abortedTransactionMap.put(key, item);
            } else {
                throw new CorruptJournalException("Duplicate transaction abort records with same timestamp(" + key
                        + "): previous/current=" + item.getStartAddress() + "/"
                        + addressToString(address, startTimestamp));
            }
        } else {
            TransactionMapItem item = _recoveredTransactionMap.get(key);
            if (item == null) {
                if (backchainAddress != 0) {
                    throw new CorruptJournalException("Missing transaction record at with timestamp(" + key
                            + "): previous/current=" + backchainAddress + "/"
                            + addressToString(address, startTimestamp));
                }
                item = new TransactionMapItem(startTimestamp, address);
                _recoveredTransactionMap.put(key, item);

            } else {
                if (backchainAddress == 0) {
                    throw new CorruptJournalException("Duplicate transactions with same timestamp(" + key
                            + "): previous/current=" + item.getStartAddress() + "/"
                            + addressToString(address, startTimestamp));
                }
                if (item.isCommitted()) {
                    throw new CorruptJournalException("Redundant Transaction Commit Record for " + item + " at "
                            + addressToString(address, startTimestamp));
                }
                if (backchainAddress != item.getLastRecordAddress()) {
                    throw new CorruptJournalException("Broken backchain at " + addressToString(address)
                            + " does not match previous record " + item);
                }
                item.setLastRecordAddress(address);
            }
            item.setCommitTimestamp(commitTimestamp);
            _persistit.getTimestampAllocator().updateTimestamp(commitTimestamp);
        }

    }
View Full Code Here

         * timestamp to the checkpoint timestamp to ensure it gets applied
         * first. This is required to ensure all Accumulator values are
         * initialized correctly to their checkpoint snapshot values before any
         * deltas are applied.
         */
        final TransactionMapItem checkpointTransactionItem = _recoveredTransactionMap.get(_lastValidCheckpoint
                .getTimestamp());
        if (checkpointTransactionItem != null) {
            checkpointTransactionItem.setCommitTimestamp(_lastValidCheckpoint.getTimestamp());
        }

        final SortedSet<TransactionMapItem> sorted = new TreeSet<TransactionMapItem>(_recoveredTransactionMap.values());

        if (!sorted.isEmpty()) {
            final TransactionMapItem last = sorted.last();
            assert last.getCommitTimestamp() <= _persistit.getTimestampAllocator().getCurrentTimestamp();
        }

        for (final TransactionMapItem item : sorted) {
            final TransactionPlayerListener listener = item.isCommitted() ? commitListener : rollbackListener;
            try {
View Full Code Here

            final long commitTimestamp = TM.getEntryCommitTimestamp(_readBuffer, index);
            final long journalAddress = TM.getEntryJournalAddress(_readBuffer, index);
            final long lastRecordAddress = TM.getLastRecordAddress(_readBuffer, index);

            if (!isZombieTransaction(journalAddress)) {
                final TransactionMapItem ts = new TransactionMapItem(startTimestamp, journalAddress);
                final Long key = Long.valueOf(startTimestamp);
                ts.setCommitTimestamp(commitTimestamp);
                ts.setLastRecordAddress(lastRecordAddress);
                if (_recoveredTransactionMap.put(key, ts) != null) {
                    throw new CorruptJournalException("Redundant record in TransactionMap record " + ts + " entry "
                            + (count - remaining + 1) + " at " + addressToString(address, startTimestamp));

                }
View Full Code Here

        _lastValidCheckpointJournalAddress = address;

        for (final Iterator<Map.Entry<Long, TransactionMapItem>> iterator = _recoveredTransactionMap.entrySet()
                .iterator(); iterator.hasNext();) {
            final Map.Entry<Long, TransactionMapItem> entry = iterator.next();
            final TransactionMapItem ts = entry.getValue();
            if (ts.isCommitted() && ts.getCommitTimestamp() < timestamp) {
                iterator.remove();
            } else if (_abortedTransactionMap.get(ts.getStartTimestamp()) != null) {
                iterator.remove();
                _abortedTransactionMap.remove(ts.getStartTimestamp());
            } else if (isZombieTransaction(ts.getStartAddress())) {
                iterator.remove();
            }
        }

        _persistit.getLogBase().checkpointRecovered
View Full Code Here

            //
            // Count committed and uncommitted transactions.
            //
            for (final Iterator<TransactionMapItem> iterator = _recoveredTransactionMap.values().iterator(); iterator
                    .hasNext();) {
                final TransactionMapItem item = iterator.next();
                if (item.isCommitted()) {
                    _committedTransactionCount++;
                } else if (item.getStartTimestamp() < _lastValidCheckpoint.getTimestamp()) {
                    _uncommittedTransactionCount++;
                    try {
                        _persistit.getTransactionIndex().injectAbortedTransaction(item.getStartTimestamp());
                    } catch (final InterruptedException ie) {
                        throw new PersistitInterruptedException(ie);
                    }
                } else {
                    /*
 
View Full Code Here

TOP

Related Classes of com.persistit.JournalManager.TransactionMapItem

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.