|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsimpledb.Catalog
public class Catalog
The Catalog keeps track of all available tables in the database and their associated schemas. For now, this is a stub catalog that must be populated with tables by a user program before it can be used -- eventually, this should be converted to a catalog that reads a catalog table from disk.
Constructor Summary | |
---|---|
Catalog()
Constructor. |
Method Summary | |
---|---|
void |
addTable(DbFile file,
TupleDesc t)
Add a new table to the catalog. |
void |
addTable(DbFile file,
TupleDesc t,
java.lang.String name)
Add a new table to the catalog. |
void |
clear()
Delete all tables from the catalog |
DbFile |
getDbFile(int tableid)
Returns the DbFile that can be used to read the contents of the specified table. |
int |
getTableId(java.lang.String name)
Return the id of the table with a specified name, |
TupleDesc |
getTupleDesc(int tableid)
Returns the tuple descriptor (schema) of the specified table |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Catalog()
Method Detail |
---|
public void addTable(DbFile file, TupleDesc t, java.lang.String name)
file
- the contents of the table to add; file.id() is the identfier of
this file/tupledesc param for the calls getTupleDesc and getFilet
- the format of tuples that are being addedname
- the name of the table -- may be an empty string. May not be null. If a name
conflict exists, use the last table to be added as the table for a given name.public void addTable(DbFile file, TupleDesc t)
file
- the contents of the table to add; file.id() is the identfier of
this file/tupledesc param for the calls getTupleDesc and getFilet
- the format of tuples that are being addedpublic int getTableId(java.lang.String name)
java.util.NoSuchElementException
- if the table doesn't existpublic TupleDesc getTupleDesc(int tableid) throws java.util.NoSuchElementException
tableid
- The id of the table, as specified by the DbFile.id()
function passed to addTable
java.util.NoSuchElementException
public DbFile getDbFile(int tableid) throws java.util.NoSuchElementException
tableid
- The id of the table, as specified by the DbFile.id()
function passed to addTable
java.util.NoSuchElementException
public void clear()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |