Class 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 a TableInfo object, but with an additional specification of the mapping from the table's schema to the index's schema.
    • 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)
        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, the setTupleFile(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.