Class CompressSpacePageOperation
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.CompressSpacePageOperation
- All Implemented Interfaces:
Externalizable, Serializable, Formatable, TypedFormat, Loggable, RePreparable, Undoable
- Direct Known Subclasses:
CompressSpacePageOperation10_2
Log operation to implement compressing space from a container and returning
it to the operating system.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intThe new highest page on this allocation page.protected intThe number of allocated pages in this allocation page prior to the truncate.Fields inherited from class PageBasicOperation
containerHdl, foundHere, pageFields inherited from interface Loggable
ABORT, BI_LOG, CHECKSUM, COMMIT, COMPENSATION, FILE_RESOURCE, FIRST, LAST, PREPARE, RAWSTORE, XA_NEEDLOCK -
Constructor Summary
ConstructorsConstructorDescriptionPublic Methods of Formatable interface.CompressSpacePageOperation(AllocPage allocPage, int highest_page, int num_truncated) Constructors for This class: -
Method Summary
Modifier and TypeMethodDescriptionfinal voiddoMe(Transaction tran, LogInstant instant, LimitObjectInput in) Compress space from container.intReturn my format identifier.voidvoidrestoreMe(Transaction xact, BasePage undoPage, LogInstant CLRinstant, LimitObjectInput in) Undo the change indicated by this log operation and optional data.toString()debugvoidundoMe(Transaction xact, BasePage undoPage, LogInstant CLRInstant, LimitObjectInput in) Compress space undo.voidMethods inherited from class PhysicalPageOperation
generateUndoMethods inherited from class PageBasicOperation
findpage, getPage, getPageForRedoRecovery, getPageId, getPageVersion, getPreparedLog, group, needsRedo, reclaimPrepareLocks, releaseResource, resetPageNumberMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Loggable
getPreparedLog, group, needsRedo, releaseResource
-
Field Details
-
newHighestPage
protected int newHighestPageThe new highest page on this allocation page. The number is the offset of the page in the array of pages maintained by this allocation page, for instance a value of 0 indicates all page except the first one are to be truncated. If all pages are truncated then the offset is set to -1. -
num_pages_truncated
protected int num_pages_truncatedThe number of allocated pages in this allocation page prior to the truncate. Note that all pages from NewHighestPage+1 through newHighestPage+num_pages_truncated should be FREE.
-
-
Constructor Details
-
CompressSpacePageOperation
CompressSpacePageOperation(AllocPage allocPage, int highest_page, int num_truncated) throws StandardException Constructors for This class:- Throws:
StandardException
-
CompressSpacePageOperation
public CompressSpacePageOperation()Public Methods of Formatable interface.
-
-
Method Details
-
writeExternal
- Specified by:
writeExternalin interfaceExternalizable- Overrides:
writeExternalin classPageBasicOperation- Throws:
IOException
-
readExternal
- Specified by:
readExternalin interfaceExternalizable- Overrides:
readExternalin classPageBasicOperation- Throws:
IOException- error reading from log streamClassNotFoundException- cannot read object from input
-
getTypeFormatId
public int getTypeFormatId()Return my format identifier.- Returns:
- The identifier. (A UUID stuffed in an array of 16 bytes).
-
doMe
public final void doMe(Transaction tran, LogInstant instant, LimitObjectInput in) throws StandardException Compress space from container.Compress the indicate space from the container, returning the free pages to the OS. Update the allocation page to reflect the file change.
- Parameters:
tran- transaction doing the operation.instant- log instant for this operation.in- unused by this log operation.- Throws:
StandardException- Standard exception policy.
-
undoMe
public void undoMe(Transaction xact, BasePage undoPage, LogInstant CLRInstant, LimitObjectInput in) throws StandardException Compress space undo.- Specified by:
undoMein classPhysicalPageOperation- Parameters:
xact- the Transaction doing the rollbackundoPage- the page to rollback changes onCLRInstant- the log instant of this (PageUndo) operationin- optional data for the rollback operation- Throws:
StandardException- Thrown by methods I call- See Also:
-
restoreMe
public void restoreMe(Transaction xact, BasePage undoPage, LogInstant CLRinstant, LimitObjectInput in) Description copied from class:PageBasicOperationUndo 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:
restoreMein classPageBasicOperation- Parameters:
xact- the Transaction doing the rollbackundoPage- the page to rollback changes onCLRinstant- the log instant of this (PageUndo) operationin- optional data for the rollback operation
-
toString
-