simpledb.metadata
Class TableMgr

java.lang.Object
  extended by simpledb.metadata.TableMgr

public class TableMgr
extends Object

The table manager. There are methods to create a table, save the metadata in the catalog, and obtain the metadata of a previously-created table.

Author:
Edward Sciore

Field Summary
static int MAX_NAME
          The maximum number of characters in any tablename or fieldname.
 
Constructor Summary
TableMgr(boolean isNew, Transaction tx)
          Creates a new catalog manager for the database system.
 
Method Summary
 void createTable(String tblname, Schema sch, Transaction tx)
          Creates a new table having the specified name and schema.
 TableInfo getTableInfo(String tblname, Transaction tx)
          Retrieves the metadata for the specified table out of the catalog.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_NAME

public static final int MAX_NAME
The maximum number of characters in any tablename or fieldname. Currently, this value is 16.

See Also:
Constant Field Values
Constructor Detail

TableMgr

public TableMgr(boolean isNew,
                Transaction tx)
Creates a new catalog manager for the database system. If the database is new, then the two catalog tables are created.

Parameters:
isNew - has the value true if the database is new
tx - the startup transaction
Method Detail

createTable

public void createTable(String tblname,
                        Schema sch,
                        Transaction tx)
Creates a new table having the specified name and schema.

Parameters:
tblname - the name of the new table
sch - the table's schema
tx - the transaction creating the table

getTableInfo

public TableInfo getTableInfo(String tblname,
                              Transaction tx)
Retrieves the metadata for the specified table out of the catalog.

Parameters:
tblname - the name of the table
tx - the transaction
Returns:
the table's stored metadata


Copyright © 2011. All Rights Reserved.