Class IndexUpdater

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private IndexManager indexManager
      A cached reference to the index manager since we use it a lot in this class.
      private static org.apache.logging.log4j.Logger logger
      A logging object for reporting anything interesting that happens.
    • Field Detail

      • logger

        private static org.apache.logging.log4j.Logger logger
        A logging object for reporting anything interesting that happens.
      • indexManager

        private IndexManager indexManager
        A cached reference to the index manager since we use it a lot in this class.
    • Constructor Detail

      • IndexUpdater

        public IndexUpdater​(StorageManager storageManager)
    • Method Detail

      • beforeRowInserted

        public void beforeRowInserted​(TableInfo tblFileInfo,
                                      Tuple newValues)
        Description copied from interface: RowEventListener
        Perform processing before a row is inserted into a table.
        Specified by:
        beforeRowInserted in interface RowEventListener
        Parameters:
        tblFileInfo - the table that the tuple will be inserted into.
        newValues - the new values that will be inserted into the table.
      • afterRowInserted

        public void afterRowInserted​(TableInfo tblFileInfo,
                                     Tuple newTuple)
        Description copied from interface: RowEventListener
        Perform processing after a row is inserted into a table.
        Specified by:
        afterRowInserted in interface RowEventListener
        Parameters:
        tblFileInfo - the table that the tuple was inserted into.
        newTuple - the new tuple that was inserted into the table.
      • beforeRowUpdated

        public void beforeRowUpdated​(TableInfo tblFileInfo,
                                     Tuple oldTuple,
                                     Tuple newValues)
        Description copied from interface: RowEventListener
        Perform processing before a row is updated in a table.
        Specified by:
        beforeRowUpdated in interface RowEventListener
        Parameters:
        tblFileInfo - the table that the tuple will be updated in.
        oldTuple - the old tuple in the table that is about to be updated.
        newValues - the new values that the tuple will be updated to.
      • afterRowUpdated

        public void afterRowUpdated​(TableInfo tblFileInfo,
                                    Tuple oldValues,
                                    Tuple newTuple)
        Description copied from interface: RowEventListener
        Perform processing after a row is updated in a table.
        Specified by:
        afterRowUpdated in interface RowEventListener
        Parameters:
        tblFileInfo - the table that the tuple was updated in.
        oldValues - the old values that were in the tuple before it was updated.
        newTuple - the new tuple in the table that was updated.
      • beforeRowDeleted

        public void beforeRowDeleted​(TableInfo tblFileInfo,
                                     Tuple oldTuple)
        Description copied from interface: RowEventListener
        Perform processing after a row has been deleted from a table.
        Specified by:
        beforeRowDeleted in interface RowEventListener
        Parameters:
        tblFileInfo - the table that the tuple will be deleted from.
        oldTuple - the old tuple in the table that is about to be deleted.
      • afterRowDeleted

        public void afterRowDeleted​(TableInfo tblFileInfo,
                                    Tuple oldValues)
        Description copied from interface: RowEventListener
        Perform processing after a row has been deleted from a table.
        Specified by:
        afterRowDeleted in interface RowEventListener
        Parameters:
        tblFileInfo - the table that the tuple was deleted from.
        oldValues - the old values that were in the tuple before it was deleted.
      • addRowToIndexes

        private void addRowToIndexes​(TableInfo tblFileInfo,
                                     PageTuple ptup)
        This helper method handles the case when a tuple is being added to the table, after the row has already been added to the table. All indexes on the table are updated to include the new row.
        Parameters:
        tblFileInfo - details of the table being updated
        ptup - the new tuple that was inserted into the table
      • removeRowFromIndexes

        private void removeRowFromIndexes​(TableInfo tableInfo,
                                          PageTuple ptup)
        This helper method handles the case when a tuple is being removed from the table, before the row has actually been removed from the table. All indexes on the table are updated to remove the row.
        Parameters:
        tableInfo - details of the table being updated
        ptup - the tuple about to be removed from the table