index
Class HashBucket

java.lang.Object
  extended by global.Page
      extended by index.SortedPage
          extended by index.HashBucket
All Implemented Interfaces:
GlobalConst

 class HashBucket
extends SortedPage

A bucket is a linked list of SortedPages (overflow pages).


Field Summary
 
Fields inherited from class global.Page
data
 
Fields inherited from interface global.GlobalConst
EMPTY_SLOT, FIRST_PAGEID, INVALID_PAGEID, MAX_COLSIZE, MAX_TUPSIZE, NAME_MAXLEN, PAGE_SIZE, PIN_DISKIO, PIN_MEMCPY, UNPIN_CLEAN, UNPIN_DIRTY
 
Constructor Summary
HashBucket()
           
 
Method Summary
 int countEntries()
          Gets the number of entries in the entire bucket.
 boolean deleteEntry(DataEntry entry)
          Deletes a record from the page, compacting the free space (including the slot directory).
 boolean insertEntry(DataEntry entry)
          Inserts a new record into the hash bucket.
 
Methods inherited from class index.SortedPage
findEntry, getEntryAt, getEntryCount, getFirstKey, getFreeSpace, getKeyAt, getNextPage, nextEntry, setNextPage
 
Methods inherited from class global.Page
copyPage, getCharValue, getData, getFloatValue, getIntValue, getShortValue, getStringValue, setCharValue, setData, setFloatValue, setIntValue, setPage, setShortValue, setStringValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HashBucket

HashBucket()
Method Detail

countEntries

public int countEntries()
Gets the number of entries in the entire bucket.


insertEntry

public boolean insertEntry(DataEntry entry)
Inserts a new record into the hash bucket.

Overrides:
insertEntry in class SortedPage
Returns:
true if inserting made this page dirty, false otherwise

deleteEntry

public boolean deleteEntry(DataEntry entry)
Deletes a record from the page, compacting the free space (including the slot directory).

Overrides:
deleteEntry in class SortedPage
Returns:
true if deleting made this page dirty, false otherwise
Throws:
java.lang.IllegalArgumentException - if the entry doesn't exist