java.lang.Object
org.apache.derby.impl.store.raw.data.PageBasicOperation
org.apache.derby.impl.store.raw.data.PhysicalPageOperation
org.apache.derby.impl.store.raw.data.UpdateOperation
- 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 UpdateOperation
- extends PhysicalPageOperation
Represents the update of a particular row on a 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 |
|
Method Summary |
void |
doMe(org.apache.derby.iapi.store.raw.Transaction xact,
org.apache.derby.iapi.store.raw.log.LogInstant instant,
org.apache.derby.iapi.services.io.LimitObjectInput in)
Store the new record directly over the old record, the implementation
of storeRecord is responsible for removing any old data. |
int |
getNextStartColumn()
Return the last column of the row this operation logged |
org.apache.derby.iapi.util.ByteArray |
getPreparedLog()
The log operations are responsible to create the ByteArray, and the log
operations should write out any optional data for the change to the
ByteArray. |
int |
getTypeFormatId()
Return my format identifier. |
void |
readExternal(java.io.ObjectInput in)
Read this in |
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)
restore the before image of the page |
java.lang.String |
toString()
Convert this Object to a human-readable String. |
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)
Store the old record directly over the new record, the implementation
of storeRecord is responsible for removing any new data. |
void |
writeExternal(java.io.ObjectOutput out)
This method is responsible for writing the instance data of an object
to the passed in stream. |
private void |
writeOptionalDataToBuffer(org.apache.derby.iapi.store.raw.xact.RawTransaction t,
org.apache.derby.iapi.services.io.DynamicByteArrayOutputStream logBuffer,
java.lang.Object[] row,
org.apache.derby.iapi.services.io.FormatableBitSet validColumns,
int realStartColumn,
int realSpaceOnPage,
org.apache.derby.iapi.store.raw.RecordHandle headRowHandle)
Write out the changed colums of new record (from the row) followed by
changed columns of the old record (from the page). |
doMeSlot
protected int doMeSlot
recordId
protected int recordId
nextColumn
protected transient int nextColumn
preparedLog
protected transient org.apache.derby.iapi.util.ByteArray preparedLog
UpdateOperation
public UpdateOperation(org.apache.derby.iapi.store.raw.xact.RawTransaction t,
BasePage page,
int slot,
int recordId,
java.lang.Object[] row,
org.apache.derby.iapi.services.io.FormatableBitSet validColumns,
int realStartColumn,
org.apache.derby.iapi.services.io.DynamicByteArrayOutputStream logBuffer,
int realSpaceOnPage,
org.apache.derby.iapi.store.raw.RecordHandle headRowHandle)
throws org.apache.derby.iapi.error.StandardException
UpdateOperation
public UpdateOperation()
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
- Read this in
- Specified by:
readExternal in interface java.io.Externalizable- Overrides:
readExternal in class PageBasicOperation
getTypeFormatId
public int getTypeFormatId()
- Return my format identifier.
getNextStartColumn
public int getNextStartColumn()
- Return the last column of the row this operation logged
doMe
public void doMe(org.apache.derby.iapi.store.raw.Transaction xact,
org.apache.derby.iapi.store.raw.log.LogInstant instant,
org.apache.derby.iapi.services.io.LimitObjectInput in)
throws org.apache.derby.iapi.error.StandardException,
java.io.IOException
- Store the new record directly over the old record, the implementation
of storeRecord is responsible for removing any old data.
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,
java.io.IOException
- Store the old record directly over the new record, the implementation
of storeRecord is responsible for removing any new data.
- Specified by:
undoMe in class PhysicalPageOperation
getPreparedLog
public org.apache.derby.iapi.util.ByteArray getPreparedLog()
- Description copied from interface:
org.apache.derby.iapi.store.raw.Loggable
- The log operations are responsible to create the ByteArray, and the log
operations should write out any optional data for the change to the
ByteArray.
The ByteArray can be prepared when the log operation is constructed,
or it can be prepared when getPreparedLog() is called.
Called by the log manager to allow the log operation to pass the buffer
which contains optional data that will be available in to doMe()
methods.
- Specified by:
getPreparedLog in interface org.apache.derby.iapi.store.raw.Loggable- Overrides:
getPreparedLog in class PageBasicOperation
writeOptionalDataToBuffer
private void writeOptionalDataToBuffer(org.apache.derby.iapi.store.raw.xact.RawTransaction t,
org.apache.derby.iapi.services.io.DynamicByteArrayOutputStream logBuffer,
java.lang.Object[] row,
org.apache.derby.iapi.services.io.FormatableBitSet validColumns,
int realStartColumn,
int realSpaceOnPage,
org.apache.derby.iapi.store.raw.RecordHandle headRowHandle)
throws org.apache.derby.iapi.error.StandardException,
java.io.IOException
- Write out the changed colums of new record (from the row) followed by
changed columns of the old record (from the page).
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)
throws org.apache.derby.iapi.error.StandardException,
java.io.IOException
- restore the before image of the page
- Specified by:
restoreMe in class PageBasicOperation
toString
public java.lang.String toString()
- Description copied from class:
java.lang.Object
- Convert this Object to a human-readable String.
There are no limits placed on how long this String
should be or what it should contain. We suggest you
make it as intuitive as possible to be able to place
it into System.out.println() 55
and such.
It is typical, but not required, to ensure that this method
never completes abruptly with a java.lang.RuntimeException.
This method will be called when performing string
concatenation with this object. If the result is
null, string concatenation will instead
use "null".
The default implementation returns
getClass().getName() + "@" +
Integer.toHexString(hashCode()).
- Overrides:
toString in class PageBasicOperation