Class CompressSpacePageOperation

    • Field Detail

      • newHighestPage

        protected int newHighestPage
        The 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_truncated
        The 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 Detail

      • CompressSpacePageOperation

        public CompressSpacePageOperation()
        Public Methods of Formatable interface.
    • Method Detail

      • writeExternal

        public void writeExternal​(java.io.ObjectOutput out)
                           throws java.io.IOException
        Specified by:
        writeExternal in interface java.io.Externalizable
        Overrides:
        writeExternal in class PageBasicOperation
        Throws:
        java.io.IOException
      • readExternal

        public void readExternal​(java.io.ObjectInput in)
                          throws java.io.IOException,
                                 java.lang.ClassNotFoundException
        Specified by:
        readExternal in interface java.io.Externalizable
        Overrides:
        readExternal in class PageBasicOperation
        Throws:
        java.io.IOException - error reading from log stream
        java.lang.ClassNotFoundException - 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.
      • restoreMe

        public void restoreMe​(Transaction xact,
                              BasePage undoPage,
                              LogInstant CLRinstant,
                              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
        Parameters:
        xact - the Transaction doing the rollback
        undoPage - the page to rollback changes on
        CLRinstant - the log instant of this (PageUndo) operation
        in - optional data for the rollback operation