org.netbeans.mdr.persistence.btreeimpl.btreeindex
Interface BtreePageSource

All Superinterfaces:
MofidGenerator
All Known Implementing Classes:
BtreeCacheSource, BtreeFileSource, BtreeMDRSource

public interface BtreePageSource
extends MofidGenerator

Source of pages for a Btree.

Version:
1.0
Author:
Dana Bergen

Method Summary
 void dirtyPage(BtreePage page)
          Notify the BtreePageSource that the caller is going to modify this page.
 BtreePage getPage(byte[] pageId, Btree btree)
          Retrieve a page.
 EntryTypeInfo getPageIdInfo()
          Get an EntryTypeInfo for the datatype of this BtreePageSource's page IDs.
 int getPageIdLength()
          Returns the length of a page ID.
 int getPageSize()
          Returns the size of a page.
 BtreePage getRootPage(Btree btree)
          Retrieve the root page for this btree.
 BtreeStorage getStorage()
           
 boolean isNoPage(byte[] pageId)
          Test whether the passed-in pageId is equal to the null page ID.
 BigKeyPage newBigKeyPage(Btree btree)
          Creates a new oversize-key page and returns it.
 BtreePage newPage(Btree btree)
          Creates a new page and returns it.
 void setNoPage(byte[] pageId)
          Fills in the provided buffer with a value that represents a null page ID.
 void unpinPage(BigKeyPage page)
          Notify the BtreePageSource that the caller is done using this page.
 void unpinPage(BtreePage page)
          Notify the BtreePageSource that the caller is done using this page.
 
Methods inherited from interface org.netbeans.mdr.persistence.btreeimpl.btreeindex.MofidGenerator
getMofidPrefix, getNextMofid
 

Method Detail

getPageIdInfo

public EntryTypeInfo getPageIdInfo()
Get an EntryTypeInfo for the datatype of this BtreePageSource's page IDs.


getPage

public BtreePage getPage(byte[] pageId,
                         Btree btree)
                  throws StorageException
Retrieve a page.

Parameters:
pageId - byte array buffer containing pageId
btree - btree to which the page belongs
Returns:
the BtreePage
Throws:
StorageException

newPage

public BtreePage newPage(Btree btree)
                  throws StorageException
Creates a new page and returns it.

Parameters:
btree - btree to which the page belongs
Returns:
the BtreePage
Throws:
StorageException

newBigKeyPage

public BigKeyPage newBigKeyPage(Btree btree)
                         throws StorageException
Creates a new oversize-key page and returns it.

Parameters:
btree - btree to which the page belongs
Returns:
the BigKeyPage
Throws:
StorageException

getRootPage

public BtreePage getRootPage(Btree btree)
                      throws StorageException
Retrieve the root page for this btree.

Parameters:
btree - Btree
Returns:
the root BtreePage
Throws:
StorageException

unpinPage

public void unpinPage(BtreePage page)
Notify the BtreePageSource that the caller is done using this page.

Parameters:
page - BtreePage

unpinPage

public void unpinPage(BigKeyPage page)
               throws StorageException
Notify the BtreePageSource that the caller is done using this page.

Parameters:
page - BigKeyPage
Throws:
StorageException

dirtyPage

public void dirtyPage(BtreePage page)
               throws StorageException
Notify the BtreePageSource that the caller is going to modify this page.

Parameters:
page - BtreePage
Throws:
StorageException

setNoPage

public void setNoPage(byte[] pageId)
Fills in the provided buffer with a value that represents a null page ID.

Parameters:
pageId - byte array to be filled in

isNoPage

public boolean isNoPage(byte[] pageId)
Test whether the passed-in pageId is equal to the null page ID.

Returns:
true if the pageId is the null page ID, otherwise false

getPageIdLength

public int getPageIdLength()
Returns the length of a page ID.

Returns:
length of a page ID from this BtreePageSource

getPageSize

public int getPageSize()
Returns the size of a page.

Returns:
size of a page from this BtreePageSource

getStorage

public BtreeStorage getStorage()


Copyright © 2005 Apache Software Foundation. All Rights Reserved.