Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.derby.impl.store.raw.data
Class AllocPageOperation  view AllocPageOperation download AllocPageOperation.java

java.lang.Object
  extended byorg.apache.derby.impl.store.raw.data.PageBasicOperation
      extended byorg.apache.derby.impl.store.raw.data.PhysicalPageOperation
          extended byorg.apache.derby.impl.store.raw.data.AllocPageOperation
All Implemented Interfaces:
java.io.Externalizable, org.apache.derby.iapi.services.io.Formatable, org.apache.derby.iapi.store.raw.Loggable, org.apache.derby.iapi.store.raw.RePreparable, java.io.Serializable, org.apache.derby.iapi.services.io.TypedFormat, org.apache.derby.iapi.store.raw.Undoable

public final class AllocPageOperation
extends PhysicalPageOperation


Field Summary
protected  int doStatus
           
protected  long newPageNumber
           
protected  int undoStatus
           
 
Fields inherited from class org.apache.derby.impl.store.raw.data.PageBasicOperation
containerHdl, foundHere, page
 
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
AllocPageOperation()
           
AllocPageOperation(AllocPage allocPage, long pageNumber, int doStatus, int undoStatus)
           
 
Method Summary
 void doMe(org.apache.derby.iapi.store.raw.Transaction tran, org.apache.derby.iapi.store.raw.log.LogInstant instant, org.apache.derby.iapi.services.io.LimitObjectInput in)
          Allocate/deallocate/free this page number
 int getTypeFormatId()
          Return my format identifier.
 void readExternal(java.io.ObjectInput in)
          This method restores an object's state by reading in the instance data for the object from the passed in stream.
 void restoreMe(org.apache.derby.iapi.store.raw.Transaction xact, BasePage undoPage, org.apache.derby.iapi.store.raw.log.LogInstant CLRinstant, org.apache.derby.iapi.services.io.LimitObjectInput in)
          Undo the change indicated by this log operation and optional data.
 java.lang.String toString()
          debug
 void undoMe(org.apache.derby.iapi.store.raw.Transaction xact, BasePage undoPage, org.apache.derby.iapi.store.raw.log.LogInstant CLRInstant, org.apache.derby.iapi.services.io.LimitObjectInput in)
          Allocate/deallocate/free this page number.
 void writeExternal(java.io.ObjectOutput out)
          This method is responsible for writing the instance data of an object to the passed in stream.
 
Methods inherited from class org.apache.derby.impl.store.raw.data.PhysicalPageOperation
generateUndo
 
Methods inherited from class org.apache.derby.impl.store.raw.data.PageBasicOperation
findpage, getPage, getPageForLoadTran, getPageId, getPageVersion, getPreparedLog, group, needsRedo, reclaimPrepareLocks, releaseResource, resetPageNumber
 
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, group, needsRedo, releaseResource
 

Field Detail

newPageNumber

protected long newPageNumber

doStatus

protected int doStatus

undoStatus

protected int undoStatus
Constructor Detail

AllocPageOperation

public AllocPageOperation(AllocPage allocPage,
                          long pageNumber,
                          int doStatus,
                          int undoStatus)
                   throws org.apache.derby.iapi.error.StandardException

AllocPageOperation

public AllocPageOperation()
Method Detail

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Description copied from interface: java.io.Externalizable
This method is responsible for writing the instance data of an object to the passed in stream. Note that this stream is not a subclass of OutputStream, but rather is a class that implements the ObjectOutput interface. That interface provides a number of methods for writing Java data values to a stream.

Not that the implementation of this method must be coordinated with the implementation of readExternal.

Specified by:
writeExternal in interface java.io.Externalizable
Overrides:
writeExternal in class PageBasicOperation

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Description copied from interface: java.io.Externalizable
This method restores an object's state by reading in the instance data for the object from the passed in stream. Note that this stream is not a subclass of InputStream, but rather is a class that implements the ObjectInput interface. That interface provides a mechanism for reading in Java data types from a stream.

Note that this method must be compatible with writeExternal. It must read back the exact same types that were written by that method in the exact order they were written.

If this method needs to read back an object instance, then the class for that object must be found and loaded. If that operation fails, then this method throws a ClassNotFoundException

Specified by:
readExternal in interface java.io.Externalizable
Overrides:
readExternal in class PageBasicOperation

getTypeFormatId

public int getTypeFormatId()
Return my format identifier.


doMe

public final void doMe(org.apache.derby.iapi.store.raw.Transaction tran,
                       org.apache.derby.iapi.store.raw.log.LogInstant instant,
                       org.apache.derby.iapi.services.io.LimitObjectInput in)
                throws org.apache.derby.iapi.error.StandardException
Allocate/deallocate/free this page number


undoMe

public void undoMe(org.apache.derby.iapi.store.raw.Transaction xact,
                   BasePage undoPage,
                   org.apache.derby.iapi.store.raw.log.LogInstant CLRInstant,
                   org.apache.derby.iapi.services.io.LimitObjectInput in)
            throws org.apache.derby.iapi.error.StandardException
Allocate/deallocate/free this page number.

Specified by:
undoMe in class PhysicalPageOperation

restoreMe

public void restoreMe(org.apache.derby.iapi.store.raw.Transaction xact,
                      BasePage undoPage,
                      org.apache.derby.iapi.store.raw.log.LogInstant CLRinstant,
                      org.apache.derby.iapi.services.io.LimitObjectInput in)
Description copied from class: PageBasicOperation
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

Specified by:
restoreMe in class PageBasicOperation

toString

public java.lang.String toString()
debug

Overrides:
toString in class PageBasicOperation