Class TabInfoImpl


  • class TabInfoImpl
    extends java.lang.Object
    A poor mans structure used in DataDictionaryImpl.java. Used to save heapId, name pairs for non core tables.
    • Field Detail

      • ROWNOTDUPLICATE

        static final int ROWNOTDUPLICATE
        ROWNOTDUPLICATE is out of range for a row number. If a return code does not equal this value, then it refers to the row that is a duplicate.
        See Also:
        Constant Field Values
      • heapConglomerate

        private long heapConglomerate
      • numIndexesSet

        private int numIndexesSet
      • heapSet

        private boolean heapSet
      • computedStreamStorableHeapColIds

        private boolean computedStreamStorableHeapColIds
      • streamStorableHeapColIds

        private int[] streamStorableHeapColIds
    • Constructor Detail

      • TabInfoImpl

        TabInfoImpl​(CatalogRowFactory crf)
        Constructor
        Parameters:
        crf - the associated CatalogRowFactory
    • Method Detail

      • getHeapConglomerate

        long getHeapConglomerate()
        Get the conglomerate for the heap.
        Returns:
        long The conglomerate for the heap.
      • setHeapConglomerate

        void setHeapConglomerate​(long heapConglomerate)
        Set the heap conglomerate for this.
        Parameters:
        heapConglomerate - The new heap conglomerate.
      • getIndexConglomerate

        long getIndexConglomerate​(int indexID)
        Get the conglomerate for the specified index.
        Returns:
        long The conglomerate for the specified index.
      • setIndexConglomerate

        void setIndexConglomerate​(int index,
                                  long indexConglomerate)
        Set the index conglomerate for the table.
        Parameters:
        index - Index number for index for table
        indexConglomerate - The conglomerate for that index
      • setIndexConglomerate

        void setIndexConglomerate​(ConglomerateDescriptor cd)
        Set the index conglomerate for the table.
        Parameters:
        cd - The ConglomerateDescriptor for one of the index for this table.
      • getTableName

        java.lang.String getTableName()
        Get the table name.
        Returns:
        String The table name.
      • getIndexName

        java.lang.String getIndexName​(int indexId)
        Get the index name.
        Parameters:
        indexId - Index number for index for table
        Returns:
        String The index name.
      • getCatalogRowFactory

        CatalogRowFactory getCatalogRowFactory()
        Get the CatalogRowFactory for this.
        Returns:
        CatalogRowFactory The CatalogRowFactory for this.
      • isComplete

        boolean isComplete()
        Is this fully initialized. (i.e., is all conglomerate info initialized)
        Returns:
        boolean Whether or not this is fully initialized.
      • getIndexColumnCount

        int getIndexColumnCount​(int indexNumber)
        Get the column count for the specified index number.
        Parameters:
        indexNumber - The index number.
        Returns:
        int The column count for the specified index.
      • getIndexRowGenerator

        IndexRowGenerator getIndexRowGenerator​(int indexNumber)
        Get the IndexRowGenerator for the specified index number.
        Parameters:
        indexNumber - The index number.
        Returns:
        IndexRowGenerator The IRG for the specified index number.
      • setIndexRowGenerator

        void setIndexRowGenerator​(int indexNumber,
                                  IndexRowGenerator irg)
        Set the IndexRowGenerator for the specified index number.
        Parameters:
        indexNumber - The index number.
        irg - The IndexRowGenerator for the specified index number.
      • getNumberOfIndexes

        int getNumberOfIndexes()
        Get the number of indexes on this catalog.
        Returns:
        int The number of indexes on this catalog.
      • getBaseColumnPosition

        int getBaseColumnPosition​(int indexNumber,
                                  int colNumber)
        Get the base column position for a column within a catalog given the (0-based) index number for this catalog and the (0-based) column number for the column within the index.
        Parameters:
        indexNumber - The index number
        colNumber - The column number within the index
        Returns:
        int The base column position for the column.
      • isIndexUnique

        boolean isIndexUnique​(int indexNumber)
        Return whether or not this index is declared unique
        Parameters:
        indexNumber - The index number
        Returns:
        boolean Whether or not this index is declared unique
      • insertRow

        int insertRow​(ExecRow row,
                      TransactionController tc)
               throws StandardException
        Inserts a base row into a catalog and inserts all the corresponding index rows.
        Parameters:
        row - row to insert
        tc - transaction
        Returns:
        row number (>= 0) if duplicate row inserted into an index ROWNOTDUPLICATE otherwise
        Throws:
        StandardException - Thrown on failure
      • insertRowList

        int insertRowList​(ExecRow[] rowList,
                          TransactionController tc)
                   throws StandardException
        Inserts a list of base rows into a catalog and inserts all the corresponding index rows.
        Parameters:
        rowList - List of rows to insert
        tc - transaction controller
        Returns:
        row number (>= 0) if duplicate row inserted into an index ROWNOTDUPLICATE otherwise
        Throws:
        StandardException - Thrown on failure
      • insertRowListImpl

        private int insertRowListImpl​(ExecRow[] rowList,
                                      TransactionController tc,
                                      RowLocation[] rowLocationOut)
                               throws StandardException
        Insert logic to insert a list of rows into a table. This logic has two odd features.
        1. Returns an indication if any returned row was a duplicate.
        2. Returns the RowLocation of the last row inserted.
        Parameters:
        rowList - the list of rows to insert
        tc - transaction controller
        rowLocationOut - on output rowLocationOut[0] is set to the last RowLocation inserted.
        Returns:
        row number (>= 0) if duplicate row inserted into an index ROWNOTDUPLICATE otherwise
        Throws:
        StandardException
      • deleteRow

        int deleteRow​(TransactionController tc,
                      ExecIndexRow key,
                      int indexNumber)
               throws StandardException
        Given a key row, delete all matching heap rows and their index rows.

        LOCKING: row locking if there is a key; otherwise, table locking.

        Parameters:
        tc - transaction controller
        key - key to delete by.
        indexNumber - Key is appropriate for this index.
        Returns:
        the number of rows deleted. If key is not unique, this may be more than one.
        Throws:
        StandardException - Thrown on failure
      • updateRow

        void updateRow​(ExecIndexRow key,
                       ExecRow newRow,
                       int indexNumber,
                       boolean[] indicesToUpdate,
                       int[] colsToUpdate,
                       TransactionController tc)
                throws StandardException
        Updates a base row in a catalog and updates all the corresponding index rows.
        Parameters:
        key - key row
        newRow - new version of the row
        indexNumber - index that key operates
        indicesToUpdate - array of booleans, one for each index on the catalog. if a boolean is true, that means we must update the corresponding index because changes in the newRow affect it.
        colsToUpdate - array of ints indicating which columns (1 based) to update. If null, do all.
        tc - transaction controller
        Throws:
        StandardException - Thrown on failure
      • updateRow

        void updateRow​(ExecIndexRow key,
                       ExecRow[] newRows,
                       int indexNumber,
                       boolean[] indicesToUpdate,
                       int[] colsToUpdate,
                       TransactionController tc)
                throws StandardException
        Updates a set of base rows in a catalog with the same key on an index and updates all the corresponding index rows.
        Parameters:
        key - key row
        newRows - new version of the array of rows
        indexNumber - index that key operates
        indicesToUpdate - array of booleans, one for each index on the catalog. if a boolean is true, that means we must update the corresponding index because changes in the newRow affect it.
        colsToUpdate - array of ints indicating which columns (1 based) to update. If null, do all.
        tc - transaction controller
        Throws:
        StandardException - Thrown on failure
      • getCreateHeapProperties

        java.util.Properties getCreateHeapProperties()
        Get the Properties associated with creating the heap.
        Returns:
        The Properties associated with creating the heap.
      • getCreateIndexProperties

        java.util.Properties getCreateIndexProperties​(int indexNumber)
        Get the Properties associated with creating the specified index.
        Parameters:
        indexNumber - The specified index number.
        Returns:
        The Properties associated with creating the specified index.
      • getRowChanger

        private RowChanger getRowChanger​(TransactionController tc,
                                         int[] changedCols,
                                         ExecRow baseRow)
                                  throws StandardException
        Gets a row changer for this catalog.
        Parameters:
        tc - transaction controller
        changedCols - the columns to change (1 based), may be null
        baseRow - used to detemine column types at creation time only. The row changer does ***Not*** keep a referance to this row or change it in any way.
        Returns:
        a row changer for this catalog.
        Throws:
        StandardException - Thrown on failure
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object