Class HeapTupleFileManager
- java.lang.Object
-
- edu.caltech.nanodb.storage.heapfile.HeapTupleFileManager
-
- All Implemented Interfaces:
TupleFileManager
public class HeapTupleFileManager extends java.lang.Object implements TupleFileManager
This class provides high-level operations on heap tuple files.
-
-
Field Summary
Fields Modifier and Type Field Description private static org.apache.logging.log4j.Logger
logger
A logging object for reporting anything interesting that happens.private StorageManager
storageManager
A reference to the storage manager.
-
Constructor Summary
Constructors Constructor Description HeapTupleFileManager(StorageManager storageManager)
-
Method Summary
All Methods Instance Methods Concrete 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.
-
-
-
Field Detail
-
logger
private static org.apache.logging.log4j.Logger logger
A logging object for reporting anything interesting that happens.
-
storageManager
private StorageManager storageManager
A reference to the storage manager.
-
-
Constructor Detail
-
HeapTupleFileManager
public HeapTupleFileManager(StorageManager storageManager)
-
-
Method Detail
-
getDBFileType
public DBFileType getDBFileType()
Description copied from interface:TupleFileManager
Returns theDBFileType
value used to indicate this storage format in data files.- Specified by:
getDBFileType
in interfaceTupleFileManager
- Returns:
- the
DBFileType
value used to indicate this storage format in data files.
-
getShortName
public java.lang.String getShortName()
Description copied from interface:TupleFileManager
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.- Specified by:
getShortName
in interfaceTupleFileManager
- Returns:
- the "short name" used to refer to this storage-file type.
-
createTupleFile
public TupleFile createTupleFile(DBFile dbFile, Schema schema)
Description copied from interface:TupleFileManager
Initialize the specifiedDBFile
to be a new empty table with the specified schema.- Specified by:
createTupleFile
in 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
TupleFile
object that allows tuple operations to be performed against theDBFile
.
-
openTupleFile
public TupleFile openTupleFile(DBFile dbFile)
Description copied from interface:TupleFileManager
Open the specifiedDBFile
as aTupleFile
of a specific type, containing tuples of data conforming to a specific schema.- Specified by:
openTupleFile
in interfaceTupleFileManager
- Parameters:
dbFile
- the tuple-file to open- Returns:
- a
TupleFile
object that allows tuple operations to be performed against theDBFile
.
-
saveMetadata
public void saveMetadata(TupleFile tupleFile)
Description copied from interface:TupleFileManager
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.- Specified by:
saveMetadata
in interfaceTupleFileManager
- Parameters:
tupleFile
- the tuple-file whose metadata should be persisted
-
deleteTupleFile
public void deleteTupleFile(TupleFile tupleFile)
Description copied from interface:TupleFileManager
Delete the specified tuple-file.- Specified by:
deleteTupleFile
in interfaceTupleFileManager
- Parameters:
tupleFile
- the tuple-file to delete
-
-