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 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 the DBFileType 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 specified DBFile to be a new empty table with the specified schema.
      Parameters:
      dbFile - the file to use for the new tuple-file
      schema - the schema of the table data to store in the file
      Returns:
      a TupleFile object that allows tuple operations to be performed against the DBFile.
    • openTupleFile

      TupleFile openTupleFile(DBFile dbFile)
      Open the specified DBFile as a TupleFile 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 the DBFile.
    • 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 and TableStats 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