Interface RowChanger

  • All Known Implementing Classes:
    RowChangerImpl

    public interface RowChanger
    Perform row at a time DML operations of tables and maintain indexes.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void close()
      Close this RowChanger.
      void deleteRow​(ExecRow baseRow, RowLocation baseRowLocation)
      Delete a row from the table and perform associated index maintenance.
      int findSelectedCol​(int selectedCol)
      Return what column no in the input ExecRow (cf nextBaseRow argument to #updateRow) would correspond to selected column, if any.
      void finish()
      Finish processing the changes.
      ConglomerateController getHeapConglomerateController()
      Return the ConglomerateController from this RowChanger.
      RowLocation insertRow​(ExecRow baseRow, boolean getRL)
      Insert a row into the table and perform associated index maintenance.
      void open​(int lockMode)
      Open this RowChanger.
      void open​(int lockMode, boolean wait)
      Open this RowChanger.
      void openForUpdate​(boolean[] fixOnUpdate, int lockMode, boolean wait)
      Open this RowChanger to avoid fixing indexes that do not change during update operations.
      void setIndexNames​(java.lang.String[] indexNames)
      Sets the index names of the tables indices.
      void setRowHolder​(TemporaryRowHolder rowHolder)
      Set the row holder for this changer to use.
      void updateRow​(ExecRow oldBaseRow, ExecRow newBaseRow, RowLocation baseRowLocation)
      Update a row in the table and perform associated index maintenance.
    • Method Detail

      • open

        void open​(int lockMode)
           throws StandardException
        Open this RowChanger.

        Note to avoid the cost of fixing indexes that do not change during update operations use openForUpdate().

        Parameters:
        lockMode - The lock mode to use (row or table, see TransactionController)
        Throws:
        StandardException - thrown on failure to convert
      • setRowHolder

        void setRowHolder​(TemporaryRowHolder rowHolder)
        Set the row holder for this changer to use. If the row holder is set, it wont bother saving copies of rows needed for deferred processing. Also, it will never close the passed in rowHolder.
        Parameters:
        rowHolder - the row holder
      • setIndexNames

        void setIndexNames​(java.lang.String[] indexNames)
        Sets the index names of the tables indices. Used for error reporting.
        Parameters:
        indexNames - Names of all the indices on this table.
      • openForUpdate

        void openForUpdate​(boolean[] fixOnUpdate,
                           int lockMode,
                           boolean wait)
                    throws StandardException
        Open this RowChanger to avoid fixing indexes that do not change during update operations.
        Parameters:
        fixOnUpdate - fixOnUpdat[ix] == true ==> fix index 'ix' on an update operation.
        lockMode - The lock mode to use (row or table, see TransactionController)
        wait - If true, then the caller wants to wait for locks. False will be when we using a nested user xaction - we want to timeout right away if the parent holds the lock. (bug 4821)
        Throws:
        StandardException - thrown on failure to convert
      • insertRow

        RowLocation insertRow​(ExecRow baseRow,
                              boolean getRL)
                       throws StandardException
        Insert a row into the table and perform associated index maintenance.
        Parameters:
        baseRow - the row.
        getRL - return a row location of the inserted row
        Returns:
        row location if requested, else null.
        Throws:
        StandardException - Thrown on error
      • deleteRow

        void deleteRow​(ExecRow baseRow,
                       RowLocation baseRowLocation)
                throws StandardException
        Delete a row from the table and perform associated index maintenance.
        Parameters:
        baseRow - the row.
        baseRowLocation - the row's base conglomerate location
        Throws:
        StandardException - Thrown on error
      • updateRow

        void updateRow​(ExecRow oldBaseRow,
                       ExecRow newBaseRow,
                       RowLocation baseRowLocation)
                throws StandardException
        Update a row in the table and perform associated index maintenance.
        Parameters:
        oldBaseRow - the old image of the row.
        newBaseRow - the new image of the row.
        baseRowLocation - the row's base conglomerate location
        Throws:
        StandardException - Thrown on error
      • finish

        void finish()
             throws StandardException
        Finish processing the changes. This means applying the deferred inserts for updates to unique indexes.
        Throws:
        StandardException - Thrown on error
      • getHeapConglomerateController

        ConglomerateController getHeapConglomerateController()
        Return the ConglomerateController from this RowChanger. This is useful when copying properties from heap to temp conglomerate on insert/update/delete.
        Returns:
        The ConglomerateController from this RowChanger.
      • open

        void open​(int lockMode,
                  boolean wait)
           throws StandardException
        Open this RowChanger.

        Note to avoid the cost of fixing indexes that do not change during update operations use openForUpdate().

        Parameters:
        lockMode - The lock mode to use (row or table, see TransactionController)
        wait - If true, then the caller wants to wait for locks. False will be when we using a nested user xaction - we want to timeout right away if the parent holds the lock.
        Throws:
        StandardException - thrown on failure to convert
      • findSelectedCol

        int findSelectedCol​(int selectedCol)
        Return what column no in the input ExecRow (cf nextBaseRow argument to #updateRow) would correspond to selected column, if any.
        Parameters:
        selectedCol - the column number in the base table of a selected column or -1 (if selected column is not a base table column, e.g. i+4).
        Returns:
        column no, or -1 if not found or not a base column