bufmgr
Class FrameDesc

java.lang.Object
  extended byglobal.AbstractBufMgrFrameDesc
      extended bybufmgr.FrameDesc
All Implemented Interfaces:
GlobalConst

public class FrameDesc
extends AbstractBufMgrFrameDesc

A frame description class. It describes each page in the buffer pool, the page number in the file, whether it is dirty or not, its pin count, and the pin count change when pinning or unpinning a page.


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
FrameDesc()
          Creates a FrameDesc object, initialize pageNo, dirty and pin_count.
 
Method Summary
 int getPageNo()
           
 int getPinCount()
          Returns the pin count of a certain frame page.
 boolean isDirty()
          the dirty bit, 1 (TRUE) stands for this frame is altered, 0 (FALSE) for clean frames.
 int pin()
          Increments the pin count of a certain frame page when the page is pinned.
 int unpin()
          Decrements the pin count of a frame when the page is unpinned.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FrameDesc

public FrameDesc()
Creates a FrameDesc object, initialize pageNo, dirty and pin_count.

Method Detail

getPinCount

public int getPinCount()
Returns the pin count of a certain frame page.

Specified by:
getPinCount in class AbstractBufMgrFrameDesc
Returns:
the pin count number.

pin

public int pin()
Increments the pin count of a certain frame page when the page is pinned.

Specified by:
pin in class AbstractBufMgrFrameDesc
Returns:
the incremented pin count.

unpin

public int unpin()
Decrements the pin count of a frame when the page is unpinned. If the pin count is equal to or less than zero, the pin count will be zero.

Specified by:
unpin in class AbstractBufMgrFrameDesc
Returns:
the decremented pin count.

getPageNo

public int getPageNo()
Specified by:
getPageNo in class AbstractBufMgrFrameDesc

isDirty

public boolean isDirty()
Description copied from class: AbstractBufMgrFrameDesc
the dirty bit, 1 (TRUE) stands for this frame is altered, 0 (FALSE) for clean frames.

Specified by:
isDirty in class AbstractBufMgrFrameDesc