Package edu.caltech.nanodb.storage
Interface TupleFileManager
- All Known Implementing Classes:
BTreeTupleFileManager,HeapTupleFileManager
public interface TupleFileManager
This interface defines the operations that can be performed on
TupleFiles, but that are at a higher level of implementation than
the tuple file itself. Examples of such operations are creating a new
tuple file on disk, deleting a tuple file from the disk, and so forth.-
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.
-
Method Details
-
getShortName
String getShortName()Returns 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.- Returns:
- the "short name" used to refer to this storage-file type.
-
getDBFileType
DBFileType getDBFileType()Returns theDBFileTypevalue used to indicate this storage format in data files.- Returns:
- the
DBFileTypevalue used to indicate this storage format in data files.
-
createTupleFile
Initialize the specifiedDBFileto be a new empty table with the specified schema.- 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
Open the specifiedDBFileas aTupleFileof a specific type, containing tuples of data conforming to a specific schema.- Parameters:
dbFile- the tuple-file to open- Returns:
- a
TupleFileobject that allows tuple operations to be performed against theDBFile.
-
saveMetadata
Writes 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.- Parameters:
tupleFile- the tuple-file whose metadata should be persisted
-
deleteTupleFile
Delete the specified tuple-file.- Parameters:
tupleFile- the tuple-file to delete
-