Top Description Fields Constructors Methods
org.apache.derby.impl.store.raw.data

pack-priv abstract Class PhysicalPageOperation

extends PageBasicOperation
implements Undoable
Class Inheritance
All Implemented Interfaces
org.apache.derby.iapi.store.raw.Undoable, org.apache.derby.iapi.store.raw.Loggable, org.apache.derby.iapi.services.io.Formatable, org.apache.derby.iapi.services.io.TypedFormat, java.io.Externalizable, java.io.Serializable
Known Direct Subclasses
org.apache.derby.impl.store.raw.data.PurgeOperation, org.apache.derby.impl.store.raw.data.UpdateOperation, org.apache.derby.impl.store.raw.data.CompressSpacePageOperation, org.apache.derby.impl.store.raw.data.AllocPageOperation, org.apache.derby.impl.store.raw.data.ChainAllocPageOperation, org.apache.derby.impl.store.raw.data.CopyRowsOperation, org.apache.derby.impl.store.raw.data.InitPageOperation, org.apache.derby.impl.store.raw.data.InvalidatePageOperation
Imports
org.apache.derby.iapi.store.raw.Compensation, .Transaction, .Undoable, org.apache.derby.iapi.store.raw.log.LogInstant, org.apache.derby.shared.common.error.StandardException, java.io.IOException, org.apache.derby.iapi.services.io.LimitObjectInput

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

Inherited from org.apache.derby.impl.store.raw.data.PageBasicOperation:
containerHdlfoundHerepage

Constructor Summary

AccessConstructor and Description
pack-priv
public

Method Summary

Modifier and TypeMethod and Description
public Compensation

Returns:

the compensation operation that will rollback this change
generateUndo
(Transaction
the transaction doing the compensating
xact
,
LimitObjectInput
optional input
in
)

Implements org.apache.derby.iapi.store.raw.Undoable.generateUndo.

Generate a Compensation (PageUndoOperation) that will rollback the changes of this page operation.

public abstract void
undoMe(Transaction
the Transaction doing the rollback
xact
,
BasePage
the page to rollback changes on
undoPage
,
LogInstant
the log instant of this (PageUndo) operation
CLRinstant
,
LimitObjectInput
optional data for the rollback operation
in
)

Undo the change indicated by this log operation and optional data.

Inherited from org.apache.derby.impl.store.raw.data.PageBasicOperation:
findpagegetPagegetPageForRedoRecoverygetPageIdgetPageVersiongetPreparedLoggroupneedsRedoreadExternalreclaimPrepareLocksreleaseResourceresetPageNumberrestoreMetoStringwriteExternal

Constructor Detail

PhysicalPageOperationback to summary
pack-priv PhysicalPageOperation(BasePage page)
PhysicalPageOperationback to summary
public PhysicalPageOperation()

Method Detail

generateUndoback to summary
public Compensation generateUndo(Transaction xact, LimitObjectInput in) throws StandardException

Implements org.apache.derby.iapi.store.raw.Undoable.generateUndo.

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.

Parameters
xact:Transaction

the transaction doing the compensating

in:LimitObjectInput

optional input

Returns:Compensation

the compensation operation that will rollback this change

Exceptions
StandardException:
Standard Derby policy.
See Also
PageBasicOperation, Undoable#generateUndo
undoMeback to summary
public abstract void undoMe(Transaction xact, BasePage undoPage, LogInstant CLRinstant, LimitObjectInput in) throws StandardException, 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.

Parameters
xact:Transaction

the Transaction doing the rollback

undoPage:BasePage

the page to rollback changes on

CLRinstant:LogInstant

the log instant of this (PageUndo) operation

in:LimitObjectInput

optional data for the rollback operation

Exceptions
StandardException:
Standard Derby policy.
IOException:
Can be thrown by any of the methods of ObjectInput.