Package edu.caltech.nanodb.indexes
Class IndexInfo
- java.lang.Object
-
- edu.caltech.nanodb.indexes.IndexInfo
-
public class IndexInfo extends java.lang.Object
This class is used to hold information about a single index in the database. An index is simply a tuple file built against another tuple file, so this class holds information similar to aTableInfo
object, but with an additional specification of the mapping from the table's schema to the index's schema.
-
-
Field Summary
Fields Modifier and Type Field Description private IndexColumnRefs
indexColRefs
The indexes of the columns in the table that the index is built against.private TableInfo
tableInfo
The details of the table that the index is built against.private TupleFile
tupleFile
The tuple file that stores the index's data.
-
Constructor Summary
Constructors Constructor Description IndexInfo(TableInfo tableInfo, IndexColumnRefs indexColRefs)
Construct an index file information object for the specified index name.IndexInfo(TableInfo tableInfo, IndexColumnRefs indexColRefs, TupleFile tupleFile)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IndexColumnRefs
getColumnRefs()
java.lang.String
getIndexName()
Returns the index name.Schema
getSchema()
TableInfo
getTableInfo()
java.lang.String
getTableName()
Returns the name of the table that the index is built against.TupleFile
getTupleFile()
Returns the tuple file that holds this index's data.private void
initIndexDetails(Schema schema, java.lang.String indexName)
void
setIndexName(java.lang.String indexName)
void
setTupleFile(TupleFile tupleFile)
-
-
-
Field Detail
-
tableInfo
private TableInfo tableInfo
The details of the table that the index is built against.
-
indexColRefs
private IndexColumnRefs indexColRefs
The indexes of the columns in the table that the index is built against.
-
tupleFile
private TupleFile tupleFile
The tuple file that stores the index's data.
-
-
Constructor Detail
-
IndexInfo
public IndexInfo(TableInfo tableInfo, IndexColumnRefs indexColRefs, TupleFile tupleFile)
-
IndexInfo
public IndexInfo(TableInfo tableInfo, IndexColumnRefs indexColRefs)
Construct an index file information object for the specified index name. This constructor is used by the CREATE TABLE command to hold the table's schema, before the table has actually been created. After the table is created, thesetTupleFile(edu.caltech.nanodb.storage.TupleFile)
method is used to store the database-file object onto this object.- Parameters:
tableInfo
- details of the table that the index is built against
-
-
Method Detail
-
initIndexDetails
private void initIndexDetails(Schema schema, java.lang.String indexName)
- Parameters:
schema
- the table-schema object for the table that the index is defined on.indexName
- the unique name of the index.
-
getTableInfo
public TableInfo getTableInfo()
-
getTupleFile
public TupleFile getTupleFile()
Returns the tuple file that holds this index's data.- Returns:
- the tuple file that holds this index's data.
-
setTupleFile
public void setTupleFile(TupleFile tupleFile)
-
getSchema
public Schema getSchema()
-
getIndexName
public java.lang.String getIndexName()
Returns the index name.- Returns:
- the index name
-
setIndexName
public void setIndexName(java.lang.String indexName)
-
getTableName
public java.lang.String getTableName()
Returns the name of the table that the index is built against.- Returns:
- the name of the table that the index is built against.
-
getColumnRefs
public IndexColumnRefs getColumnRefs()
-
-