|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object global.AbstractBufMgrReplacer
A super class for buffer pool replacement algorithm. It describes which frame to be picked up for replacement by a certain replace algorithm.
Field Summary | |
static int |
Available
|
static int |
Pinned
|
static int |
Referenced
|
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 | |
AbstractBufMgrReplacer()
|
|
AbstractBufMgrReplacer(AbstractBufMgr javamgr)
Creates a replacer object. |
Method Summary | |
abstract void |
free(int frameNo)
Frees and unpins a page in the buffer pool. |
abstract int |
getNumUnpinnedBuffers()
Counts the unpinned frames (free frames) in the buffer pool. |
abstract java.lang.String |
name()
Retruns the name of the replacer algorithm. |
abstract int |
pick_victim()
Must pin the returned frame. |
abstract void |
pin(int frameNo)
Pins a candidate page in the buffer pool. |
void |
setBufferManager(AbstractBufMgr mgrArg)
Sets the buffer manager to be eqaul to the buffer manager in the argument, gets the total number of buffer frames, and mainstains the head of the clock. |
abstract boolean |
unpin(int frameNo)
Unpins a page in the buffer pool. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int Available
public static final int Referenced
public static final int Pinned
Constructor Detail |
public AbstractBufMgrReplacer()
public AbstractBufMgrReplacer(AbstractBufMgr javamgr)
Method Detail |
public abstract void pin(int frameNo) throws InvalidFrameNumberException
frameNo
- frame number of the page.
InvalidFrameNumberException
- if the frame number is less than zero or bigger than number
of buffers.public abstract boolean unpin(int frameNo) throws InvalidFrameNumberException, PageUnpinnedException
frameNo
- frame number of the page.
InvalidFrameNumberException
- if the frame number is less than zero or bigger than number
of buffers.
PageUnpinnedException
- if the page is originally unpinned.public abstract void free(int frameNo) throws PagePinnedException
frameNo
- frame number of the page.
PagePinnedException
- if the page is pinned.public abstract int pick_victim() throws BufferPoolExceededException, PagePinnedException
BufferPoolExceededException
PagePinnedException
public abstract java.lang.String name()
public abstract int getNumUnpinnedBuffers()
public void setBufferManager(AbstractBufMgr mgrArg)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |