btree
Class BTSortedPage
java.lang.Object
diskmgr.Page
heap.HFPage
btree.BTSortedPage
- All Implemented Interfaces:
- heap.ConstSlot, GlobalConst
- Direct Known Subclasses:
- BTIndexPage, BTLeafPage
- public class BTSortedPage
- extends HFPage
BTsortedPage class
just holds abstract records in sorted order, based
on how they compare using the key interface from BT.java.
Fields inherited from class heap.HFPage |
CUR_PAGE, DPFIXED, EMPTY_SLOT, FREE_SPACE, INVALID_SLOT, NEXT_PAGE, PREV_PAGE, SIZE_OF_SLOT, SLOT_CNT, TYPE, USED_PTR |
Fields inherited from interface global.GlobalConst |
INVALID_PAGE, MAX_NAME, MAX_SPACE, MAXATTRNAME, MAXFILENAME, MAXINDEXNAME, MINIBASE_BUFFER_POOL_SIZE, MINIBASE_DB_SIZE, MINIBASE_DEFAULT_SHAREDMEM_SIZE, MINIBASE_MAX_TRANSACTIONS, MINIBASE_MAXARRSIZE, MINIBASE_PAGESIZE, NUMBUF |
Constructor Summary |
BTSortedPage(int keyType)
new a page, and associate the SortedPage instance with the Page instance |
BTSortedPage(PageId pageno,
int keyType)
pin the page with pageno, and get the corresponding SortedPage |
BTSortedPage(Page page,
int keyType)
associate the SortedPage instance with the Page instance |
Methods inherited from class heap.HFPage |
available_space, deleteRecord, dumpPage, empty, firstRecord, getCurPage, getHFpageArray, getNextPage, getPrevPage, getRecord, getSlotCnt, getSlotLength, getSlotOffset, getType, init, insertRecord, nextRecord, openHFpage, returnRecord, setCurPage, setNextPage, setPrevPage, setSlot, setType |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BTSortedPage
public BTSortedPage(PageId pageno,
int keyType)
throws ConstructPageException
- pin the page with pageno, and get the corresponding SortedPage
- Parameters:
pageno
- input parameter. To specify which page number the
BTSortedPage will correspond to.keyType
- input parameter. It specifies the type of key. It can be
AttrType.attrString or AttrType.attrInteger.
- Throws:
ConstructPageException
- error for BTSortedPage constructor
BTSortedPage
public BTSortedPage(Page page,
int keyType)
- associate the SortedPage instance with the Page instance
- Parameters:
page
- input parameter. To specify which page the
BTSortedPage will correspond to.keyType
- input parameter. It specifies the type of key. It can be
AttrType.attrString or AttrType.attrInteger.
BTSortedPage
public BTSortedPage(int keyType)
throws ConstructPageException
- new a page, and associate the SortedPage instance with the Page instance
- Parameters:
keyType
- input parameter. It specifies the type of key. It can be
AttrType.attrString or AttrType.attrInteger.
- Throws:
ConstructPageException
- error for BTSortedPage constructor
deleteSortedRecord
public boolean deleteSortedRecord(RID rid)
throws DeleteRecException
- Deletes a record from a sorted record page. It also calls
HFPage.compact_slot_dir() to compact the slot directory.
- Parameters:
rid
- it specifies where a record will be deleted
- Returns:
- true if success; false if rid is invalid(no record in the rid).
- Throws:
DeleteRecException
- error when delete