Class B2IUndo
java.lang.Object
org.apache.derby.impl.store.access.btree.index.B2IUndo
- All Implemented Interfaces:
Externalizable
,Serializable
,Formatable
,TypedFormat
,LogicalUndo
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:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfindUndo
(Transaction rawtran, LogicalUndoable pageOp, LimitObjectInput in) Find the page and record to undo.int
Return my format identifier.void
Restore the in-memory representation from the stream.void
This object has no state, so nothing to write.
-
Constructor Details
-
B2IUndo
public B2IUndo()
-
-
Method Details
-
findUndo
public Page findUndo(Transaction rawtran, LogicalUndoable pageOp, LimitObjectInput in) throws StandardException, IOException 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.- Specified by:
findUndo
in interfaceLogicalUndo
- Parameters:
rawtran
- the transaction doing the rollbackpageOp
- the page operation that supports logical undo. This LogicalUndo function pointer is a field of that pageOperationin
- data stored in the log stream that contains the record data necessary to restore the row.- Throws:
StandardException
- Standard Derby error policyIOException
- Method may read from InputStream
-
getTypeFormatId
public int getTypeFormatId()Return my format identifier.- Specified by:
getTypeFormatId
in interfaceTypedFormat
- Returns:
- The identifier. (A UUID stuffed in an array of 16 bytes).
- See Also:
-
writeExternal
This object has no state, so nothing to write.- Specified by:
writeExternal
in interfaceExternalizable
- Throws:
IOException
-
readExternal
Restore the in-memory representation from the stream. This object has no state, so nothing to restore.- Specified by:
readExternal
in interfaceExternalizable
- Throws:
ClassNotFoundException
- Thrown if the stored representation is serialized and a class named in the stream could not be found.IOException
- See Also:
-