Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.derby.impl.store.raw.data
Class PhysicalPageOperation  view PhysicalPageOperation download PhysicalPageOperation.java

java.lang.Object
  extended byorg.apache.derby.impl.store.raw.data.PageBasicOperation
      extended byorg.apache.derby.impl.store.raw.data.PhysicalPageOperation
All Implemented Interfaces:
java.io.Externalizable, org.apache.derby.iapi.services.io.Formatable, org.apache.derby.iapi.store.raw.Loggable, org.apache.derby.iapi.store.raw.RePreparable, java.io.Serializable, org.apache.derby.iapi.services.io.TypedFormat, org.apache.derby.iapi.store.raw.Undoable
Direct Known Subclasses:
AllocPageOperation, ChainAllocPageOperation, CompressSpacePageOperation, CopyRowsOperation, InitPageOperation, InvalidatePageOperation, PurgeOperation, UpdateOperation

public abstract class PhysicalPageOperation
extends PageBasicOperation
implements org.apache.derby.iapi.store.raw.Undoable

An abstract class that is used for physical log operation. A physical log operation is one where the undo of the operation must be applied to the same page as the original operation, and the undo operation must store the byte image of the row(s) changed to its before image. (If a logical page operation happened to the page or if another transaction altered other rows on the page, the undo of this operation will only restore the before image of the row(s) affected).


Field Summary
 
Fields inherited from class org.apache.derby.impl.store.raw.data.PageBasicOperation
containerHdl, foundHere, page
 
Fields inherited from interface org.apache.derby.iapi.store.raw.Loggable
ABORT, BI_LOG, CHECKSUM, COMMIT, COMPENSATION, FILE_RESOURCE, FIRST, LAST, PREPARE, RAWSTORE, XA_NEEDLOCK
 
Constructor Summary
  PhysicalPageOperation()
           
protected PhysicalPageOperation(BasePage page)
           
 
Method Summary
 org.apache.derby.iapi.store.raw.Compensation generateUndo(org.apache.derby.iapi.store.raw.Transaction xact, org.apache.derby.iapi.services.io.LimitObjectInput in)
          Generate a Compensation (PageUndoOperation) that will rollback the changes of this page operation.
abstract  void undoMe(org.apache.derby.iapi.store.raw.Transaction xact, BasePage undoPage, org.apache.derby.iapi.store.raw.log.LogInstant CLRinstant, org.apache.derby.iapi.services.io.LimitObjectInput in)
          Undo the change indicated by this log operation and optional data.
 
Methods inherited from class org.apache.derby.impl.store.raw.data.PageBasicOperation
findpage, getPage, getPageForLoadTran, getPageId, getPageVersion, getPreparedLog, group, needsRedo, readExternal, reclaimPrepareLocks, releaseResource, resetPageNumber, restoreMe, toString, writeExternal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.derby.iapi.store.raw.Loggable
doMe, getPreparedLog, group, needsRedo, releaseResource
 
Methods inherited from interface java.io.Externalizable
readExternal, writeExternal
 
Methods inherited from interface org.apache.derby.iapi.services.io.TypedFormat
getTypeFormatId
 

Constructor Detail

PhysicalPageOperation

protected PhysicalPageOperation(BasePage page)

PhysicalPageOperation

public PhysicalPageOperation()
Method Detail

generateUndo

public org.apache.derby.iapi.store.raw.Compensation generateUndo(org.apache.derby.iapi.store.raw.Transaction xact,
                                                                 org.apache.derby.iapi.services.io.LimitObjectInput in)
                                                          throws org.apache.derby.iapi.error.StandardException
Generate a Compensation (PageUndoOperation) that will rollback the changes of this page operation. If this Page operation cannot or need not be rolled back (redo only), overwrite this function to return null.

Note
For operation that needs logical undo, use LogicalUndoOperation instead This implementation just finds the same page that the PageOperation was applied on - i.e., only works for undo on the same page.

During recovery redo, the logging system is page oriented and will use the pageID stored in the PageUndoOperation to find the page. The page will be latched and released using the default findpage and releaseResource - this.releaseResource() will still be called so it has to know not to release any resource it did not acquire.

Specified by:
generateUndo in interface org.apache.derby.iapi.store.raw.Undoable

undoMe

public abstract void undoMe(org.apache.derby.iapi.store.raw.Transaction xact,
                            BasePage undoPage,
                            org.apache.derby.iapi.store.raw.log.LogInstant CLRinstant,
                            org.apache.derby.iapi.services.io.LimitObjectInput in)
                     throws org.apache.derby.iapi.error.StandardException,
                            java.io.IOException
Undo the change indicated by this log operation and optional data. The page the undo should apply to is the latched undoPage, the recordId is the same as the roll forward operation.
In this RawStore implementation, should only only be called via CompOp.doMe.

The available() method of in indicates how much data can be read, i.e. how much was originally written.