btree.page
Class BTHeaderPage

java.lang.Object
  extended bydiskmgr.Page
      extended byheap.HFPage
          extended bybtree.page.BTHeaderPage
All Implemented Interfaces:
heap.ConstSlot, GlobalConst

public class BTHeaderPage
extends HFPage

Intefrace of a B+ tree index header page. Here we use a HFPage as head page of the file Inside the headpage, Logicaly, there are only seven elements inside the head page, they are magic0, rootId, keyType, maxKeySize, deleteFashion, and type(=NodeType.BTHEAD)


Field Summary
 
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, 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
BTHeaderPage()
          new a page, and associate the SortedPage instance with the Page instance
BTHeaderPage(Page page)
          associate the SortedPage instance with the Page instance
BTHeaderPage(PageId pageno)
          pin the page with pageno, and get the corresponding SortedPage
 
Method Summary
 int get_deleteFashion()
          get the delete fashion
 short get_keyType()
          get the key type
 int get_magic0()
          get the magic0
 int get_maxKeySize()
          set the max keysize
 PageId get_rootId()
          get the rootId
 PageId getPageId()
           
 void set_deleteFashion(int fashion)
          set the delete fashion
 void set_keyType(short key_type)
          set the key type
 void set_magic0(int magic)
          set the magic0
 void set_maxKeySize(int key_size)
          get the max keysize
 void set_rootId(PageId rootID)
          set the rootId
 void setPageId(PageId pageno)
           
 
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 diskmgr.Page
getpage, setpage
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BTHeaderPage

public BTHeaderPage(PageId pageno)
             throws ConstructPageException
pin the page with pageno, and get the corresponding SortedPage


BTHeaderPage

public BTHeaderPage(Page page)
associate the SortedPage instance with the Page instance


BTHeaderPage

public BTHeaderPage()
             throws ConstructPageException
new a page, and associate the SortedPage instance with the Page instance

Method Detail

setPageId

public void setPageId(PageId pageno)
               throws java.io.IOException
Throws:
java.io.IOException

getPageId

public PageId getPageId()
                 throws java.io.IOException
Throws:
java.io.IOException

set_magic0

public void set_magic0(int magic)
                throws java.io.IOException
set the magic0

Parameters:
magic - magic0 will be set to be equal to magic
Throws:
java.io.IOException

get_magic0

public int get_magic0()
               throws java.io.IOException
get the magic0

Throws:
java.io.IOException

set_rootId

public void set_rootId(PageId rootID)
                throws java.io.IOException
set the rootId

Throws:
java.io.IOException

get_rootId

public PageId get_rootId()
                  throws java.io.IOException
get the rootId

Throws:
java.io.IOException

set_keyType

public void set_keyType(short key_type)
                 throws java.io.IOException
set the key type

Throws:
java.io.IOException

get_keyType

public short get_keyType()
                  throws java.io.IOException
get the key type

Throws:
java.io.IOException

set_maxKeySize

public void set_maxKeySize(int key_size)
                    throws java.io.IOException
get the max keysize

Throws:
java.io.IOException

get_maxKeySize

public int get_maxKeySize()
                   throws java.io.IOException
set the max keysize

Throws:
java.io.IOException

set_deleteFashion

public void set_deleteFashion(int fashion)
                       throws java.io.IOException
set the delete fashion

Throws:
java.io.IOException

get_deleteFashion

public int get_deleteFashion()
                      throws java.io.IOException
get the delete fashion

Throws:
java.io.IOException