Uses of Class
edu.caltech.nanodb.storage.DBFile
-
Packages that use DBFile Package Description edu.caltech.nanodb.relations This package contains the basic data-types for representing relations in NanoDB.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. -
-
Uses of DBFile in edu.caltech.nanodb.relations
Methods in edu.caltech.nanodb.relations that return DBFile Modifier and Type Method Description DBFile
TableInfo. getDBFile()
A helper function to simplify retrieving the table'sDBFile
. -
Uses of DBFile in edu.caltech.nanodb.storage
Fields in edu.caltech.nanodb.storage declared as DBFile Modifier and Type Field Description (package private) DBFile
BufferManager.CachedPageInfo. dbFile
protected DBFile
DBFileReader. dbFile
The database file being read by this reader.private DBFile
DBPage. dbFile
A reference to the database file that this page is from.private DBFile
FileManagerImpl. lastFileAccessed
The DBFile object of the file that was accessed most recently.Fields in edu.caltech.nanodb.storage with type parameters of type DBFile Modifier and Type Field Description private java.util.LinkedHashMap<java.lang.String,DBFile>
BufferManager. cachedFiles
This collection holds theDBFile
objects corresponding to various opened files the database is currently using.Methods in edu.caltech.nanodb.storage that return DBFile Modifier and Type Method Description DBFile
FileManager. createDBFile(java.lang.String filename, DBFileType type, int pageSize)
This method creates a new database file in the directory used by the storage manager.DBFile
FileManagerImpl. createDBFile(java.lang.String filename, DBFileType type, int pageSize)
DBFile
StorageManager. createDBFile(java.lang.String filename, DBFileType type)
DBFile
DBFileReader. getDBFile()
DBFile
DBPage. getDBFile()
Returns the database file that this page is contained within.DBFile
TupleFile. getDBFile()
Returns theDBFile
object that this tuple file is stored in.DBFile
BufferManager. getFile(java.lang.String filename)
Retrieves the specifiedDBFile
from the buffer manager, if it has already been opened.DBFile
FileManager. openDBFile(java.lang.String filename)
This method opens a database file, and reads in the file's type and page size from the first two bytes of the first page.DBFile
FileManagerImpl. openDBFile(java.lang.String filename)
DBFile
StorageManager. openDBFile(java.lang.String filename)
Methods in edu.caltech.nanodb.storage that return types with arguments of type DBFile Modifier and Type Method Description java.util.List<DBFile>
BufferManager. removeAll()
This method removes ALL files from the cache, first flushing all pages from the cache so that any dirty pages will be saved to disk (possibly updating the write-ahead log in the process).Methods in edu.caltech.nanodb.storage with parameters of type DBFile Modifier and Type Method Description void
BufferManager. addFile(DBFile dbFile)
void
FileManager. closeDBFile(DBFile dbFile)
Closes the underlying data file.void
FileManagerImpl. closeDBFile(DBFile dbFile)
private void
StorageManager. closeDBFile(DBFile dbFile)
TupleFile
TupleFileManager. createTupleFile(DBFile dbFile, Schema schema)
Initialize the specifiedDBFile
to be a new empty table with the specified schema.void
FileManager. deleteDBFile(DBFile dbFile)
Deletes the specified database file.void
FileManagerImpl. deleteDBFile(DBFile dbFile)
void
BufferManager. flushDBFile(DBFile dbFile)
This method removes all cached pages in the specified file from the buffer manager, writing out any dirty pages in the process.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.private long
FileManagerImpl. getPageStart(DBFile dbFile, int pageNo)
This helper function calculates the file-position of the specified page.boolean
DBPage. isFromDBFile(DBFile databaseFile)
Returns true if this page is from the specified database file.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.boolean
FileManager. loadPage(DBFile dbFile, int pageNo, byte[] buffer)
Loads a page from the underlying data file, and returns a newDBPage
object containing the data.boolean
FileManager. loadPage(DBFile dbFile, int pageNo, byte[] buffer, boolean create)
Loads a page from the underlying data file, and returns a newDBPage
object containing the data.boolean
FileManagerImpl. loadPage(DBFile dbFile, int pageNo, byte[] buffer)
boolean
FileManagerImpl. loadPage(DBFile dbFile, int pageNo, byte[] buffer, boolean create)
TupleFile
TupleFileManager. openTupleFile(DBFile dbFile)
Open the specifiedDBFile
as aTupleFile
of a specific type, containing tuples of data conforming to a specific schema.void
BufferManager. removeDBFile(DBFile dbFile)
This method removes a file from the cache, first flushing all pages from the file out of the cache.boolean
FileManager. renameDBFile(DBFile dbFile, java.lang.String newFilename)
Attempts to rename the specifiedDBFile
to a new filename.boolean
FileManagerImpl. renameDBFile(DBFile dbFile, java.lang.String newFilename)
void
FileManager. savePage(DBFile dbFile, int pageNo, byte[] buffer)
Saves a page to the DB file, and then clears the page's dirty flag.void
FileManagerImpl. savePage(DBFile dbFile, int pageNo, byte[] buffer)
void
FileManager. syncDBFile(DBFile dbFile)
This method ensures that all file-writes on the specified DB-file have actually been synchronized to the disk.void
FileManagerImpl. syncDBFile(DBFile dbFile)
private void
FileManagerImpl. updateFileIOPerfStats(DBFile dbFile, int pageNo, boolean read, int bufSize)
void
BufferManager. writeDBFile(DBFile dbFile, boolean sync)
This method writes all dirty pages in the specified file, optionally syncing the file after performing the write.void
BufferManager. writeDBFile(DBFile dbFile, int minPageNo, int maxPageNo, boolean sync)
This method writes all dirty pages in the specified file, optionally syncing the file after performing the write.Constructors in edu.caltech.nanodb.storage with parameters of type DBFile Constructor Description CachedPageInfo(DBFile dbFile, int pageNo)
DBFileReader(DBFile dbFile, StorageManager storageManager)
DBFileWriter(DBFile dbFile, StorageManager storageManager)
DBPage(BufferManager bufferManager, DBFile dbFile, int pageNo)
Constructs a new, empty table-page for the specified table file. -
Uses of DBFile in edu.caltech.nanodb.storage.heapfile
Fields in edu.caltech.nanodb.storage.heapfile declared as DBFile Modifier and Type Field Description private DBFile
HeapTupleFile. dbFile
The file that stores the tuples.Methods in edu.caltech.nanodb.storage.heapfile that return DBFile Modifier and Type Method Description DBFile
HeapTupleFile. getDBFile()
Methods in edu.caltech.nanodb.storage.heapfile with parameters of type DBFile Modifier and Type Method Description TupleFile
HeapTupleFileManager. createTupleFile(DBFile dbFile, Schema schema)
TupleFile
HeapTupleFileManager. openTupleFile(DBFile dbFile)
Constructors in edu.caltech.nanodb.storage.heapfile with parameters of type DBFile Constructor Description HeapTupleFile(StorageManager storageManager, HeapTupleFileManager heapFileManager, DBFile dbFile, Schema schema, TableStats stats)
-
Uses of DBFile in edu.caltech.nanodb.storage.writeahead
Methods in edu.caltech.nanodb.storage.writeahead that return DBFile Modifier and Type Method Description private DBFile
WALManager. createWALFile(int fileNo)
This helper method creates a brand new write-ahead log file using the Storage Manager, generating a suitable filename and passing the appropriate arguments to the Storage Manager.private DBFile
WALManager. openWALFile(int fileNo)
This helper method opens an existing write-ahead log file using the Storage Manager, generating a suitable filename and passing the appropriate arguments to the Storage Manager.
-