/** * @param savepoint must be less than mLength */ private void doRollback(long savepoint) throws IOException { byte[] opRef = new byte[1]; Index activeIndex = null; do { byte[] entry = pop(opRef, true); if (entry == null) { break; } byte op = opRef[0]; activeIndex = undo(activeIndex, op, entry); } while (savepoint < mLength); }
/** * @param savepoint must be less than mLength */ private void doRollback(long savepoint) throws IOException { // Implementation could be optimized somewhat, resulting in less // temporary arrays and copies. Rollback optimization is generally not // necessary, since most transactions are expected to commit. byte[] opRef = new byte[1]; Index activeIndex = null; do { byte[] entry = pop(opRef, true); if (entry == null) { break; } byte op = opRef[0]; activeIndex = undo(activeIndex, op, entry); } while (savepoint < mLength); }
/** * @param savepoint must be less than mLength */ private void doRollback(long savepoint) throws IOException { // Implementation could be optimized somewhat, resulting in less // temporary arrays and copies. Rollback optimization is generally not // necessary, since most transactions are expected to commit. byte[] opRef = new byte[1]; Index activeIndex = null; do { byte[] entry = pop(opRef, true); if (entry == null) { break; } byte op = opRef[0]; activeIndex = undo(activeIndex, op, entry); } while (savepoint < mLength); }
/** * Recover transactions which were recorded by this master log, keyed by * transaction id. Recovered transactions have a NO_REDO durability mode. * All transactions are registered, and so they must be reset after * recovery is complete. Master log is truncated as a side effect of * calling this method. */ void recoverTransactions(LHashTable.Obj<LocalTransaction> txns, LockMode lockMode, long timeoutNanos) throws IOException { byte[] opRef = new byte[1]; byte[] entry; while ((entry = pop(opRef, true)) != null) { UndoLog log = recoverUndoLog(opRef[0], entry); LocalTransaction txn = log.recoverTransaction(lockMode, timeoutNanos); // Reload the UndoLog, since recoverTransaction consumes it all. txn.recoveredUndoLog(recoverUndoLog(opRef[0], entry)); txns.insert(log.mTxnId).value = txn; } }
byte[] entry = pop(opRef, false); if (entry == null) { break;
byte[] entry = pop(opRef, false); if (entry == null) { break;
while ((entry = pop(opRef, true)) != null) { UndoLog log = recoverUndoLog(opRef[0], entry);
while ((entry = pop(opRef, true)) != null) { UndoLog log = recoverUndoLog(opRef[0], entry);
byte[] entry = pop(opRef, false); if (entry == null) { break;
Index activeIndex = null; do { byte[] entry = pop(opRef, true); if (entry == null) { break;
Index activeIndex = null; do { byte[] entry = pop(opRef, true); if (entry == null) { break;
Index activeIndex = null; do { byte[] entry = pop(opRef, true); if (entry == null) { break;