|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.ObjectHeapFile
public class HeapFile
Heap file. This manages a linked list of heap file pages.
| Constructor Summary | |
|---|---|
HeapFile(BufferManager bufMgr,
java.lang.String name)
Opens the heap file with the given name. |
|
HeapFile(BufferManager bufMgr,
java.lang.String name,
int numPages)
Constructs a heap file with the specified number of pages. |
|
| Method Summary | |
|---|---|
static boolean |
erase(java.lang.String name)
Erases the heap file entirely from the filesystem. |
byte[] |
getRecord(RID rid)
Returns the record associated with an RID. |
RID |
insertRecord(byte[] record)
Inserts a new record onto the heap file. |
PageIterator |
pageIterator()
Returns a page iterator on this heap file starting with the first page. |
RecordIterator |
recordIterator()
Returns a record iterator on this heap file starting with the first page. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public HeapFile(BufferManager bufMgr,
java.lang.String name,
int numPages)
throws java.io.IOException
bufMgr - Reference to a buffer manager to be used for the
life of this HeapFile object.name - Name to be used for heap filenumPages - maximum number of pages in heap file.
java.io.IOException - passed through from underlying file system.
public HeapFile(BufferManager bufMgr,
java.lang.String name)
throws java.io.IOException
bufMgr - Reference to a buffer manager to be used for the
life of this HeapFile object.name - Name to be used for heap file
java.io.IOException - passed through from underlying file system.| Method Detail |
|---|
public static boolean erase(java.lang.String name)
throws java.io.IOException
name - name of the database.
java.io.IOException - passed through from underlying file system.
public RID insertRecord(byte[] record)
throws java.io.IOException
record - the record to be inserted. A copy of the data is
inserted into the heap file.
DBFile.FileFullException - if there are not enough free pages.
java.io.IOException - passed through from underlying file system.
public byte[] getRecord(RID rid)
throws java.io.IOException
rid - the rid of interest
DBFile.BadPageNumberException - if the page id is invalid
HFPage.BadSlotIdException - if the slot id within curRid
is invalid
java.io.IOException
public PageIterator pageIterator()
throws java.io.IOException
java.io.IOException - passed through from underlying file system.
public RecordIterator recordIterator()
throws java.io.IOException
java.io.IOException - passed through from underlying file system.
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||