Top Description Constructors Methods
org.apache.derby.impl.store.access.btree.index

public Class B2IUndo

extends Object
implements LogicalUndo, Formatable
Class Inheritance
All Implemented Interfaces
org.apache.derby.iapi.services.io.Formatable, org.apache.derby.iapi.services.io.TypedFormat, java.io.Externalizable, java.io.Serializable, org.apache.derby.iapi.store.access.conglomerate.LogicalUndo
Imports
org.apache.derby.shared.common.reference.SQLState, org.apache.derby.shared.common.sanity.SanityManager, org.apache.derby.iapi.services.io.Formatable, .StoredFormatIds, .LimitObjectInput, org.apache.derby.shared.common.error.StandardException, org.apache.derby.iapi.store.access.conglomerate.LogicalUndo, .TransactionManager, org.apache.derby.iapi.store.access.RowUtil, .DynamicCompiledOpenConglomInfo, .ScanController, org.apache.derby.iapi.store.raw.ContainerHandle, .FetchDescriptor, .LogicalUndoable, .Page, .RecordHandle, .Transaction, org.apache.derby.iapi.types.DataValueDescriptor, org.apache.derby.impl.store.access.btree.BTree, .BTreeLockingPolicy, .ControlRow, .OpenBTree, .SearchParameters, java.io.ObjectInput, .IOException, .ObjectOutput

The B2IUndo interface packages up the routines which the rawstore needs to call to perform logical undo of a record in a B2i. The rawstore will determine that a page has changed since the record was written, and if it has it will call the findUndo() interface, to find the page where the record exists (as it may have moved).

This class must not contain any persistent state, as this class is stored in the log record of the insert/delete.

See Also
org.apache.derby.iapi.store.raw.LogicalUndoable, org.apache.derby.iapi.store.raw.Undoable#generateUndo

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Page
findUndo(Transaction
the transaction doing the rollback
rawtran
,
LogicalUndoable
the page operation that supports logical undo. This LogicalUndo function pointer is a field of that pageOperation
pageOp
,
LimitObjectInput
data stored in the log stream that contains the record data necessary to restore the row.
in
)

Implements org.apache.derby.iapi.store.access.conglomerate.LogicalUndo.findUndo.

Find the page and record to undo.

public int
public void
readExternal(ObjectInput
the stream to read data from in order to restore the object
in
)

Implements java.io.Externalizable.readExternal.

Restore the in-memory representation from the stream.

public void
writeExternal(ObjectOutput
the stream to write the object to
out
)

Implements java.io.Externalizable.writeExternal.

This object has no state, so nothing to write.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

B2IUndoback to summary
public B2IUndo()

Method Detail

findUndoback to summary
public Page findUndo(Transaction rawtran, LogicalUndoable pageOp, LimitObjectInput in) throws StandardException, IOException

Implements org.apache.derby.iapi.store.access.conglomerate.LogicalUndo.findUndo.

Find the page and record to undo. If no logical undo is necessary, i.e., row has not moved, then just return the latched page where undo should go. If the record has moved, it has a new recordId on the new page, this routine needs to call pageOp.resetRecord with the new RecordHandle so that the logging system can update the compensation Operation with the new location.

Parameters
rawtran:Transaction

the transaction doing the rollback

pageOp:LogicalUndoable

the page operation that supports logical undo. This LogicalUndo function pointer is a field of that pageOperation

in:LimitObjectInput

data stored in the log stream that contains the record data necessary to restore the row.

Exceptions
StandardException:
Standard Derby error policy
IOException:
Method may read from InputStream
getTypeFormatIdback to summary
public int getTypeFormatId()

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

Return my format identifier.

Returns:int

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

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

See Also
org.apache.derby.iapi.services.io.TypedFormat#getTypeFormatId
readExternalback to summary
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException

Implements java.io.Externalizable.readExternal.

Restore the in-memory representation from the stream. This object has no state, so nothing to restore.

Parameters
in:ObjectInput

Doc from java.io.Externalizable.readExternal.

the stream to read data from in order to restore the object

Exceptions
IOException:

Doc from java.io.Externalizable.readExternal.

if I/O errors occur

ClassNotFoundException:
Thrown if the stored representation is serialized and a class named in the stream could not be found.
See Also
java.io.Externalizable#readExternal
writeExternalback to summary
public void writeExternal(ObjectOutput out) throws IOException

Implements java.io.Externalizable.writeExternal.

This object has no state, so nothing to write.

Parameters
out:ObjectOutput

Doc from java.io.Externalizable.writeExternal.

the stream to write the object to

Exceptions
IOException:

Doc from java.io.Externalizable.writeExternal.

Includes any I/O exceptions that may occur