KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2
3    Derby - Class org.apache.derby.impl.store.raw.data.PageActions
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.services.io.FormatableBitSet;
25 import org.apache.derby.iapi.services.io.DynamicByteArrayOutputStream;
26
27 import org.apache.derby.iapi.error.StandardException;
28
29 import org.apache.derby.iapi.store.access.conglomerate.LogicalUndo;
30
31 import org.apache.derby.iapi.store.raw.RecordHandle;
32 import org.apache.derby.iapi.store.raw.xact.RawTransaction;
33
34 import org.apache.derby.iapi.types.DataValueDescriptor;
35
36
37 public interface PageActions
38 {
39
40     /**
41      * Set the Delete status of the record at the given slot.
42      * <p>
43      * Subclass that implements this method has to call
44      * BasePage.setDeleteStatus to update the delete status on the in-memory
45      * slot table.
46      * <p>
47      * <BR> MT - latched, page is latched when this methods is called.
48      * @param t The transaction
49      * @param page the target page
50      * @param slot the slot number of the record
51      * @param recordId the recordID of the record
52      * @param delete set the delete status to this value
53      * @param undo logical undo logic if necessary
54      *
55      * @exception StandardException Standard Cloudscape error policy
56      * @see org.apache.derby.iapi.store.raw.Page#deleteAtSlot
57      **/

58     public void actionDelete(
59     RawTransaction t,
60     BasePage page,
61     int slot,
62     int recordId,
63     boolean delete,
64     LogicalUndo undo)
65         throws StandardException;
66
67
68     /**
69      * Update record at the given slot with this row.
70      * <p>
71      * <BR> MT - latched, page is latched when this methods is called.
72      *
73      * @param t The transaction
74      * @param page the updated page
75      * @param slot the slot number of the record
76      * @param recordId the recordID of the record
77      * @param row The new storable row
78      * @param validColumns the columns that needs to be updated
79      * @param realStartColumn the first column that is updated
80      * @param logBuffer where to prepare the log record
81      * @param realSpaceOnPage ??
82      * @param headRowHandle the record handle of the head row
83      *
84      * @return the next column to update in the row or,
85      * -1 if the update has been completed.
86      *
87      * @exception StandardException Standard Cloudscape error policy
88      *
89      * @see org.apache.derby.iapi.store.raw.Page#updateAtSlot
90      **/

91     public int actionUpdate(
92     RawTransaction t,
93     BasePage page,
94     int slot,
95     int recordId,
96     Object JavaDoc[] row,
97     FormatableBitSet validColumns,
98     int realStartColumn,
99     DynamicByteArrayOutputStream logBuffer,
100     int realSpaceOnPage,
101     RecordHandle headRowHandle)
102         throws StandardException;
103
104     /**
105      * Purge the record at the given slot.
106      * <p>
107      * Subclass that implements this method has to remove the slot from the
108      * base page in-memory slot table (removeAndShiftDown).
109      * <p>
110      * <BR> MT - latched, page is latched when this methods is called.
111      *
112      * @param t The transaction
113      * @param slot the starting slot number of the record
114      * @param num_rows how many rows to purge
115      * @param recordIds the recordIDs of the record (an array of num_rows)
116      *
117      * @exception StandardException Standard Cloudscape error policy
118      *
119      * @see org.apache.derby.iapi.store.raw.Page#purgeAtSlot
120      **/

121     public void actionPurge(
122     RawTransaction t,
123     BasePage page,
124     int slot,
125     int num_rows,
126     int[] recordIds,
127     boolean logData)
128         throws StandardException;
129
130     /**
131      * Update a field of the record at the given slot with this value.
132      * <p>
133      *
134      * <BR> MT - latched, page is latched when this methods is called.
135      *
136      * @param t The transaction
137      * @param slot the slot number of the record
138      * @param recordId the recordID of the record
139      * @param fieldId the fieldId of the value
140      * @param newValue the new value for the field
141      * @param undo if logical undo may be necessary, a function
142      * pointer to the access code where the logical undo
143      * logic resides. Null if logical undo is not
144      * necessary.
145      *
146      * @exception StandardException Standard Cloudscape error policy
147      *
148      * @see org.apache.derby.iapi.store.raw.Page#updateFieldAtSlot
149      *
150      **/

151     public void actionUpdateField(
152     RawTransaction t,
153     BasePage page,
154     int slot,
155     int recordId,
156     int fieldId,
157     Object JavaDoc newValue,
158     LogicalUndo undo)
159         throws StandardException;
160
161     /**
162      * Insert record at the given slot with this recordId.
163      * <p>
164      *
165      * <BR> MT - latched, page is latched when this methods is called.
166      *
167      * @param t The transaction
168      * @param slot the slot number of the record
169      * @param recordId the recordID of the record
170      * @param row The storable row
171      * @param undo if logical undo may be necessary, a function
172      * pointer to the access code where the logical
173      * undo logic resides. Null if logical undo is
174      * not necessary.
175      * @param insertFlag see Page value for insertFlag
176      *
177      * @exception StandardException Standard Cloudscape error policy
178      *
179      * @see org.apache.derby.iapi.store.raw.Page#insertAtSlot
180      **/

181     public int actionInsert(
182     RawTransaction t,
183     BasePage page,
184     int slot,
185     int recordId,
186     Object JavaDoc[] row,
187     FormatableBitSet validColumns,
188     LogicalUndo undo,
189     byte insertFlag,
190     int startColumn,
191     boolean isLongColumn,
192     int realStartColumn,
193     DynamicByteArrayOutputStream logBuffer,
194     int realSpaceOnPage,
195     int overflowThreshold)
196         throws StandardException;
197
198     /**
199      * Copy num_rows from srcPage into deestpage.
200      * <p>
201      * Longer descrption of routine.
202      * <p>
203      * @param t The transaction
204      * @param destPage the destination page
205      * @param srcPage the source page
206      * @param destSlot starting slot # of destination page to copy to
207      * @param numRows the number of rows to be copied
208      * @param srcSlot starting slot number of source page to copy from
209      * @param recordIds an array of record ids to use in the
210      * destination page
211      *
212      * @exception StandardException Standard Cloudscape policy.
213      **/

214     public void actionCopyRows(
215     RawTransaction t,
216     BasePage destPage,
217     BasePage srcPage,
218     int destSlot,
219     int numRows,
220     int srcSlot,
221     int[] recordIds)
222         throws StandardException;
223
224     /**
225      * Invalidate the page due to deallocation.
226      * Short one line description of routine.
227      * <p>
228      * Invalidate the page due to deallocation - this is the action on the page
229      * that is being deallocated as opposed to the action on the allocation
230      * page.
231      * <p>
232      *
233      * @param t The transaction
234      * @param page that page to be invalidated
235      *
236      * @exception StandardException Standard Cloudscape policy.
237      **/

238     public void actionInvalidatePage(
239     RawTransaction t,
240     BasePage page)
241          throws StandardException;
242
243     /**
244      * Initialize the page due to allocation.
245      * <p>
246      * Initialize the page due to allocation - this page could be brand new or
247      * it could be being re-allocated.
248      * <p>
249      *
250      * @param t The transaction
251      * @param page that page to be initialized
252      * @param initFlag flags set to values in BasePage.INIT_PAGE_*
253      * which indicates how the new page is to be
254      * initialized.
255      * @param pageFormatId The format Id of the page being initialized.
256      *
257      * @exception StandardException Standard Cloudscape policy.
258      **/

259     public void actionInitPage(
260     RawTransaction t,
261     BasePage page,
262     int initFlag,
263     int pageFormatId,
264     long pageOffset)
265          throws StandardException;
266
267     /**
268      * Shrink the reserved space to the new value.
269      * <p>
270      * Shrink the reserved space to the new value. This action is not undoable.
271      * <p>
272      * @param t The transaction
273      * @param page that page to be initialized
274      * @param slot the slot number of the record
275      * @param recordId the recordID of the record
276      * @param newValue the new reserved space value
277      *
278      * @exception StandardException Unexpected exception from the implementation
279      *
280      **/

281      public void actionShrinkReservedSpace(
282      RawTransaction t,
283      BasePage page,
284      int slot,
285      int recordId,
286      int newValue,
287      int oldValue)
288          throws StandardException;
289 }
290
Popular Tags