public class RelationIOManager
extends java.lang.Object
| Constructor and Description |
|---|
RelationIOManager(StorageManager sm,
Relation relation,
java.lang.String filename)
Constructs a new relation I/O manager.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getFileName()
The name of the file for this manager.
|
void |
insertTuple(java.util.List<java.lang.Comparable> values)
Inserts a new tuple specified as a list of comparable values
into this relation.
|
void |
insertTuple(Tuple tuple)
Inserts a new tuple into this relation.
|
void |
insertTuple(Tuple tuple,
boolean newID)
Inserts a new tuple into this relation.
|
static void |
main(java.lang.String[] args)
Debug main.
|
java.lang.Iterable<Page> |
pages()
Opens a page iterator over this relation.
|
java.lang.Iterable<Tuple> |
tuples()
Opens a tuple iterator over this relation.
|
public RelationIOManager(StorageManager sm, Relation relation, java.lang.String filename)
sm - this manager's storage manager.relation - the relation this manager handles I/O for.filename - the name of the file this relation is stored
in.public void insertTuple(Tuple tuple) throws StorageManagerException
tuple - the tuple to be inserted.StorageManagerException - thrown whenever there is an I/O
error.public void insertTuple(java.util.List<java.lang.Comparable> values)
throws StorageManagerException
values - the list of comparables to be inserted.StorageManagerException - thrown whenever there is an I/O
error.public void insertTuple(Tuple tuple, boolean newID) throws StorageManagerException
tuple - the tuple to be inserted.newID - re-assigns the tuple id if set to true.
StorageManagerException - thrown whenever there is an I/O
error.public java.lang.String getFileName()
public java.lang.Iterable<Page> pages() throws java.io.IOException, StorageManagerException
java.io.IOException - whenever the iterator cannot be
instantiated from disk.StorageManagerException - whenever the iterator cannot be
created after the file has been loaded.public java.lang.Iterable<Tuple> tuples() throws java.io.IOException, StorageManagerException
java.io.IOException - whenever the iterator cannot be
instantiated from disk.StorageManagerException - whenever the iterator cannot be
created after the file has been loaded.public static void main(java.lang.String[] args)