Package com.persistit.CheckpointManager

Examples of com.persistit.CheckpointManager.Checkpoint


        if (_closed.get() || !_initialized.get()) {
            return null;
        }
        cleanup();
        _journalManager.pruneObsoleteTransactions();
        final Checkpoint result = _checkpointManager.checkpoint();
        _journalManager.pruneObsoleteTransactions();
        return result;
    }
View Full Code Here


        validate();
        final Management management = _persistit.getManagement();
        final boolean wasAppendOnly = management.getJournalInfo().isAppendOnly();
        if (_checkpoint) {
            postMessage("Waiting for checkpoint", 0);
            final Checkpoint cp = _persistit.checkpoint();
            if (cp == null) {
                postMessage("Checkpoint failed", 0);
            } else {
                postMessage("Checkpoint " + cp + " written", 0);
            }
View Full Code Here

        if (_closed.get() || !_initialized.get()) {
            return null;
        }
        cleanup();
        _journalManager.pruneObsoleteTransactions();
        final Checkpoint result = _checkpointManager.checkpoint();
        _journalManager.pruneObsoleteTransactions();
        return result;
    }
View Full Code Here

            throw new CorruptJournalException("CP JournalRecord has incorrect length: " + recordSize
                    + " bytes at position " + addressToString(address, timestamp));
        }
        read(address, CP.OVERHEAD);
        final long systemTimeMillis = CP.getSystemTimeMillis(_readBuffer);
        final Checkpoint checkpoint = new Checkpoint(timestamp, systemTimeMillis, true);
        final long baseAddress = CP.getBaseAddress(_readBuffer);

        if (baseAddress < _baseAddress || baseAddress > _currentAddress) {
            throw new CorruptJournalException("Invalid base journal address " + baseAddress + " for CP record at "
                    + addressToString(address, timestamp));
        }
        _baseAddress = baseAddress;

        _lastValidCheckpoint = checkpoint;
        _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
                .log(checkpoint, addressToString(address, checkpoint.getTimestamp()));
        _persistit.getLogBase().recoveryRecord.log("CP", addressToString(address, timestamp), checkpoint
                + " pageMap.size()=" + _pageMap.size(), timestamp);
    }
View Full Code Here

            throw new CorruptJournalException("CP JournalRecord has incorrect length: " + recordSize
                    + " bytes at position " + addressToString(address, timestamp));
        }
        read(address, CP.OVERHEAD);
        final long systemTimeMillis = CP.getSystemTimeMillis(_readBuffer);
        final Checkpoint checkpoint = new Checkpoint(timestamp, systemTimeMillis, true);
        final long baseAddress = CP.getBaseAddress(_readBuffer);

        if (baseAddress < _baseAddress || baseAddress > _currentAddress) {
            throw new CorruptJournalException("Invalid base journal address " + baseAddress + " for CP record at "
                    + addressToString(address, timestamp));
        }
        _baseAddress = baseAddress;

        _lastValidCheckpoint = checkpoint;
        _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
                .log(checkpoint, addressToString(address, checkpoint.getTimestamp()));
        _persistit.getLogBase().recoveryRecord.log("CP", addressToString(address, timestamp), checkpoint
                + " pageMap.size()=" + _pageMap.size(), timestamp);
    }
View Full Code Here

        if (_closed.get() || !_initialized.get()) {
            return null;
        }
        cleanup();
        _journalManager.pruneObsoleteTransactions();
        final Checkpoint result = _checkpointManager.checkpoint();
        _journalManager.pruneObsoleteTransactions();
        return result;
    }
View Full Code Here

        if (_closed.get() || !_initialized.get()) {
            return null;
        }
        cleanup();
        _journalManager.pruneObsoleteTransactions();
        final Checkpoint result = _checkpointManager.checkpoint();
        _journalManager.pruneObsoleteTransactions();
        return result;
    }
View Full Code Here

            throw new CorruptJournalException("CP JournalRecord has incorrect length: " + recordSize
                    + " bytes at position " + addressToString(address, timestamp));
        }
        read(address, CP.OVERHEAD);
        final long systemTimeMillis = CP.getSystemTimeMillis(_readBuffer);
        final Checkpoint checkpoint = new Checkpoint(timestamp, systemTimeMillis, true);
        final long baseAddress = CP.getBaseAddress(_readBuffer);

        if (baseAddress < _baseAddress || baseAddress > _currentAddress) {
            throw new CorruptJournalException("Invalid base journal address " + baseAddress + " for CP record at "
                    + addressToString(address, timestamp));
        }
        _baseAddress = baseAddress;
        _persistit.getTimestampAllocator().updateTimestamp(timestamp);
        _lastValidCheckpoint = checkpoint;
        _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
                .log(checkpoint, addressToString(address, checkpoint.getTimestamp()));
        _persistit.getLogBase().recoveryRecord.log("CP", addressToString(address, timestamp), checkpoint
                + " pageMap.size()=" + _pageMap.size(), timestamp);
    }
View Full Code Here

        validate();
        final Management management = _persistit.getManagement();
        boolean wasAppendOnly = management.getJournalInfo().isAppendOnly();
        if (_checkpoint) {
            postMessage("Waiting for checkpoint", 0);
            final Checkpoint cp = _persistit.checkpoint();
            if (cp == null) {
                postMessage("Checkpoint failed", 0);
            } else {
                postMessage("Checkpoint " + cp + " written", 0);
            }
View Full Code Here

        if (_closed.get() || !_initialized.get()) {
            return null;
        }
        cleanup();
        _journalManager.pruneObsoleteTransactions();
        final Checkpoint result = _checkpointManager.checkpoint();
        _journalManager.pruneObsoleteTransactions();
        return result;
    }
View Full Code Here

TOP

Related Classes of com.persistit.CheckpointManager.Checkpoint

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.