Uses of Class
edu.caltech.nanodb.storage.DBPage
-
Packages that use DBPage Package Description edu.caltech.nanodb.storage This package contains the classes for the Storage Manager, which is responsible for how data is stored in and retrieved from database files.edu.caltech.nanodb.storage.heapfile This package provides a naive implementation of the heap file organization for NanoDB.edu.caltech.nanodb.storage.writeahead This package contains the implementation for the write-ahead log, which allows us to provide transaction atomicity, consistency and durability.edu.caltech.nanodb.transactions This package contains classes for managing transactions at the logical level, such as concurrency control and isolation, deadlock detection and aborting transactions. -
-
Uses of DBPage in edu.caltech.nanodb.storage
Fields in edu.caltech.nanodb.storage declared as DBPage Modifier and Type Field Description (package private) DBPage
BufferManager.SessionPinCount. dbPage
The page that is pinned.protected DBPage
DBFileReader. dbPage
The last page used for reading the database file.protected DBPage
PageReader. dbPage
The page that the reader will read from.private DBPage
PageTuple. dbPage
The database page that contains the tuple's data.Fields in edu.caltech.nanodb.storage with type parameters of type DBPage Modifier and Type Field Description private java.util.LinkedHashMap<BufferManager.CachedPageInfo,DBPage>
BufferManager. cachedPages
This collection holds database pages (not WAL pages) that the database is currently working with, so that they don't continually need to be reloaded.Methods in edu.caltech.nanodb.storage that return DBPage Modifier and Type Method Description DBPage
PageReader. getDBPage()
DBPage
PageTuple. getDBPage()
DBPage
BufferManager. getPage(DBFile dbFile, int pageNo, boolean create)
Retrieves the specifiedDBPage
from the Buffer Manager if it's currently buffered, ornull
if the page is not currently buffered.DBPage
StorageManager. loadDBPage(DBFile dbFile, int pageNo)
This method returns a database page to use, retrieving it from the buffer manager if it is already loaded, or reading it from the specified data file if it is not already loaded.DBPage
StorageManager. loadDBPage(DBFile dbFile, int pageNo, boolean create)
This method returns a database page to use, retrieving it from the buffer manager if it is already loaded, or reading it from the specified data file if it is not already loaded.Methods in edu.caltech.nanodb.storage with parameters of type DBPage Modifier and Type Method Description void
StorageManager. logDBPageWrite(DBPage dbPage)
This method causes any changes to the specified page to be logged by the transaction manager's write-ahead log, so that the changes can be redone or undone as may be appropriate.void
BufferManager. recordPageInvalidated(DBPage dbPage)
void
BufferManager. recordPagePinned(DBPage dbPage)
Records that the page was pinned by the current session.void
BufferManager. recordPageUnpinned(DBPage dbPage)
Records that the page was unpinned by the current session.static void
PageTuple. setNullFlag(DBPage dbPage, int tupleStart, int colIndex, boolean value)
This is a helper function to set or clear the value of a column's NULL flag.static int
PageTuple. storeTuple(DBPage dbPage, int pageOffset, Schema schema, Tuple tuple)
static int
PageTuple. writeNonNullValue(DBPage dbPage, int offset, ColumnType colType, java.lang.Object value)
This helper function is used by thePageTuple.setColumnValue(int, java.lang.Object)
method in the specific case when a column is being set to a non-NULL value.Method parameters in edu.caltech.nanodb.storage with type arguments of type DBPage Modifier and Type Method Description void
BufferManagerObserver. beforeWriteDirtyPages(java.util.List<DBPage> pages)
This method is called before the buffer manager writes the specified collection of pages.private void
BufferManager. writeDirtyPages(java.util.List<DBPage> dirtyPages, boolean invalidate)
This helper method writes out a list of dirty pages from the buffer manager, ensuring that if transactions are enabled, the write-ahead-logging rule is satisfied.Constructors in edu.caltech.nanodb.storage with parameters of type DBPage Constructor Description DBPageID(DBPage dbPage)
PageReader(DBPage dbPage)
PageTuple(DBPage dbPage, int pageOffset, Schema schema)
Construct a new tuple object that is backed by the data in the database page.PageWriter(DBPage dbPage)
SessionPinCount(DBPage dbPage)
-
Uses of DBPage in edu.caltech.nanodb.storage.heapfile
Methods in edu.caltech.nanodb.storage.heapfile with parameters of type DBPage Modifier and Type Method Description static int
DataPage. allocNewTuple(DBPage dbPage, int len)
Update the data page so that it has space for a new tuple of the specified size.static void
DataPage. deleteTuple(DBPage dbPage, int slot)
Deletes the tuple at the specified slot from the data page.static void
DataPage. deleteTupleDataRange(DBPage dbPage, int off, int len)
This static helper function removes a sequence of bytes from the current tuple data in the page, sliding tuple data below the offset forward to fill in the gap.static int
DataPage. getFreeSpaceInPage(DBPage dbPage)
This static helper function returns the amount of free space in a tuple data page.static int
DataPage. getNumSlots(DBPage dbPage)
Returns the number of slots in this data page.static int
HeaderPage. getSchemaSize(DBPage dbPage)
Returns the number of bytes that the table's schema occupies for storage in the header page.static int
DataPage. getSlotIndexFromOffset(DBPage dbPage, int offset)
static int
DataPage. getSlotsEndIndex(DBPage dbPage)
This static helper function returns the index where the slot list ends in the data page.static int
DataPage. getSlotValue(DBPage dbPage, int slot)
This static helper function returns the value stored in the specified slot.static int
HeaderPage. getStatsOffset(DBPage dbPage)
Returns the offset in the header page that the table statistics start at.static int
HeaderPage. getStatsSize(DBPage dbPage)
Returns the number of bytes that the table's statistics occupy for storage in the header page.static int
DataPage. getTupleDataEnd(DBPage dbPage)
This static helper function returns the index of where tuple data currently ends in the specified data page.static int
DataPage. getTupleDataStart(DBPage dbPage)
This static helper function returns the index of where tuple data currently starts in the specified data page.static int
DataPage. getTupleLength(DBPage dbPage, int slot)
Returns the length of the tuple stored at the specified slot.static void
DataPage. initNewPage(DBPage dbPage)
Initialize a newly allocated data page.static void
DataPage. insertTupleDataRange(DBPage dbPage, int off, int len)
This static helper function creates a space in the data page of the specified size, sliding tuple data below the offset down to create a gap.static void
DataPage. sanityCheck(DBPage dbPage)
This static helper method verifies that the specified data page has proper structure and organization by performing various sanity checks.static void
DataPage. setNumSlots(DBPage dbPage, int numSlots)
Sets the number of slots in this data page.static void
HeaderPage. setSchemaSize(DBPage dbPage, int numBytes)
Sets the number of bytes that the table's schema occupies for storage in the header page.static void
DataPage. setSlotValue(DBPage dbPage, int slot, int value)
This static helper function sets the value for the specified slot.static void
HeaderPage. setStatsSize(DBPage dbPage, int numBytes)
Sets the number of bytes that the table's statistics occupy for storage in the header page.static HeapFilePageTuple
HeapFilePageTuple. storeNewTuple(Schema schema, DBPage dbPage, int slot, int pageOffset, Tuple tuple)
private static void
HeaderPage. verifyIsHeaderPage(DBPage dbPage)
This helper method simply verifies that the data page provided to the HeaderPage class is in fact a header-page (i.e.Constructors in edu.caltech.nanodb.storage.heapfile with parameters of type DBPage 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. -
Uses of DBPage in edu.caltech.nanodb.storage.writeahead
Methods in edu.caltech.nanodb.storage.writeahead with parameters of type DBPage Modifier and Type Method Description private void
WALManager. applyRedo(WALRecordType type, DBFileReader walReader, DBPage dbPage, int numSegments)
This helper function writes a sequence of redo-segments from anWALRecordType.UPDATE_PAGE
orWALRecordType.UPDATE_PAGE_REDO_ONLY
record.private byte[]
WALManager. applyUndoAndGenRedoOnlyData(DBFileReader walReader, DBPage dbPage, int numSegments)
This helper method uses aWALRecordType.UPDATE_PAGE
record to undo changes to a data page, and at the same time the method generates the data that must go into a corresponding redo-only WAL record.private LogSequenceNumber
WALManager. writeRedoOnlyUpdatePageRecord(int transactionID, LogSequenceNumber prevLSN, DBPage dbPage, int numSegments, byte[] changes)
This method writes a redo-only update-page record to the write-ahead log, including only redo details.private LogSequenceNumber
WALManager. writeRedoOnlyUpdatePageRecord(DBPage dbPage, int numSegments, byte[] changes)
This method writes a redo-only update-page record to the write-ahead log, including only redo details.void
WALManager. writeUpdatePageRecord(DBPage dbPage)
This method writes an update-page record to the write-ahead log, including both undo and redo details. -
Uses of DBPage in edu.caltech.nanodb.transactions
Fields in edu.caltech.nanodb.transactions declared as DBPage Modifier and Type Field Description private DBPage
TransactionStatePage. dbPage
Methods in edu.caltech.nanodb.transactions with parameters of type DBPage Modifier and Type Method Description void
TransactionManager. recordPageUpdate(DBPage dbPage)
Method parameters in edu.caltech.nanodb.transactions with type arguments of type DBPage Modifier and Type Method Description void
TransactionManager. beforeWriteDirtyPages(java.util.List<DBPage> pages)
This method is registered on theBufferManager
, to ensure that the write-ahead logging rule is enforced.Constructors in edu.caltech.nanodb.transactions with parameters of type DBPage Constructor Description TransactionStatePage(DBPage dbPage)
-