org.apache.derby.impl.store.raw.data
Class ContainerUndoOperation

java.lang.Object
  extended by org.apache.derby.impl.store.raw.data.ContainerBasicOperation
      extended by org.apache.derby.impl.store.raw.data.ContainerUndoOperation
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable, Formatable, TypedFormat, Compensation, Loggable

public class ContainerUndoOperation
extends ContainerBasicOperation
implements Compensation

A Container undo operation rolls back the change of a Container operation

See Also:
Serialized Form

Field Summary
private  ContainerOperation undoOp
           
 
Fields inherited from class org.apache.derby.impl.store.raw.data.ContainerBasicOperation
containerHdl, containerId
 
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
ContainerUndoOperation()
           
ContainerUndoOperation(RawContainerHandle hdl, ContainerOperation op)
          Set up a Container undo operation during run time rollback
 
Method Summary
 void doMe(Transaction xact, LogInstant instant, LimitObjectInput in)
          Apply the undo operation, in this implementation of the RawStore, it can only call the undoMe method of undoOp
 int getTypeFormatId()
          Return my format identifier.
 int group()
          A space operation is a RAWSTORE log record
 void readExternal(java.io.ObjectInput in)
           
 void releaseResource(Transaction xact)
          Release any resource that was acquired for doMe for rollback or recovery redo.
 void setUndoOp(Undoable op)
          Set up a Container undo operation during recovery redo.
 void writeExternal(java.io.ObjectOutput out)
           
 
Methods inherited from class org.apache.derby.impl.store.raw.data.ContainerBasicOperation
findContainer, findContainerForRedoRecovery, getPreparedLog, needsRedo, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.derby.iapi.store.raw.Loggable
getPreparedLog, needsRedo
 

Field Detail

undoOp

private transient ContainerOperation undoOp
Constructor Detail

ContainerUndoOperation

public ContainerUndoOperation(RawContainerHandle hdl,
                              ContainerOperation op)
                       throws StandardException
Set up a Container undo operation during run time rollback

Throws:
StandardException - container Handle is not active

ContainerUndoOperation

public ContainerUndoOperation()
Method Detail

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Specified by:
writeExternal in interface java.io.Externalizable
Overrides:
writeExternal in class ContainerBasicOperation
Throws:
java.io.IOException

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Specified by:
readExternal in interface java.io.Externalizable
Overrides:
readExternal in class ContainerBasicOperation
Throws:
java.io.IOException - cannot read log record from log stream
java.lang.ClassNotFoundException - cannot read ByteArray object

getTypeFormatId

public int getTypeFormatId()
Return my format identifier.

Specified by:
getTypeFormatId in interface TypedFormat
Returns:
The identifier. (A UUID stuffed in an array of 16 bytes).

setUndoOp

public void setUndoOp(Undoable op)
Set up a Container undo operation during recovery redo.

Specified by:
setUndoOp in interface Compensation
Parameters:
op - the Undoable operation
See Also:
Loggable.needsRedo(org.apache.derby.iapi.store.raw.Transaction)

doMe

public final void doMe(Transaction xact,
                       LogInstant instant,
                       LimitObjectInput in)
                throws StandardException,
                       java.io.IOException
Apply the undo operation, in this implementation of the RawStore, it can only call the undoMe method of undoOp

Specified by:
doMe in interface Loggable
Parameters:
xact - the Transaction that is doing the rollback
instant - the log instant of this compenstaion operation
in - optional data
Throws:
java.io.IOException - Can be thrown by any of the methods of ObjectInput.
StandardException - Standard Derby error policy.
See Also:
ContainerOperation.generateUndo(org.apache.derby.iapi.store.raw.Transaction, org.apache.derby.iapi.services.io.LimitObjectInput)

releaseResource

public void releaseResource(Transaction xact)
Description copied from interface: Loggable
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.

Specified by:
releaseResource in interface Loggable
Overrides:
releaseResource in class ContainerBasicOperation

group

public int group()
Description copied from class: ContainerBasicOperation
A space operation is a RAWSTORE log record

Specified by:
group in interface Loggable
Overrides:
group in class ContainerBasicOperation

Built on Thu 2011-03-10 11:54:14+0000, from revision ???

Apache Derby V10.6 Internals - Copyright © 2004,2007 The Apache Software Foundation. All Rights Reserved.