java.io.Externalizable
, java.io.Serializable
, Formatable
, TypedFormat
, Loggable
, RePreparable
, Undoable
public final class UpdateOperation extends PhysicalPageOperation
Format ID | LOGOP_UPDATE the formatId is written by FormatIdOutputStream when this object is written out by writeObject |
Purpose | |
update a record on the page | |
Upgrade | |
Disk Layout | PhysicalPageOperation the super class doMeSlot(CompressedInt) the slot the updated record is in recordId(CompressedInt) the recordId of the updated record OptionalData The new image of the record (length included), follow by the old image of the record (length included) |
Modifier and Type | Field | Description |
---|---|---|
protected int |
doMeSlot |
|
protected int |
nextColumn |
|
protected ByteArray |
preparedLog |
|
protected int |
recordId |
ABORT, BI_LOG, CHECKSUM, COMMIT, COMPENSATION, FILE_RESOURCE, FIRST, LAST, PREPARE, RAWSTORE, XA_NEEDLOCK
containerHdl, foundHere, page
Constructor | Description |
---|---|
UpdateOperation() |
|
UpdateOperation(RawTransaction t,
BasePage page,
int slot,
int recordId,
java.lang.Object[] row,
FormatableBitSet validColumns,
int realStartColumn,
DynamicByteArrayOutputStream logBuffer,
int realSpaceOnPage,
RecordHandle headRowHandle) |
Modifier and Type | Method | Description |
---|---|---|
void |
doMe(Transaction xact,
LogInstant instant,
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
|
ByteArray |
getPreparedLog() |
the default for optional data is set to null.
|
private RecordHandle |
getRecordHandle() |
return RecordHandle of the update row.
|
int |
getTypeFormatId() |
Return my format identifier.
|
void |
readExternal(java.io.ObjectInput in) |
Read this in
|
void |
reclaimPrepareLocks(Transaction t,
LockingPolicy locking_policy) |
reclaim locks associated with the changes in this log record.
|
void |
restoreMe(Transaction xact,
BasePage undoPage,
LogInstant CLRInstant,
LimitObjectInput in) |
restore the before image of the page
|
java.lang.String |
toString() |
|
void |
undoMe(Transaction xact,
BasePage undoPage,
LogInstant CLRInstant,
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) |
|
private void |
writeOptionalDataToBuffer(RawTransaction t,
DynamicByteArrayOutputStream logBuffer,
java.lang.Object[] row,
FormatableBitSet validColumns,
int realStartColumn,
int realSpaceOnPage,
RecordHandle headRowHandle) |
Write out the changed colums of new record (from the row) followed by
changed columns of the old record (from the page).
|
group, needsRedo, releaseResource
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
findpage, getPage, getPageForRedoRecovery, getPageId, getPageVersion, group, needsRedo, releaseResource, resetPageNumber
generateUndo
protected int doMeSlot
protected int recordId
protected transient int nextColumn
protected transient ByteArray preparedLog
UpdateOperation(RawTransaction t, BasePage page, int slot, int recordId, java.lang.Object[] row, FormatableBitSet validColumns, int realStartColumn, DynamicByteArrayOutputStream logBuffer, int realSpaceOnPage, RecordHandle headRowHandle) throws StandardException
StandardException
public UpdateOperation()
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
writeExternal
in class PageBasicOperation
java.io.IOException
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
readExternal
in class PageBasicOperation
java.io.IOException
- error reading from log streamjava.lang.ClassNotFoundException
- log stream corruptedpublic int getTypeFormatId()
public int getNextStartColumn()
public void doMe(Transaction xact, LogInstant instant, LimitObjectInput in) throws StandardException, java.io.IOException
xact
- the Transactioninstant
- the log instant of this operationin
- optional dataStandardException
- Thrown by methods I calljava.io.IOException
- Thrown by methods I callBasePage.storeRecord(org.apache.derby.iapi.store.raw.log.LogInstant, int, boolean, java.io.ObjectInput)
,
Loggable.doMe(org.apache.derby.iapi.store.raw.Transaction, org.apache.derby.iapi.store.raw.log.LogInstant, org.apache.derby.iapi.services.io.LimitObjectInput)
public void undoMe(Transaction xact, BasePage undoPage, LogInstant CLRInstant, LimitObjectInput in) throws StandardException, java.io.IOException
undoMe
in class PhysicalPageOperation
xact
- the Transaction doing the rollbackundoPage
- the page to rollback changes onCLRInstant
- the log instant of this (PageUndo) operationin
- optional data for the rollback operationStandardException
- Thrown by methods I calljava.io.IOException
- Thrown by methods I callBasePage.storeRecord(org.apache.derby.iapi.store.raw.log.LogInstant, int, boolean, java.io.ObjectInput)
,
PhysicalPageOperation.undoMe(org.apache.derby.iapi.store.raw.Transaction, org.apache.derby.impl.store.raw.data.BasePage, org.apache.derby.iapi.store.raw.log.LogInstant, org.apache.derby.iapi.services.io.LimitObjectInput)
public ByteArray getPreparedLog()
PageBasicOperation
getPreparedLog
in interface Loggable
getPreparedLog
in class PageBasicOperation
private void writeOptionalDataToBuffer(RawTransaction t, DynamicByteArrayOutputStream logBuffer, java.lang.Object[] row, FormatableBitSet validColumns, int realStartColumn, int realSpaceOnPage, RecordHandle headRowHandle) throws StandardException, java.io.IOException
StandardException
- Thrown by methods I calljava.io.IOException
- Thrown by methods I callpublic void restoreMe(Transaction xact, BasePage undoPage, LogInstant CLRInstant, LimitObjectInput in) throws StandardException, java.io.IOException
restoreMe
in class PageBasicOperation
xact
- the Transaction doing the rollbackundoPage
- the page to rollback changes onCLRInstant
- the log instant of this (PageUndo) operationin
- optional data for the rollback operationStandardException
- Standard Derby Error Policyjava.io.IOException
- problem reading the complete log record from the
input streamprivate RecordHandle getRecordHandle()
Return the RecordHandle that should be locked when updating the row in this UpdateOperation.
public void reclaimPrepareLocks(Transaction t, LockingPolicy locking_policy) throws StandardException
reclaimPrepareLocks
in interface RePreparable
reclaimPrepareLocks
in class PageBasicOperation
locking_policy
- The locking policy to use to claim the locks.StandardException
- Standard exception policy.public java.lang.String toString()
toString
in class PageBasicOperation
Apache Derby V10.14 Internals - Copyright © 2004,2018 The Apache Software Foundation. All Rights Reserved.