KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > derby > impl > store > raw > data > AllocationActions


1 /*
2
3    Derby - Class org.apache.derby.impl.store.raw.data.AllocationActions
4
5    Licensed to the Apache Software Foundation (ASF) under one or more
6    contributor license agreements. See the NOTICE file distributed with
7    this work for additional information regarding copyright ownership.
8    The ASF licenses this file to you under the Apache License, Version 2.0
9    (the "License"); you may not use this file except in compliance with
10    the License. You may obtain a copy of the License at
11
12       http://www.apache.org/licenses/LICENSE-2.0
13
14    Unless required by applicable law or agreed to in writing, software
15    distributed under the License is distributed on an "AS IS" BASIS,
16    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17    See the License for the specific language governing permissions and
18    limitations under the License.
19
20  */

21
22 package org.apache.derby.impl.store.raw.data;
23
24 import org.apache.derby.iapi.store.raw.xact.RawTransaction;
25 import org.apache.derby.iapi.error.StandardException;
26
27
28 /**
29     This interface describe the operations that has to do with page
30     allocation/deallocation. This interface is used for a special
31     allocation page that records the allocation information and dispense the
32     allocation policy.
33 */

34
35 public interface AllocationActions {
36
37     /**
38         Set the allocation status of pageNumber to doStatus. To undo this
39         operation, set the allocation status of pageNumber to undoStatus
40         
41         @param t The transaction
42         @param allocPage the allocation page
43         @param pageNumber the page to allocation or deallocation
44         @param doStatus set the allocation status of the page this value
45         @param undoStatus on undo, set the allocation status of the page
46                                 this value
47
48         @exception StandardException Standard Cloudscape error policy
49     */

50     public void actionAllocatePage(RawTransaction t, BasePage allocPage,
51                                    long pageNumber, int doStatus, int undoStatus)
52          throws StandardException;
53
54     /**
55         Chain one allocation page to the next.
56
57         @param t The transaction
58         @param allocPage the allocation page whose next page chain needs
59                                 to be changed
60         @param pageNumber the next allocation page's number
61         @param pageOffset the next allocation page's page offset
62
63         @exception StandardException Standard Cloudscape error policy
64     */

65     public void actionChainAllocPage(RawTransaction t, BasePage allocPage,
66                                 long pageNumber, long pageOffset)
67          throws StandardException;
68
69     /**
70      * Compress free pages.
71      * <p>
72      * Compress the free pages at the end of the range maintained by
73      * this allocation page. All pages being compressed should be FREE.
74      * Only pages in the last allocation page can be compressed.
75      * <p>
76      *
77      * @param t The transaction
78      * @param allocPage the allocation page to do compress on.
79      * @param new_highest_page The new highest page on this allocation
80      * page. The number is the offset of the page
81      * in the array of pages maintained by this
82      * allocation page, for instance a value of 0
83      * indicates all page except the first one are
84      * to be truncated. If all pages are
85      * truncated then the offset is set to -1.
86      * @param num_pages_truncated The number of allocated pages in this
87      * allocation page prior to the truncate.
88      * Note that all pages from NewHighestPage+1
89      * through newHighestPage+num_pages_truncated
90      * should be FREE.
91      *
92      * @exception StandardException Standard exception policy.
93      **/

94     public void actionCompressSpaceOperation(
95     RawTransaction t,
96     BasePage allocPage,
97     int new_highest_page,
98     int num_pages_truncated)
99         throws StandardException;
100
101 }
102
Popular Tags