public abstract class PageBasicOperation extends java.lang.Object implements Loggable, RePreparable
Loggable,
Serialized Form| Format ID | no format id, an abstract class. |
| Purpose | provide methods for logical undo |
| Upgrade | |
| Disk Layout | pageId(PageKey) the page this operation applies to pageVersion(CompressedLong) the page version this operation applied to OptionalData none |
| Modifier and Type | Field and Description |
|---|---|
protected RawContainerHandle |
containerHdl |
protected boolean |
foundHere |
protected BasePage |
page |
private PageKey |
pageId |
private long |
pageVersion |
ABORT, BI_LOG, CHECKSUM, COMMIT, COMPENSATION, FILE_RESOURCE, FIRST, LAST, PREPARE, RAWSTORE, XA_NEEDLOCK| Modifier | Constructor and Description |
|---|---|
|
PageBasicOperation() |
protected |
PageBasicOperation(BasePage page) |
| Modifier and Type | Method and Description |
|---|---|
BasePage |
findpage(Transaction xact)
Find the page the operation applies to and latch it, this only
uses the segmentId, containerId, and pageId stored in this log
record to find the page.
|
Page |
getPage() |
protected BasePage |
getPageForRedoRecovery(Transaction xact)
Subclass (e.g., init page) that wishes to do something about missing
pages in load tran should override this method to return the page
|
protected PageKey |
getPageId() |
long |
getPageVersion() |
ByteArray |
getPreparedLog()
the default for optional data is set to null.
|
int |
group()
A page operation is a RAWSTORE log record
|
boolean |
needsRedo(Transaction xact)
Returns true if this op should be redone during recovery redo,
if so, get and latched the page.
|
void |
readExternal(java.io.ObjectInput in) |
void |
reclaimPrepareLocks(Transaction t,
LockingPolicy locking_policy)
reclaim locks associated with the changes in this log record.
|
void |
releaseResource(Transaction xact)
Release latched page and any other resources acquired during a previous
findpage, safe to call multiple times.
|
protected void |
resetPageNumber(long pageNumber)
Reset the pageNumber
|
abstract void |
restoreMe(Transaction xact,
BasePage undoPage,
LogInstant CLRinstant,
LimitObjectInput in)
Undo the change indicated by this log operation and optional data.
|
java.lang.String |
toString() |
void |
writeExternal(java.io.ObjectOutput out) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetTypeFormatIdprivate PageKey pageId
private long pageVersion
protected transient BasePage page
protected transient RawContainerHandle containerHdl
protected transient boolean foundHere
protected PageBasicOperation(BasePage page)
public PageBasicOperation()
public java.lang.String toString()
toString in class java.lang.Objectpublic void writeExternal(java.io.ObjectOutput out)
throws java.io.IOException
writeExternal in interface java.io.Externalizablejava.io.IOExceptionpublic void readExternal(java.io.ObjectInput in)
throws java.io.IOException,
java.lang.ClassNotFoundException
readExternal in interface java.io.Externalizablejava.io.IOExceptionjava.lang.ClassNotFoundExceptionpublic final boolean needsRedo(Transaction xact) throws StandardException
needsRedo in interface Loggablexact - The transaction trying to redo this operationStandardException - Standard Derby policy.Loggable.releaseResource(org.apache.derby.iapi.store.raw.Transaction)public void releaseResource(Transaction xact)
releaseResource in interface Loggablepublic int group()
public ByteArray getPreparedLog() throws StandardException
getPreparedLog in interface LoggableStandardException - Standard Derby policy.public void reclaimPrepareLocks(Transaction t, LockingPolicy locking_policy) throws StandardException
reclaimPrepareLocks in interface RePreparableStandardException - Standard exception policy.protected final void resetPageNumber(long pageNumber)
protected final PageKey getPageId()
public final BasePage findpage(Transaction xact) throws StandardException
StandardException - Standard Derby policy.protected BasePage getPageForRedoRecovery(Transaction xact) throws StandardException
StandardException - Derby Standard error policypublic final Page getPage()
public final long getPageVersion()
public abstract void restoreMe(Transaction xact, BasePage undoPage, LogInstant CLRinstant, LimitObjectInput in) throws StandardException, java.io.IOException
xact - the Transaction doing the rollbackundoPage - the page to rollback changes onCLRinstant - the log instant of this (PageUndo) operationin - optional data for the rollback operationjava.io.IOException - Can be thrown by any of the methods of ObjectInput.StandardException - Standard Derby policy.Apache Derby V10.10 Internals - Copyright © 2004,2014 The Apache Software Foundation. All Rights Reserved.