Package org.exist.util

Examples of org.exist.util.ProgressBar


            final Long2ObjectHashMap<Loggable> txnsStarted = new Long2ObjectHashMap<Loggable>();
            Checkpoint lastCheckpoint = null;
            long lastLsn = Lsn.LSN_INVALID;
                  Loggable next;
                  try {
            final ProgressBar progress = new ProgressBar("Scanning journal ", last.length());
                while ((next = reader.nextEntry()) != null) {
//                          LOG.debug(next.dump());
              progress.set(Lsn.getOffset(next.getLsn()));
              if (next.getLogType() == LogEntryTypes.TXN_START) {
                        // new transaction starts: add it to the transactions table
                        txnsStarted.put(next.getTransactionId(), next);
                    } else if (next.getLogType() == LogEntryTypes.TXN_ABORT) {
                      // transaction aborted: remove it from the transactions table
View Full Code Here


            final Long2ObjectHashMap<Loggable> runningTxns = new Long2ObjectHashMap<Loggable>();

            // ------- REDO ---------
            if (LOG.isInfoEnabled())
                {LOG.info("First pass: redoing " + txnCount + " transactions...");}
            final ProgressBar progress = new ProgressBar("Redo ", last.length());
            Loggable next = null;
            int redoCnt = 0;
            try {
                while ((next = reader.nextEntry()) != null) {
                    SanityCheck.ASSERT(next.getLogType() != LogEntryTypes.CHECKPOINT,
                            "Found a checkpoint during recovery run! This should not ever happen.");
                    if (next.getLogType() == LogEntryTypes.TXN_START) {
                        // new transaction starts: add it to the transactions table
                        runningTxns.put(next.getTransactionId(), next);
                    } else if (next.getLogType() == LogEntryTypes.TXN_COMMIT) {
                        // transaction committed: remove it from the transactions table
                        runningTxns.remove(next.getTransactionId());
                        redoCnt++;
                    } else if (next.getLogType() == LogEntryTypes.TXN_ABORT) {
                        // transaction aborted: remove it from the transactions table
                        runningTxns.remove(next.getTransactionId());
                    }
        //            LOG.debug("Redo: " + next.dump());
                    // redo the log entry
                    next.redo();
                    progress.set(Lsn.getOffset(next.getLsn()));
                    if (next.getLsn() == lastLsn)
                        {break;} // last readable entry reached. Stop here.
                }
            } catch (final Exception e) {
                LOG.error("Exception caught while redoing transactions. Aborting recovery to avoid possible damage. " +
View Full Code Here

TOP

Related Classes of org.exist.util.ProgressBar

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.