|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.netbeans.mdr.persistence.btreeimpl.btreestorage.BtreeFileSource
public class BtreeFileSource
BtreePageSource implementation for pages which are stored directly in a file (the primary index pages) rather than as repository objects. The file access is all handled by the FileCache class.
Constructor Summary | |
---|---|
BtreeFileSource(int fileId,
FileCache fileCache,
int pageSize,
boolean isNew,
MofidGenerator mGen,
BtreeStorage storage)
Constructor for a BtreeFileSource from a new or existing index file. |
Method Summary | |
---|---|
void |
dirtyPage(BtreePage page)
Notifies the btree that the caller is going to modify this page. |
java.lang.String |
getMofidPrefix()
Get the prefix for this repository |
long |
getNextMofid()
get the next unique ID for this repository |
BtreePage |
getPage(byte[] pageId,
Btree btree)
Get a BtreePage by its pageId. |
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)
Return the root page if it already exists, otherwise create it. |
BtreeStorage |
getStorage()
|
boolean |
isNoPage(byte[] pageId)
Test whether the passed-in pageId contains the special value noPageId |
BigKeyPage |
newBigKeyPage(Btree btree)
Returns a newly allocated BigKeyPage. |
BtreePage |
newPage(Btree btree)
Returns a newly allocated btree page. |
void |
prepareToCommit()
Prepares all cached modified pages to be written out. |
void |
setNoPage(byte[] pageId)
Set the passed-in pageId to contain the special value noPageId |
void |
unpinPage(BigKeyPage page)
Notify the BtreePageSource that the caller is done using this page. |
void |
unpinPage(BtreePage page)
Notifies the btree that the caller is done using this page. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BtreeFileSource(int fileId, FileCache fileCache, int pageSize, boolean isNew, MofidGenerator mGen, BtreeStorage storage) throws StorageException
fileId
- file ID to use in FileCache requestsfileCache
- source of index pagespageSize
- size of index pagesisNew
- true if this index is being newly createdmGen
- Mofid generator
StorageException
Method Detail |
---|
public EntryTypeInfo getPageIdInfo()
BtreePageSource
getPageIdInfo
in interface BtreePageSource
public void setNoPage(byte[] pageId)
setNoPage
in interface BtreePageSource
pageId
- byte array to be filled inpublic boolean isNoPage(byte[] pageId)
isNoPage
in interface BtreePageSource
public void prepareToCommit() throws StorageException
prepareToCommit
in interface FileCache.NotifyOnCommit
StorageException
public BtreePage getRootPage(Btree btree) throws StorageException
getRootPage
in interface BtreePageSource
btree
- Btree
StorageException
public BtreePage getPage(byte[] pageId, Btree btree) throws StorageException
getPage
in interface BtreePageSource
pageId
- Byte array containing pageIdbtree
- btree to which the page belongs
StorageException
- If the page is not validpublic BtreePage newPage(Btree btree) throws StorageException
newPage
in interface BtreePageSource
btree
- btree to which the page belongs
StorageException
- If the page is not validpublic BigKeyPage newBigKeyPage(Btree btree) throws StorageException
newBigKeyPage
in interface BtreePageSource
btree
- btree to which the page belongs
StorageException
public void unpinPage(BtreePage page)
unpinPage
in interface BtreePageSource
page
- BtreePage to be unpinnedpublic void unpinPage(BigKeyPage page) throws StorageException
BtreePageSource
unpinPage
in interface BtreePageSource
page
- BigKeyPage
StorageException
public void dirtyPage(BtreePage page) throws StorageException
dirtyPage
in interface BtreePageSource
page
- The page being modified
StorageException
public int getPageIdLength()
BtreePageSource
getPageIdLength
in interface BtreePageSource
public int getPageSize()
BtreePageSource
getPageSize
in interface BtreePageSource
public long getNextMofid()
MofidGenerator
getNextMofid
in interface MofidGenerator
public java.lang.String getMofidPrefix()
MofidGenerator
getMofidPrefix
in interface MofidGenerator
public BtreeStorage getStorage()
getStorage
in interface BtreePageSource
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |