|
||||||||||
| 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 BtreePageSourcepublic void setNoPage(byte[] pageId)
setNoPage in interface BtreePageSourcepageId - byte array to be filled inpublic boolean isNoPage(byte[] pageId)
isNoPage in interface BtreePageSource
public void prepareToCommit()
throws StorageException
prepareToCommit in interface FileCache.NotifyOnCommitStorageException
public BtreePage getRootPage(Btree btree)
throws StorageException
getRootPage in interface BtreePageSourcebtree - Btree
StorageException
public BtreePage getPage(byte[] pageId,
Btree btree)
throws StorageException
getPage in interface BtreePageSourcepageId - Byte array containing pageIdbtree - btree to which the page belongs
StorageException - If the page is not valid
public BtreePage newPage(Btree btree)
throws StorageException
newPage in interface BtreePageSourcebtree - btree to which the page belongs
StorageException - If the page is not valid
public BigKeyPage newBigKeyPage(Btree btree)
throws StorageException
newBigKeyPage in interface BtreePageSourcebtree - btree to which the page belongs
StorageExceptionpublic void unpinPage(BtreePage page)
unpinPage in interface BtreePageSourcepage - BtreePage to be unpinned
public void unpinPage(BigKeyPage page)
throws StorageException
BtreePageSource
unpinPage in interface BtreePageSourcepage - BigKeyPage
StorageException
public void dirtyPage(BtreePage page)
throws StorageException
dirtyPage in interface BtreePageSourcepage - The page being modified
StorageExceptionpublic int getPageIdLength()
BtreePageSource
getPageIdLength in interface BtreePageSourcepublic int getPageSize()
BtreePageSource
getPageSize in interface BtreePageSourcepublic long getNextMofid()
MofidGenerator
getNextMofid in interface MofidGeneratorpublic java.lang.String getMofidPrefix()
MofidGenerator
getMofidPrefix in interface MofidGeneratorpublic BtreeStorage getStorage()
getStorage in interface BtreePageSource
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||