/** DEBUG: Print self. */ public String toString() { if (SanityManager.DEBUG) { String str = "CLR : (logical undo) " + super.toString() + " undoRecordId = " + recordId; if (undoOp != null) str += "\n" + undoOp.toString(); else str += " undo Operation not set"; return str; } else return null; }
/** * Apply the undo operation, in this implementation of the RawStore, it can only call the undoMe * method of undoOp * * @param xact the Transaction that is doing the rollback * @param instant the log instant of this undo operation * @param in optional data * @exception IOException Can be thrown by any of the methods of ObjectInput. * @exception StandardException Standard Derby policy. */ public final void doMe(Transaction xact, LogInstant instant, LimitObjectInput in) throws StandardException, IOException { long oldversion = 0; // sanity check LogInstant oldLogInstant = null; // sanity check if (SanityManager.DEBUG) { oldLogInstant = this.page.getLastLogInstant(); oldversion = this.page.getPageVersion(); SanityManager.ASSERT(oldversion == this.getPageVersion()); SanityManager.ASSERT( oldLogInstant == null || instant == null || oldLogInstant.lessThan(instant)); } // if this is called during runtime rollback, PageOp.generateUndo found // the page and have it latched there. // if this is called during recovery redo, this.needsRedo found the page and // have it latched here // // in either case, this.page is the correct page and is latched. // // recordId is generated by generateUndo and is stored here. If this // is a physical undo, recordId is identical to that which is stored in // undoOp. If this is logical undo, it will be different if this.page // is different from the undoOp's page (which is where the rollfoward // change went to, and the record might have moved by now). // undoOp.undoMe(xact, this.page, recordId, instant, in); if (SanityManager.DEBUG) { SanityManager.ASSERT(oldversion < this.page.getPageVersion()); SanityManager.ASSERT(instant == null || instant.equals(this.page.getLastLogInstant())); } releaseResource(xact); }
/* make sure resource found in undoOp is released */ public void releaseResource(Transaction xact) { if (undoOp != null) undoOp.releaseResource(xact); super.releaseResource(xact); }
/** * Read this in * * @exception IOException error reading from log stream * @exception ClassNotFoundException log stream corrupted */ public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { super.readExternal(in); doMeSlot = CompressedNumber.readInt(in); fieldId = CompressedNumber.readInt(in); }
public void writeExternal(ObjectOutput out) throws IOException { super.writeExternal(out); CompressedNumber.writeInt(out, doMeSlot); CompressedNumber.writeInt(out, fieldId); }