Class HeapFilePageTuple
- java.lang.Object
-
- edu.caltech.nanodb.storage.PageTuple
-
- edu.caltech.nanodb.storage.heapfile.HeapFilePageTuple
-
-
Field Summary
Fields Modifier and Type Field Description private int
slot
The slot that this tuple corresponds to.-
Fields inherited from class edu.caltech.nanodb.storage.PageTuple
NULL_OFFSET
-
-
Constructor Summary
Constructors Constructor Description HeapFilePageTuple(Schema schema, DBPage dbPage, int slot, int pageOffset)
Construct a new tuple object that is backed by the data in the database page.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
deleteTupleDataRange(int off, int len)
FilePointer
getExternalReference()
This method returns an external reference to the tuple, which references the page number and slot-offset of the tuple.int
getSlot()
protected void
insertTupleDataRange(int off, int len)
static HeapFilePageTuple
storeNewTuple(Schema schema, DBPage dbPage, int slot, int pageOffset, Tuple tuple)
-
Methods inherited from class edu.caltech.nanodb.storage.PageTuple
getColumnCount, getColumnValue, getDBPage, getEndOffset, getNullFlagsSize, getOffset, getPinCount, getSchema, getSize, getStorageSize, getTupleStorageSize, isDiskBacked, isNullValue, isPinned, pin, setColumnValue, setNullFlag, storeTuple, toString, unpin, writeNonNullValue
-
-
-
-
Field Detail
-
slot
private int slot
The slot that this tuple corresponds to. The tuple doesn't actually manipulate the slot table directly; that is for theIndexedTableManager
to deal with.
-
-
Constructor Detail
-
HeapFilePageTuple
public HeapFilePageTuple(Schema schema, DBPage dbPage, int slot, int pageOffset)
Construct a new tuple object that is backed by the data in the database page. This tuple is able to be read from or written to.- Parameters:
schema
- the schema of the tuple file the page is a part ofdbPage
- the specific database page that holds the tupleslot
- the slot number of the tuplepageOffset
- the offset of the tuple's actual data in the page
-
-
Method Detail
-
getExternalReference
public FilePointer getExternalReference()
This method returns an external reference to the tuple, which references the page number and slot-offset of the tuple.- Specified by:
getExternalReference
in interfaceTuple
- Overrides:
getExternalReference
in classPageTuple
- Returns:
- a file-pointer that can be used to look up this tuple
-
insertTupleDataRange
protected void insertTupleDataRange(int off, int len)
- Specified by:
insertTupleDataRange
in classPageTuple
-
deleteTupleDataRange
protected void deleteTupleDataRange(int off, int len)
- Specified by:
deleteTupleDataRange
in classPageTuple
-
getSlot
public int getSlot()
-
storeNewTuple
public static HeapFilePageTuple storeNewTuple(Schema schema, DBPage dbPage, int slot, int pageOffset, Tuple tuple)
-
-