All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class btree.BTSortedPage

java.lang.Object
   |
   +----diskmgr.Page
           |
           +----heap.HFPage
                   |
                   +----btree.BTSortedPage

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.


Constructor Index

 o BTSortedPage(int)
new a page, and associate the SortedPage instance with the Page instance
 o BTSortedPage(Page, int)
associate the SortedPage instance with the Page instance
 o BTSortedPage(PageId, int)
pin the page with pageno, and get the corresponding SortedPage

Method Index

 o deleteSortedRecord(RID)
Deletes a record from a sorted record page.
 o insertRecord(KeyDataEntry)
Performs a sorted insertion of a record on an record page.

Constructors

 o 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
 o 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.
 o 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

Methods

 o insertRecord
 public RID insertRecord(KeyDataEntry entry) throws InsertRecException
Performs a sorted insertion of a record on an record page. The records are sorted in increasing key order. Only the slot directory is rearranged. The data records remain in the same positions on the page.

Parameters:
entry - the entry to be inserted. Input parameter.
Returns:
its rid where the entry was inserted; null if no space left.
Throws: InsertRecException
error when insert
 o 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

All Packages  Class Hierarchy  This Package  Previous  Next  Index