Package edu.caltech.nanodb.storage
Interface TupleFileManager
-
- All Known Implementing Classes:
HeapTupleFileManager
public interface TupleFileManager
This interface defines the operations that can be performed onTupleFile
s, 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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description TupleFile
createTupleFile(DBFile dbFile, Schema schema)
Initialize the specifiedDBFile
to be a new empty table with the specified schema.void
deleteTupleFile(TupleFile tupleFile)
Delete the specified tuple-file.DBFileType
getDBFileType()
Returns theDBFileType
value used to indicate this storage format in data files.java.lang.String
getShortName()
Returns the "short name" used to refer to this storage-file type.TupleFile
openTupleFile(DBFile dbFile)
Open the specifiedDBFile
as aTupleFile
of a specific type, containing tuples of data conforming to a specific schema.void
saveMetadata(TupleFile tupleFile)
Writes the metadata (schema and stats information) for the tuple-file back into the tuple-file.
-
-
-
Method Detail
-
getShortName
java.lang.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 theDBFileType
value used to indicate this storage format in data files.- Returns:
- the
DBFileType
value used to indicate this storage format in data files.
-
createTupleFile
TupleFile createTupleFile(DBFile dbFile, Schema schema)
Initialize the specifiedDBFile
to 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
TupleFile
object that allows tuple operations to be performed against theDBFile
.
-
openTupleFile
TupleFile openTupleFile(DBFile dbFile)
Open the specifiedDBFile
as aTupleFile
of a specific type, containing tuples of data conforming to a specific schema.- Parameters:
dbFile
- the tuple-file to open- Returns:
- a
TupleFile
object that allows tuple operations to be performed against theDBFile
.
-
saveMetadata
void saveMetadata(TupleFile tupleFile)
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 (Schema
andTableStats
objects, 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
void deleteTupleFile(TupleFile tupleFile)
Delete the specified tuple-file.- Parameters:
tupleFile
- the tuple-file to delete
-
-