simpledb.metadata
Class IndexMgr

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

public class IndexMgr
extends Object

The index manager. The index manager has similar functionalty to the table manager.

Author:
Edward Sciore

Constructor Summary
IndexMgr(boolean isnew, TableMgr tblmgr, Transaction tx)
          Creates the index manager.
 
Method Summary
 void createIndex(String idxname, String tblname, String fldname, Transaction tx)
          Creates an index of the specified type for the specified field.
 Map<String,IndexInfo> getIndexInfo(String tblname, Transaction tx)
          Returns a map containing the index info for all indexes on the specified table.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IndexMgr

public IndexMgr(boolean isnew,
                TableMgr tblmgr,
                Transaction tx)
Creates the index manager. This constructor is called during system startup. If the database is new, then the idxcat table is created.

Parameters:
isnew - indicates whether this is a new database
tx - the system startup transaction
Method Detail

createIndex

public void createIndex(String idxname,
                        String tblname,
                        String fldname,
                        Transaction tx)
Creates an index of the specified type for the specified field. A unique ID is assigned to this index, and its information is stored in the idxcat table.

Parameters:
idxname - the name of the index
tblname - the name of the indexed table
fldname - the name of the indexed field
tx - the calling transaction

getIndexInfo

public Map<String,IndexInfo> getIndexInfo(String tblname,
                                          Transaction tx)
Returns a map containing the index info for all indexes on the specified table.

Parameters:
tblname - the name of the table
tx - the calling transaction
Returns:
a map of IndexInfo objects, keyed by their field names


Copyright © 2011. All Rights Reserved.