bufmgr
Class Replacer
java.lang.Object
global.AbstractBufMgrReplacer
bufmgr.Replacer
- All Implemented Interfaces:
- GlobalConst
- Direct Known Subclasses:
- Clock
- public abstract class Replacer
- extends AbstractBufMgrReplacer
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 |
Method Summary |
void |
free(int frameNo)
Frees and unpins a page in the buffer pool. |
int |
getNumUnpinnedBuffers()
Counts the unpinned frames (free frames) in the buffer pool. |
void |
info()
Prints out the information of the buffer frame. |
void |
pin(int frameNo)
Pins a candidate page in the buffer pool. |
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 |
Replacer
public Replacer()
Replacer
public Replacer(AbstractBufMgr javamgr)
pin
public void pin(int frameNo)
throws InvalidFrameNumberException
- Pins a candidate page in the buffer pool.
- Specified by:
pin
in class AbstractBufMgrReplacer
- Parameters:
frameNo
- frame number of the page.
- Returns:
- true if successful.
- Throws:
InvalidFrameNumberException
- if the frame number is less than zero or bigger than number
of buffers.
unpin
public boolean unpin(int frameNo)
throws InvalidFrameNumberException,
PageUnpinnedException
- Unpins a page in the buffer pool.
- Specified by:
unpin
in class AbstractBufMgrReplacer
- Parameters:
frameNo
- frame number of the page.
- Returns:
- true if successful.
- Throws:
InvalidFrameNumberException
- if the frame number is less than zero or bigger than number
of buffers.
PageUnpinnedException
- if the page is originally unpinned.
free
public void free(int frameNo)
throws PagePinnedException
- Frees and unpins a page in the buffer pool.
- Specified by:
free
in class AbstractBufMgrReplacer
- Parameters:
frameNo
- frame number of the page.
- Throws:
PagePinnedException
- if the page is pinned.
info
public void info()
- Prints out the information of the buffer frame.
getNumUnpinnedBuffers
public int getNumUnpinnedBuffers()
- Counts the unpinned frames (free frames) in the buffer pool.
- Specified by:
getNumUnpinnedBuffers
in class AbstractBufMgrReplacer