--- /dev/null
+/*\r
+\r
+ Derby - Class org.apache.derby.impl.store.raw.data.PageActions\r
+\r
+ Licensed to the Apache Software Foundation (ASF) under one or more\r
+ contributor license agreements. See the NOTICE file distributed with\r
+ this work for additional information regarding copyright ownership.\r
+ The ASF licenses this file to you under the Apache License, Version 2.0\r
+ (the "License"); you may not use this file except in compliance with\r
+ the License. You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+\r
+ */\r
+\r
+package org.apache.derby.impl.store.raw.data;\r
+\r
+import org.apache.derby.iapi.services.io.FormatableBitSet;\r
+import org.apache.derby.iapi.services.io.DynamicByteArrayOutputStream;\r
+\r
+import org.apache.derby.iapi.error.StandardException;\r
+\r
+import org.apache.derby.iapi.store.access.conglomerate.LogicalUndo;\r
+\r
+import org.apache.derby.iapi.store.raw.RecordHandle;\r
+import org.apache.derby.iapi.store.raw.xact.RawTransaction;\r
+\r
+import org.apache.derby.iapi.types.DataValueDescriptor;\r
+\r
+\r
+public interface PageActions \r
+{\r
+\r
+ /**\r
+ * Set the Delete status of the record at the given slot.\r
+ * <p>\r
+ * Subclass that implements this method has to call \r
+ * BasePage.setDeleteStatus to update the delete status on the in-memory \r
+ * slot table.\r
+ * <p>\r
+ * <BR> MT - latched, page is latched when this methods is called.\r
+ * @param t The transaction\r
+ * @param page the target page\r
+ * @param slot the slot number of the record \r
+ * @param recordId the recordID of the record \r
+ * @param delete set the delete status to this value\r
+ * @param undo logical undo logic if necessary\r
+ *\r
+ * @exception StandardException Standard Derby error policy\r
+ * @see org.apache.derby.iapi.store.raw.Page#deleteAtSlot\r
+ **/\r
+ public void actionDelete(\r
+ RawTransaction t, \r
+ BasePage page, \r
+ int slot, \r
+ int recordId, \r
+ boolean delete, \r
+ LogicalUndo undo)\r
+ throws StandardException;\r
+\r
+\r
+ /**\r
+ * Update record at the given slot with this row.\r
+ * <p>\r
+ * <BR> MT - latched, page is latched when this methods is called.\r
+ *\r
+ * @param t The transaction\r
+ * @param page the updated page\r
+ * @param slot the slot number of the record \r
+ * @param recordId the recordID of the record \r
+ * @param row The new storable row\r
+ * @param validColumns the columns that needs to be updated\r
+ * @param realStartColumn the first column that is updated\r
+ * @param logBuffer where to prepare the log record\r
+ * @param realSpaceOnPage ??\r
+ * @param headRowHandle the record handle of the head row\r
+ *\r
+ * @return the next column to update in the row or,\r
+ * -1 if the update has been completed.\r
+ *\r
+ * @exception StandardException Standard Derby error policy\r
+ *\r
+ * @see org.apache.derby.iapi.store.raw.Page#updateAtSlot\r
+ **/\r
+ public int actionUpdate(\r
+ RawTransaction t, \r
+ BasePage page, \r
+ int slot, \r
+ int recordId,\r
+ Object[] row, \r
+ FormatableBitSet validColumns,\r
+ int realStartColumn, \r
+ DynamicByteArrayOutputStream logBuffer, \r
+ int realSpaceOnPage, \r
+ RecordHandle headRowHandle)\r
+ throws StandardException;\r
+\r
+ /**\r
+ * Purge the record at the given slot.\r
+ * <p>\r
+ * Subclass that implements this method has to remove the slot from the \r
+ * base page in-memory slot table (removeAndShiftDown).\r
+ * <p>\r
+ * <BR> MT - latched, page is latched when this methods is called.\r
+ *\r
+ * @param t The transaction\r
+ * @param slot the starting slot number of the record \r
+ * @param num_rows how many rows to purge\r
+ * @param recordIds the recordIDs of the record (an array of num_rows)\r
+ *\r
+ * @exception StandardException Standard Derby error policy\r
+ *\r
+ * @see org.apache.derby.iapi.store.raw.Page#purgeAtSlot\r
+ **/\r
+ public void actionPurge(\r
+ RawTransaction t, \r
+ BasePage page, \r
+ int slot, \r
+ int num_rows, \r
+ int[] recordIds,\r
+ boolean logData)\r
+ throws StandardException;\r
+\r
+ /**\r
+ * Update a field of the record at the given slot with this value.\r
+ * <p>\r
+ *\r
+ * <BR> MT - latched, page is latched when this methods is called.\r
+ *\r
+ * @param t The transaction\r
+ * @param slot the slot number of the record \r
+ * @param recordId the recordID of the record \r
+ * @param fieldId the fieldId of the value\r
+ * @param newValue the new value for the field\r
+ * @param undo if logical undo may be necessary, a function \r
+ * pointer to the access code where the logical undo \r
+ * logic resides. Null if logical undo is not \r
+ * necessary.\r
+ *\r
+ * @exception StandardException Standard Derby error policy\r
+ *\r
+ * @see org.apache.derby.iapi.store.raw.Page#updateFieldAtSlot\r
+ *\r
+ **/\r
+ public void actionUpdateField(\r
+ RawTransaction t, \r
+ BasePage page, \r
+ int slot, \r
+ int recordId, \r
+ int fieldId, \r
+ Object newValue, \r
+ LogicalUndo undo)\r
+ throws StandardException;\r
+\r
+ /**\r
+ * Insert record at the given slot with this recordId. \r
+ * <p>\r
+ *\r
+ * <BR> MT - latched, page is latched when this methods is called.\r
+ *\r
+ * @param t The transaction\r
+ * @param slot the slot number of the record \r
+ * @param recordId the recordID of the record \r
+ * @param row The storable row\r
+ * @param undo if logical undo may be necessary, a function \r
+ * pointer to the access code where the logical \r
+ * undo logic resides. Null if logical undo is \r
+ * not necessary.\r
+ * @param insertFlag see Page value for insertFlag\r
+ *\r
+ * @exception StandardException Standard Derby error policy\r
+ *\r
+ * @see org.apache.derby.iapi.store.raw.Page#insertAtSlot\r
+ **/\r
+ public int actionInsert(\r
+ RawTransaction t, \r
+ BasePage page, \r
+ int slot, \r
+ int recordId,\r
+ Object[] row, \r
+ FormatableBitSet validColumns,\r
+ LogicalUndo undo, \r
+ byte insertFlag, \r
+ int startColumn, \r
+ boolean isLongColumn,\r
+ int realStartColumn, \r
+ DynamicByteArrayOutputStream logBuffer, \r
+ int realSpaceOnPage, \r
+ int overflowThreshold)\r
+ throws StandardException;\r
+\r
+ /**\r
+ * Copy num_rows from srcPage into deestpage.\r
+ * <p>\r
+ * Longer descrption of routine.\r
+ * <p>\r
+ * @param t The transaction\r
+ * @param destPage the destination page\r
+ * @param srcPage the source page\r
+ * @param destSlot starting slot # of destination page to copy to\r
+ * @param numRows the number of rows to be copied\r
+ * @param srcSlot starting slot number of source page to copy from\r
+ * @param recordIds an array of record ids to use in the \r
+ * destination page\r
+ *\r
+ * @exception StandardException Standard Derby policy.\r
+ **/\r
+ public void actionCopyRows(\r
+ RawTransaction t, \r
+ BasePage destPage, \r
+ BasePage srcPage, \r
+ int destSlot, \r
+ int numRows, \r
+ int srcSlot, \r
+ int[] recordIds)\r
+ throws StandardException;\r
+\r
+ /**\r
+ * Invalidate the page due to deallocation.\r
+ * Short one line description of routine.\r
+ * <p>\r
+ * Invalidate the page due to deallocation - this is the action on the page\r
+ * that is being deallocated as opposed to the action on the allocation \r
+ * page.\r
+ * <p>\r
+ *\r
+ * @param t The transaction\r
+ * @param page that page to be invalidated\r
+ *\r
+ * @exception StandardException Standard Derby policy. \r
+ **/\r
+ public void actionInvalidatePage(\r
+ RawTransaction t, \r
+ BasePage page)\r
+ throws StandardException;\r
+\r
+ /**\r
+ * Initialize the page due to allocation.\r
+ * <p>\r
+ * Initialize the page due to allocation - this page could be brand new or \r
+ * it could be being re-allocated.\r
+ * <p>\r
+ *\r
+ * @param t The transaction\r
+ * @param page that page to be initialized\r
+ * @param initFlag flags set to values in BasePage.INIT_PAGE_* \r
+ * which indicates how the new page is to be\r
+ * initialized.\r
+ * @param pageFormatId The format Id of the page being initialized.\r
+ *\r
+ * @exception StandardException Standard Derby policy.\r
+ **/\r
+ public void actionInitPage(\r
+ RawTransaction t, \r
+ BasePage page, \r
+ int initFlag, \r
+ int pageFormatId, \r
+ long pageOffset)\r
+ throws StandardException;\r
+\r
+ /**\r
+ * Shrink the reserved space to the new value. \r
+ * <p>\r
+ * Shrink the reserved space to the new value. This action is not undoable.\r
+ * <p>\r
+ * @param t The transaction\r
+ * @param page that page to be initialized\r
+ * @param slot the slot number of the record \r
+ * @param recordId the recordID of the record \r
+ * @param newValue the new reserved space value\r
+ *\r
+ * @exception StandardException Unexpected exception from the implementation\r
+ *\r
+ **/\r
+ public void actionShrinkReservedSpace(\r
+ RawTransaction t, \r
+ BasePage page,\r
+ int slot, \r
+ int recordId, \r
+ int newValue, \r
+ int oldValue)\r
+ throws StandardException;\r
+}\r