--- /dev/null
+/*\r
+\r
+ Derby - Class org.apache.derby.impl.store.raw.data.DirectAllocActions\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.impl.store.raw.data.AllocationActions;\r
+import org.apache.derby.impl.store.raw.data.BasePage;\r
+\r
+import org.apache.derby.iapi.services.sanity.SanityManager;\r
+import org.apache.derby.iapi.services.io.FormatIdUtil;\r
+\r
+import org.apache.derby.iapi.store.raw.Loggable;\r
+import org.apache.derby.iapi.store.raw.xact.RawTransaction;\r
+import org.apache.derby.iapi.store.raw.log.LogInstant;\r
+\r
+import org.apache.derby.iapi.error.StandardException;\r
+\r
+public class DirectAllocActions implements AllocationActions {\r
+\r
+ public DirectAllocActions() {\r
+ }\r
+\r
+ /**\r
+ Set the allocation status of pageNumber to doStatus. To undo this\r
+ operation, set the allocation status of pageNumber to undoStatus\r
+ \r
+ @param t The transaction\r
+ @param allocPage the allocation page\r
+ @param pageNumber the page to allocation or deallocation\r
+ @param doStatus set the allocation status of the page this value\r
+ @param undoStatus on undo, set the allocation status of the page\r
+ this value \r
+\r
+ @exception StandardException Standard Derby error policy\r
+ */\r
+ public void actionAllocatePage(RawTransaction t, BasePage allocPage, \r
+ long pageNumber, int doStatus, int undoStatus)\r
+ throws StandardException\r
+ {\r
+ ((AllocPage)allocPage).setPageStatus((LogInstant)null, pageNumber, doStatus);\r
+ }\r
+\r
+ /**\r
+ Chain one allocation page to the next.\r
+\r
+ @param t The transaction\r
+ @param allocPage the allocation page whose next page chain needs\r
+ to be changed\r
+ @param pageNumber the next allocation page's number \r
+ @param pageOffset the next allocation page's page offset\r
+\r
+ @exception StandardException Standard Derby error policy\r
+ */\r
+ public void actionChainAllocPage(RawTransaction t, BasePage allocPage, \r
+ long pageNumber, long pageOffset)\r
+ throws StandardException\r
+ {\r
+ ((AllocPage)allocPage).chainNextAllocPage((LogInstant)null, pageNumber,\r
+ pageOffset);\r
+ }\r
+\r
+ /**\r
+ * Compress free pages.\r
+ * <p>\r
+ * Compress the free pages at the end of the range maintained by\r
+ * this allocation page. All pages being compressed should be FREE.\r
+ * Only pages in the last allocation page can be compressed.\r
+ * <p>\r
+ *\r
+ * @param t The transaction\r
+ * @param allocPage the allocation page to do compress on.\r
+ * @param new_highest_page The new highest page on this allocation \r
+ * page. The number is the offset of the page\r
+ * in the array of pages maintained by this \r
+ * allocation page, for instance a value of 0 \r
+ * indicates all page except the first one are\r
+ * to be truncated. If all pages are \r
+ * truncated then the offset is set to -1.\r
+ * @param num_pages_truncated The number of allocated pages in this \r
+ * allocation page prior to the truncate. \r
+ * Note that all pages from NewHighestPage+1 \r
+ * through newHighestPage+num_pages_truncated \r
+ * should be FREE.\r
+ *\r
+ * @exception StandardException Standard exception policy.\r
+ **/\r
+ public void actionCompressSpaceOperation(\r
+ RawTransaction t,\r
+ BasePage allocPage, \r
+ int new_highest_page, \r
+ int num_pages_truncated)\r
+ throws StandardException\r
+ {\r
+ ((AllocPage)allocPage).compressSpace(\r
+ (LogInstant)null, new_highest_page, num_pages_truncated);\r
+ }\r
+}\r