Class BTreeTupleFileManager
java.lang.Object
edu.caltech.nanodb.storage.btreefile.BTreeTupleFileManager
- All Implemented Interfaces:
TupleFileManager
This class provides high-level operations on B+ tree tuple files.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static org.apache.logging.log4j.LoggerA logging object for reporting anything interesting that happens.private StorageManagerA reference to the storage manager. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateTupleFile(DBFile dbFile, Schema schema) Initialize the specifiedDBFileto be a new empty table with the specified schema.voiddeleteTupleFile(TupleFile tupleFile) Delete the specified tuple-file.Returns theDBFileTypevalue used to indicate this storage format in data files.Returns the "short name" used to refer to this storage-file type.openTupleFile(DBFile dbFile) Open the specifiedDBFileas aTupleFileof a specific type, containing tuples of data conforming to a specific schema.voidsaveMetadata(TupleFile tupleFile) Writes the metadata (schema and stats information) for the tuple-file back into the tuple-file.
-
Field Details
-
logger
private static org.apache.logging.log4j.Logger loggerA logging object for reporting anything interesting that happens. -
storageManager
A reference to the storage manager.
-
-
Constructor Details
-
BTreeTupleFileManager
-
-
Method Details
-
getDBFileType
Description copied from interface:TupleFileManagerReturns theDBFileTypevalue used to indicate this storage format in data files.- Specified by:
getDBFileTypein interfaceTupleFileManager- Returns:
- the
DBFileTypevalue used to indicate this storage format in data files.
-
getShortName
Description copied from interface:TupleFileManagerReturns the "short name" used to refer to this storage-file type. This is the name used in e.g. CREATE TABLE commands to specify that a table-file should use a particular storage-file type.- Specified by:
getShortNamein interfaceTupleFileManager- Returns:
- the "short name" used to refer to this storage-file type.
-
createTupleFile
Description copied from interface:TupleFileManagerInitialize the specifiedDBFileto be a new empty table with the specified schema.- Specified by:
createTupleFilein interfaceTupleFileManager- Parameters:
dbFile- the file to use for the new tuple-fileschema- the schema of the table data to store in the file- Returns:
- a
TupleFileobject that allows tuple operations to be performed against theDBFile.
-
openTupleFile
Description copied from interface:TupleFileManagerOpen the specifiedDBFileas aTupleFileof a specific type, containing tuples of data conforming to a specific schema.- Specified by:
openTupleFilein interfaceTupleFileManager- Parameters:
dbFile- the tuple-file to open- Returns:
- a
TupleFileobject that allows tuple operations to be performed against theDBFile.
-
saveMetadata
Description copied from interface:TupleFileManagerWrites the metadata (schema and stats information) for the tuple-file back into the tuple-file. The schema and statistics are represented as separate objects (SchemaandTableStatsobjects, specifically), so of course they need to be serialized into a binary representation for storage when they change.- Specified by:
saveMetadatain interfaceTupleFileManager- Parameters:
tupleFile- the tuple-file whose metadata should be persisted
-
deleteTupleFile
Description copied from interface:TupleFileManagerDelete the specified tuple-file.- Specified by:
deleteTupleFilein interfaceTupleFileManager- Parameters:
tupleFile- the tuple-file to delete
-