|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object global.AbstractBufMgr
Field Summary |
Fields inherited from interface global.GlobalConst |
INVALID_PAGE, MAX_NAME, MAXATTRNAME, MAXFILENAME, MAXINDEXNAME, MINIBASE_BUFFER_POOL_SIZE, MINIBASE_DB_SIZE, MINIBASE_DEFAULT_SHAREDMEM_SIZE, MINIBASE_MAX_TRANSACTIONS, MINIBASE_MAXARRSIZE, NUMBUF, PAGE_SIZE, PAGESIZE |
Constructor Summary | |
AbstractBufMgr()
|
Method Summary | |
abstract void |
flushAllPages()
Flushes all pages of the buffer pool to disk |
abstract void |
flushPage(PageId pageid)
Added to flush a particular page of the buffer pool to disk |
abstract void |
freePage(PageId globalPageId)
User should call this method if she needs to delete a page. |
abstract AbstractBufMgrFrameDesc[] |
getFrameTable()
|
abstract int |
getNumBuffers()
Gets the total number of buffers. |
abstract int |
getNumUnpinnedBuffers()
Gets the total number of unpinned buffer frames. |
abstract PageId |
newPage(Page firstpage,
int howmany)
Call DB object to allocate a run of new pages and find a frame in the buffer pool for the first page and pin it. |
abstract void |
pinPage(PageId pin_pgid,
Page page,
boolean emptyPage)
Check if this page is in buffer pool, otherwise find a frame for this page, read in and pin it. |
abstract void |
unpinPage(PageId PageId_in_a_DB,
boolean dirty)
To unpin a page specified by a pageId. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public AbstractBufMgr()
Method Detail |
public abstract void pinPage(PageId pin_pgid, Page page, boolean emptyPage) throws ReplacerException, HashOperationException, PageUnpinnedException, InvalidFrameNumberException, PageNotReadException, BufferPoolExceededException, PagePinnedException, BufMgrException, java.io.IOException
page
- the pointer poit to the page.emptyPage
- true (empty page); false (non-empty page)
ReplacerException
- if there is a replacer error.
HashOperationException
- if there is a hashtable error.
PageUnpinnedException
- if there is a page that is already unpinned.
InvalidFrameNumberException
- if there is an invalid frame number .
PageNotReadException
- if a page cannot be read.
BufferPoolExceededException
- if the buffer pool is full.
PagePinnedException
- if a page is left pinned .
BufMgrException
- other error occured in bufmgr layer
java.io.IOException
- if there is other kinds of I/O error.public abstract void unpinPage(PageId PageId_in_a_DB, boolean dirty) throws ReplacerException, PageUnpinnedException, HashEntryNotFoundException, InvalidFrameNumberException
dirty
- the dirty bit of the frame
ReplacerException
- if there is a replacer error.
PageUnpinnedException
- if there is a page that is already unpinned.
InvalidFrameNumberException
- if there is an invalid frame number .
HashEntryNotFoundException
- if there is no entry of page in the hash table.public abstract PageId newPage(Page firstpage, int howmany) throws BufferPoolExceededException, HashOperationException, ReplacerException, HashEntryNotFoundException, InvalidFrameNumberException, PagePinnedException, PageUnpinnedException, PageNotReadException, BufMgrException, DiskMgrException, java.io.IOException
firstpage
- the address of the first page.howmany
- total number of allocated new pages.
BufferPoolExceededException
- if the buffer pool is full.
HashOperationException
- if there is a hashtable error.
ReplacerException
- if there is a replacer error.
HashEntryNotFoundException
- if there is no entry of page in the hash table.
InvalidFrameNumberException
- if there is an invalid frame number.
PageUnpinnedException
- if there is a page that is already unpinned.
PagePinnedException
- if a page is left pinned.
PageNotReadException
- if a page cannot be read.
java.io.IOException
- if there is other kinds of I/O error.
BufMgrException
- other error occured in bufmgr layer
DiskMgrException
- other error occured in diskmgr layerpublic abstract void freePage(PageId globalPageId) throws InvalidBufferException, ReplacerException, HashOperationException, InvalidFrameNumberException, PageNotReadException, BufferPoolExceededException, PagePinnedException, PageUnpinnedException, HashEntryNotFoundException, BufMgrException, DiskMgrException, java.io.IOException
globalPageId
- the page number in the data base.
InvalidBufferException
- if buffer pool corrupted.
ReplacerException
- if there is a replacer error.
HashOperationException
- if there is a hash table error.
InvalidFrameNumberException
- if there is an invalid frame number.
PageNotReadException
- if a page cannot be read.
BufferPoolExceededException
- if the buffer pool is already full.
PagePinnedException
- if a page is left pinned.
PageUnpinnedException
- if there is a page that is already unpinned.
HashEntryNotFoundException
- if there is no entry of page in the hash table.
java.io.IOException
- if there is other kinds of I/O error.
BufMgrException
- other error occured in bufmgr layer
DiskMgrException
- other error occured in diskmgr layerpublic abstract void flushPage(PageId pageid) throws HashOperationException, PageUnpinnedException, PagePinnedException, PageNotFoundException, BufMgrException, java.io.IOException
pageid
- the page number in the database.
HashOperationException
- if there is a hashtable error.
PageUnpinnedException
- if there is a page that is already unpinned.
PagePinnedException
- if a page is left pinned.
PageNotFoundException
- if a page is not found.
BufMgrException
- other error occured in bufmgr layer
java.io.IOException
- if there is other kinds of I/O error.public abstract void flushAllPages() throws HashOperationException, PageUnpinnedException, PagePinnedException, PageNotFoundException, BufMgrException, java.io.IOException
HashOperationException
- if there is a hashtable error.
PageUnpinnedException
- if there is a page that is already unpinned.
PagePinnedException
- if a page is left pinned.
PageNotFoundException
- if a page is not found.
BufMgrException
- other error occured in bufmgr layer
java.io.IOException
- if there is other kinds of I/O error.public abstract int getNumBuffers()
public abstract int getNumUnpinnedBuffers()
public abstract AbstractBufMgrFrameDesc[] getFrameTable()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |