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

public final Class PhysicalUndoOperation

extends PageBasicOperation
implements Compensation
Class Inheritance
All Implemented Interfaces
org.apache.derby.iapi.store.raw.Compensation, 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
Imports
org.apache.derby.iapi.services.io.StoredFormatIds, .LimitObjectInput, org.apache.derby.shared.common.sanity.SanityManager, org.apache.derby.iapi.store.raw.Compensation, .Loggable, .Transaction, .Undoable, org.apache.derby.iapi.store.raw.log.LogInstant, org.apache.derby.shared.common.error.StandardException, org.apache.derby.iapi.util.ByteArray, java.io.IOException

PhysicalUndoOperation is a compensation operation that rolls back the change of an Undo-able operation. A PhysicalUndoOperation itself is not undo-able, i.e, it is loggable but not undoable.

Field Summary

Modifier and TypeField and Description
private transient PhysicalPageOperation
undoOp

The operation to be rolled back

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

Constructor Summary

AccessConstructor and Description
pack-priv
pack-priv
PhysicalUndoOperation(BasePage page, PhysicalPageOperation op)

Set up a compensation operation during run time rollback

public
PhysicalUndoOperation()

Return my format identifier.

Method Summary

Modifier and TypeMethod and Description
public final void
doMe(Transaction
the Transaction that is doing the rollback
xact
,
LogInstant
the log instant of this undo operation
instant
,
LimitObjectInput
optional data
in
)

Implements org.apache.derby.iapi.store.raw.Loggable.doMe.

Apply the undo operation, in this implementation of the RawStore, it can only call the undoMe method of undoOp

public final ByteArray
getPreparedLog()

Overrides org.apache.derby.impl.store.raw.data.PageBasicOperation.getPreparedLog.

Implements org.apache.derby.iapi.store.raw.Loggable.getPreparedLog.

The log operations are responsible to create the ByteArray, and the log operations should write out any optional data for the change to the ByteArray.

public int
getTypeFormatId()

Implements org.apache.derby.iapi.services.io.TypedFormat.getTypeFormatId.

Get a universally unique identifier for the type of this object.

public int
public void
releaseResource(Transaction xact)

Overrides org.apache.derby.impl.store.raw.data.PageBasicOperation.releaseResource.

Implements org.apache.derby.iapi.store.raw.Loggable.releaseResource.

Release any resource that was acquired for doMe for rollback or recovery redo.

public void
restoreMe(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
)

Implements abstract org.apache.derby.impl.store.raw.data.PageBasicOperation.restoreMe.

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

public void
setUndoOp(Undoable
the Undoable operation
op
)

Implements org.apache.derby.iapi.store.raw.Compensation.setUndoOp.

Set up a PageUndoOperation during recovery redo.

public String
Inherited from org.apache.derby.impl.store.raw.data.PageBasicOperation:
findpagegetPagegetPageForRedoRecoverygetPageIdgetPageVersionneedsRedoreadExternalreclaimPrepareLocksresetPageNumberwriteExternal

Field Detail

undoOpback to summary
private transient PhysicalPageOperation undoOp

The operation to be rolled back

Constructor Detail

PhysicalUndoOperationback to summary
pack-priv PhysicalUndoOperation(BasePage page)
PhysicalUndoOperationback to summary
pack-priv PhysicalUndoOperation(BasePage page, PhysicalPageOperation op)

Set up a compensation operation during run time rollback

PhysicalUndoOperationback to summary
public PhysicalUndoOperation()

Return my format identifier.

Method Detail

doMeback to summary
public final void doMe(Transaction xact, LogInstant instant, LimitObjectInput in) throws StandardException, IOException

Implements org.apache.derby.iapi.store.raw.Loggable.doMe.

Apply the undo operation, in this implementation of the RawStore, it can only call the undoMe method of undoOp

Parameters
xact:Transaction

the Transaction that is doing the rollback

instant:LogInstant

the log instant of this undo operation

in:LimitObjectInput

optional data

Exceptions
StandardException:
Standard Derby policy.
IOException:
Can be thrown by any of the methods of InputStream.
getPreparedLogback to summary
public final ByteArray getPreparedLog()

Overrides org.apache.derby.impl.store.raw.data.PageBasicOperation.getPreparedLog.

Implements org.apache.derby.iapi.store.raw.Loggable.getPreparedLog.

Doc from org.apache.derby.iapi.store.raw.Loggable.getPreparedLog.

The log operations are responsible to create the ByteArray, and the log operations should write out any optional data for the change to the ByteArray. The ByteArray can be prepared when the log operation is constructed, or it can be prepared when getPreparedLog() is called. Called by the log manager to allow the log operation to pass the buffer which contains optional data that will be available in to doMe() methods.

getTypeFormatIdback to summary
public int getTypeFormatId()

Implements org.apache.derby.iapi.services.io.TypedFormat.getTypeFormatId.

Doc from org.apache.derby.iapi.services.io.TypedFormat.getTypeFormatId.

Get a universally unique identifier for the type of this object.

Returns:int

The identifier. (A UUID stuffed in an array of 16 bytes).

groupback to summary
public int group()

Overrides org.apache.derby.impl.store.raw.data.PageBasicOperation.group.

Implements org.apache.derby.iapi.store.raw.Loggable.group.

Doc from org.apache.derby.iapi.store.raw.Loggable.group.

Get the loggable's group value

releaseResourceback to summary
public void releaseResource(Transaction xact)

Overrides org.apache.derby.impl.store.raw.data.PageBasicOperation.releaseResource.

Implements org.apache.derby.iapi.store.raw.Loggable.releaseResource.

Doc from org.apache.derby.iapi.store.raw.Loggable.releaseResource.

Release any resource that was acquired for doMe for rollback or recovery redo. This resource is acquired in either generateUndo (if this is a compensation operation during run time rollback or recovery rollback) or in needsRedo (if this is during recovery redo). The run time transaction context should have all the resource already acquird for run time roll forward, so there is no need to releaseResource during run time roll forward. This method must be safe to be called multiple times.

restoreMeback to summary
public void restoreMe(Transaction xact, BasePage undoPage, LogInstant CLRinstant, LimitObjectInput in)

Implements abstract org.apache.derby.impl.store.raw.data.PageBasicOperation.restoreMe.

Doc from org.apache.derby.impl.store.raw.data.PageBasicOperation.restoreMe.

Undo the change indicated by this log operation and optional data. The page the undo should apply to is the latched undoPage. The undoPage must be the same page as the doMe page and the undo operation must restore the before image of the row that changed.
this can only be used under special circumstances: namely table level locking, and no internal or nested transaction, and all operations are rollec back with restoreMe instead of undoMe.
This method is here to support BeforeImageLogging

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

setUndoOpback to summary
public void setUndoOp(Undoable op)

Implements org.apache.derby.iapi.store.raw.Compensation.setUndoOp.

Set up a PageUndoOperation during recovery redo.

Parameters
op:Undoable

Doc from org.apache.derby.iapi.store.raw.Compensation.setUndoOp.

the Undoable operation

toStringback to summary
public String toString()

Overrides org.apache.derby.impl.store.raw.data.PageBasicOperation.toString.

DEBUG: Print self.

Returns:String

Doc from java.lang.Object.toString.

a string representation of the object