|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.derby.impl.store.raw.data.RemoveFileOperation
Field Summary | |
private StorageFile |
fileToGo
|
private long |
generationId
|
private java.lang.String |
name
|
private boolean |
removeAtOnce
|
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 | |
|
RemoveFileOperation()
|
(package private) |
RemoveFileOperation(java.lang.String name,
long generationId,
boolean removeAtOnce)
|
Method Summary | |
void |
doMe(Transaction xact,
LogInstant instant,
LimitObjectInput in)
Apply the change indicated by this operation and optional data. |
Compensation |
generateUndo(Transaction xact,
LimitObjectInput in)
Generate a loggable which will undo this change, using the optional input if necessary. |
ByteArray |
getPreparedLog()
the default for prepared log is always null for all the operations that don't have optionalData. |
int |
getTypeFormatId()
Return my format identifier. |
int |
group()
A space operation is a RAWSTORE log record |
boolean |
needsRedo(Transaction xact)
Determine if the operation should be reapplied in recovery redo. |
void |
readExternal(java.io.ObjectInput in)
|
void |
releaseResource(Transaction tran)
Release any resource that was acquired for doMe for rollback or recovery redo. |
void |
writeExternal(java.io.ObjectOutput out)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private java.lang.String name
private long generationId
private boolean removeAtOnce
private transient StorageFile fileToGo
Constructor Detail |
public RemoveFileOperation()
RemoveFileOperation(java.lang.String name, long generationId, boolean removeAtOnce)
Method Detail |
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
java.io.IOException
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
java.io.IOException
java.lang.ClassNotFoundException
public int getTypeFormatId()
getTypeFormatId
in interface TypedFormat
public ByteArray getPreparedLog()
getPreparedLog
in interface Loggable
public void releaseResource(Transaction tran)
Loggable
releaseResource
in interface Loggable
public int group()
group
in interface Loggable
public void doMe(Transaction xact, LogInstant instant, LimitObjectInput in) throws StandardException
Loggable
The available() method of in indicates how much data can be read, i.e. how much was originally written.
doMe
in interface Loggable
xact
- the Transactioninstant
- the log instant of this operationin
- optional data
StandardException
- Standard Cloudscape policy.public boolean needsRedo(Transaction xact) throws StandardException
Loggable
The sequence of events in recovery redo of a Loggable operation is:
needsRedo
in interface Loggable
xact
- The transaction trying to redo this operation
StandardException
- Standard Cloudscape error policyLoggable.releaseResource(org.apache.derby.iapi.store.raw.Transaction)
public Compensation generateUndo(Transaction xact, LimitObjectInput in) throws StandardException, java.io.IOException
Undoable
NOTE
Any logical undo logic must be hidden behind generateUndo.
During recovery redo, it should not depend on any logical undo logic.
There are 3 ways to implement a redo-only log record:
Any resource (e.g., latched page) that is needed for the
undoable.undoMe() must be acquired in undoable.generateUndo().
Moreover, that resource must be identified in the compensation
operation, and reacquired in the compensation.needsRedo() method during
recovery redo.
If you do write your own generateUndo or needsRedo, any
resource you latch or acquire, you must release them in
Compensation.doMe() or in Compensation.releaseResource().
To write a generateUndo operation, find the object that needs to be rolled back. Assuming that it is a page, latch it, put together a Compensation operation with the undoOp set to this operation, and save the page number in the compensation operation, then return the Compensation operation to the logging system.
The sequence of events in a rollback of a undoable operation is
The available() method of in indicates how much data can be read, i.e. how much was originally written.
generateUndo
in interface Undoable
xact
- the transaction doing the rollback
java.io.IOException
- Can be thrown by any of the methods of ObjectInput.
StandardException
- Standard Cloudscape policy.Loggable.releaseResource(org.apache.derby.iapi.store.raw.Transaction)
,
Loggable.needsRedo(org.apache.derby.iapi.store.raw.Transaction)
|
Built on Mon 2007-06-04 09:58:47+0400, from revision ??? | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |