KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > mdr > persistence > btreeimpl > btreeindex > BtreePageSource


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19 package org.netbeans.mdr.persistence.btreeimpl.btreeindex;
20
21 import org.netbeans.mdr.persistence.*;
22 import org.netbeans.mdr.persistence.btreeimpl.btreestorage.BtreeStorage;
23 /**
24  * Source of pages for a Btree.
25  *
26  * @author Dana Bergen
27  * @version 1.0
28  */

29 public interface BtreePageSource extends MofidGenerator {
30
31     /**
32      * Get an EntryTypeInfo for the datatype of this BtreePageSource's page IDs.
33      */

34     public EntryTypeInfo getPageIdInfo();
35
36     /**
37      * Retrieve a page.
38      *
39      * @param pageId byte array buffer containing pageId
40      * @param btree btree to which the page belongs
41      *
42      * @return the BtreePage
43      * @exception StorageException
44      */

45     public BtreePage getPage(byte[] pageId, Btree btree)
46                         throws StorageException;
47     /**
48      * Creates a new page and returns it.
49      *
50      * @param btree btree to which the page belongs
51      *
52      * @return the BtreePage
53      * @exception StorageException
54      */

55     public BtreePage newPage(Btree btree) throws StorageException;
56     /**
57      * Creates a new oversize-key page and returns it.
58      *
59      * @param btree btree to which the page belongs
60      *
61      * @return the BigKeyPage
62      * @exception StorageException
63      */

64     public BigKeyPage newBigKeyPage(Btree btree) throws StorageException;
65     /**
66      * Retrieve the root page for this btree.
67      *
68      * @param btree Btree
69      * @return the root BtreePage
70      * @exception StorageException
71      */

72     public BtreePage getRootPage(Btree btree) throws StorageException;
73     /**
74      * Notify the BtreePageSource that the caller is done using this page.
75      *
76      * @param page BtreePage
77      */

78     public void unpinPage(BtreePage page);
79     /**
80      * Notify the BtreePageSource that the caller is done using this page.
81      *
82      * @param page BigKeyPage
83      * @exception StorageException
84      */

85     public void unpinPage(BigKeyPage page) throws StorageException;
86     /**
87      * Notify the BtreePageSource that the caller is going to modify this page.
88      *
89      * @param page BtreePage
90      * @exception StorageException
91      */

92     public void dirtyPage(BtreePage page) throws StorageException;
93     /**
94      * Fills in the provided buffer with a value that represents a null page ID.
95      *
96      * @param pageId byte array to be filled in
97      */

98     public void setNoPage(byte[] pageId);
99     /**
100      * Test whether the passed-in pageId is equal to the null page ID.
101      *
102      * @return true if the pageId is the null page ID, otherwise false
103      */

104     public boolean isNoPage(byte[] pageId);
105     /**
106      * Returns the length of a page ID.
107      *
108      * @return length of a page ID from this BtreePageSource
109      */

110     public int getPageIdLength();
111     /**
112      * Returns the size of a page.
113      *
114      * @return size of a page from this BtreePageSource
115      */

116     public int getPageSize();
117     
118     public BtreeStorage getStorage ();
119     
120 }
121
Popular Tags