For a description of how deferrable and non-deferrable constraints
are backed differently, including the meaning of the
boolean attributes used here, see org..
| Modifier and Type | Field and Description |
|---|---|
| private ExecutionFactory | |
| private IndexDescriptor |
| Access | Constructor and Description |
|---|---|
| public | IndexRowGenerator(String
The type of index indexType, boolean True means the index is unique isUnique, boolean means the index is almost unique
i.e. unique only for non null keys isUniqueWithDuplicateNulls, boolean True means the index represents a PRIMARY
KEY or a UNIQUE NOT NULL constraint which
is deferrable. isUniqueDeferrable, boolean True if the index is used to back a
deferrable constraint hasDeferrableChecking, int[] An array of column positions in the base
table. Each index column corresponds to a
column position in the base table. baseColumnPositions, boolean[] An array of booleans telling asc/desc on each
column. isAscending, int In the future, it will be possible
to store non-ordered columns in an
index. These will be useful for
covered queries. numberOfOrderedColumns)Constructor for an IndexRowGeneratorImpl |
| public | IndexRowGenerator(IndexDescriptor
An IndexDescriptor to delegate calls to indexDescriptor)Constructor for an IndexRowGeneratorImpl |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public int[] | baseColumnPositions()
Implements org. Returns an array of column positions in the base table. |
| public boolean | Returns: true if this indexrowgenerator has the same value as otherThe other indexrowgenerator to compare this one with other)Overrides java. Test for value equality |
| public int[] | getColumnCollationIds(ColumnDescriptorList
ColumnDescriptors describing the base table. columnList)Return an array of collation ids for this table. |
| private static Context | |
| private ExecutionFactory | |
| public IndexDescriptor | |
| public void | getIndexRow(ExecRow
A row in the base table baseRow, RowLocation The RowLocation of the row in the base table rowLocation, ExecIndexRow A template for the index row. It must have the
correct number of columns. indexRow, FormatableBitSet If non-null, then baseRow is a partial row and the
set bits in bitSet represents the column mapping for
the partial row to the complete base row bitSet)Warning ONE based!!! Get an index row for this index given a row from the base table and the RowLocation of the base row. |
| public ExecIndexRow | Returns: A row template for the index row.Get a template for the index row, to be used with getIndexRow. |
| public int | getKeyColumnPosition(int
Position of column in heap row heapColumnPosition)Implements org. Returns the postion of a column. |
| public ExecIndexRow | getNullIndexRow(ColumnDescriptorList
ColumnDescriptors describing the base table. columnList, RowLocation empty row location. rowLocation)Get a NULL Index Row for this index. |
| public int | getTypeFormatId()
Implements org. Get a universally unique identifier for the type of this object. |
| public boolean | hasDeferrableChecking()
Implements org. Returns true if the index is used to support a deferrable constraint. |
| public int | |
| public String | indexType()
Implements org. Returns the type of the index. |
| public boolean | isAscending(Integer
Key column number keyColumnPosition)Implements org. Returns true if the specified column is ascending in the index (1-based). |
| public boolean[] | isAscending()
Implements org. Returns array of boolean telling asc/desc info for each index key column for convenience of using together with baseColumnPositions method. |
| public boolean | isDescending(Integer
Key column number keyColumnPosition)Implements org. Returns true if the specified column is descending in the index (1-based). |
| public boolean | isUnique()
Implements org. Returns true if the index is unique. |
| public boolean | isUniqueDeferrable()
Implements org. The index represents a PRIMARY KEY or a UNIQUE NOT NULL constraint which is deferrable. |
| public boolean | isUniqueWithDuplicateNulls()
Implements org. Returns true if the index is duplicate keys only for null key parts. |
| public int | numberOfOrderedColumns()
Implements org. Returns the number of ordered columns. |
| public void | readExternal(ObjectInput
the stream to read data from in order to restore the object in)Implements java. The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types and readObject for objects, strings and arrays. |
| public void | setBaseColumnPositions(int[]
Positions of base columns baseColumnPositions)Implements org. set the baseColumnPositions field of the index descriptor. |
| public void | setIsAscending(boolean[]
Set the direction of each column in the key isAscending)Implements org. set the isAscending field of the index descriptor. |
| public void | setNumberOfOrderedColumns(int
Number of ordered columns numberOfOrderedColumns)Implements org. set the numberOfOrderedColumns field of the index descriptor. |
| public String | |
| public void | writeExternal(ObjectOutput
the stream to write the object to out)Implements java. The object implements the writeExternal method to save its contents by calling the methods of DataOutput for its primitive values or calling the writeObject method of ObjectOutput for objects, strings, and arrays. |
| ef | back to summary |
|---|---|
| private ExecutionFactory ef | |
| id | back to summary |
|---|---|
| private IndexDescriptor id | |
| IndexRowGenerator | back to summary |
|---|---|
| public IndexRowGenerator(String indexType, boolean isUnique, boolean isUniqueWithDuplicateNulls, boolean isUniqueDeferrable, boolean hasDeferrableChecking, int[] baseColumnPositions, boolean[] isAscending, int numberOfOrderedColumns) Constructor for an IndexRowGeneratorImpl
| |
| IndexRowGenerator | back to summary |
|---|---|
| public IndexRowGenerator(IndexDescriptor indexDescriptor) Constructor for an IndexRowGeneratorImpl
| |
| IndexRowGenerator | back to summary |
|---|---|
| public IndexRowGenerator() Zero-argument constructor for Formatable interface | |
| baseColumnPositions | back to summary |
|---|---|
| public int[] baseColumnPositions() Implements org. Doc from org. Returns an array of column positions in the base table. Each index column corresponds to a column position in the base table, except the column representing the location of the row in the base table. The returned array holds the column positions in the base table, so, if entry 2 is the number 4, the second column in the index is the fourth column in the table.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object other) Overrides java. Test for value equality
| |
| getColumnCollationIds | back to summary |
|---|---|
| public int[] getColumnCollationIds(ColumnDescriptorList columnList) throws StandardException Return an array of collation ids for this table. Return an array of collation ids, one for each column in the columnDescriptorList. This is useful for passing collation id info down to store, for instance in createConglomerate() to create the index. This is only expected to get called during ddl, so object allocation is ok.
| |
| getContext | back to summary |
|---|---|
| private static Context getContext(final String contextID) Must be private so that user code can't call this entry point. | |
| getExecutionFactory | back to summary |
|---|---|
| private ExecutionFactory getExecutionFactory() | |
| getIndexDescriptor | back to summary |
|---|---|
| public IndexDescriptor getIndexDescriptor() Get the IndexDescriptor that this IndexRowGenerator is based on. | |
| getIndexRow | back to summary |
|---|---|
| public void getIndexRow(ExecRow baseRow, RowLocation rowLocation, ExecIndexRow indexRow, FormatableBitSet bitSet) throws StandardException Get an index row for this index given a row from the base table and the RowLocation of the base row. This method can be used to get the new index row for inserts, and the old and new index rows for deletes and updates. For updates, the result row has all the old column values followed by all of the new column values, so you must form a row using the new column values to pass to this method to get the new index row.
| |
| getIndexRowTemplate | back to summary |
|---|---|
| public ExecIndexRow getIndexRowTemplate() Get a template for the index row, to be used with getIndexRow.
| |
| getKeyColumnPosition | back to summary |
|---|---|
| public int getKeyColumnPosition(int heapColumnPosition) Implements org. Doc from org. Returns the postion of a column. Returns the position of a column within the key (1-based). 0 means that the column is not in the key. Same as the above method, but it uses int instead of Integer.
| |
| getNullIndexRow | back to summary |
|---|---|
| public ExecIndexRow getNullIndexRow(ColumnDescriptorList columnList, RowLocation rowLocation) throws StandardException Get a NULL Index Row for this index. This is useful to create objects that need to be passed to ScanController.
| |
| getTypeFormatId | back to summary |
|---|---|
| public int getTypeFormatId() Implements org. Doc from org. Get a universally unique identifier for the type of this object.
| |
| hasDeferrableChecking | back to summary |
|---|---|
| public boolean hasDeferrableChecking() Implements org. Doc from org. Returns true if the index is used to support a deferrable constraint.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| indexType | back to summary |
|---|---|
| public String indexType() Implements org. Doc from org. Returns the type of the index. For now, we only support B-Trees, so the value "BTREE" is returned.
| |
| isAscending | back to summary |
|---|---|
| public boolean isAscending(Integer keyColumnPosition) Implements org. Doc from org. Returns true if the specified column is ascending in the index (1-based).
| |
| isAscending | back to summary |
|---|---|
| public boolean[] isAscending() Implements org. Doc from org. Returns array of boolean telling asc/desc info for each index key column for convenience of using together with baseColumnPositions method. Both methods return an array with subscript starting from 0.
| |
| isDescending | back to summary |
|---|---|
| public boolean isDescending(Integer keyColumnPosition) Implements org. Doc from org. Returns true if the specified column is descending in the index (1-based). In the current release, only ascending columns are supported.
| |
| isUnique | back to summary |
|---|---|
| public boolean isUnique() Implements org. Doc from org. Returns true if the index is unique.
| |
| isUniqueDeferrable | back to summary |
|---|---|
| public boolean isUniqueDeferrable() Implements org. Doc from org. The index represents a PRIMARY KEY or a UNIQUE NOT NULL constraint which
is deferrable.
| |
| isUniqueWithDuplicateNulls | back to summary |
|---|---|
| public boolean isUniqueWithDuplicateNulls() Implements org. Doc from org. Returns true if the index is duplicate keys only for null key parts. This is effective only if isUnique is false.
| |
| numberOfOrderedColumns | back to summary |
|---|---|
| public int numberOfOrderedColumns() Implements org. Doc from org. Returns the number of ordered columns. In the future, it will be possible to store non-ordered columns in an index. These will be useful for covered queries. The ordered columns will be at the beginning of the index row, and they will be followed by the non-ordered columns. For now, all columns in an index must be ordered.
| |
| readExternal | back to summary |
|---|---|
| public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException Implements java. Doc from java. The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types and readObject for objects, strings and arrays. The readExternal method must read the values in the same sequence and with the same types as were written by writeExternal.
| |
| setBaseColumnPositions | back to summary |
|---|---|
| public void setBaseColumnPositions(int[] baseColumnPositions) Implements org. Doc from org. set the baseColumnPositions field of the index descriptor. This is for updating the field in operations such as "alter table drop column" where baseColumnPositions is changed.
| |
| setIsAscending | back to summary |
|---|---|
| public void setIsAscending(boolean[] isAscending) Implements org. Doc from org. set the isAscending field of the index descriptor. This is for updating the field in operations such as "alter table drop column" where isAscending is changed.
| |
| setNumberOfOrderedColumns | back to summary |
|---|---|
| public void setNumberOfOrderedColumns(int numberOfOrderedColumns) Implements org. Doc from org. set the numberOfOrderedColumns field of the index descriptor. This is for updating the field in operations such as "alter table drop column" where numberOfOrderedColumns is changed.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
| |
| writeExternal | back to summary |
|---|---|
| public void writeExternal(ObjectOutput out) throws IOException Implements java. Doc from java. The object implements the writeExternal method to save its contents by calling the methods of DataOutput for its primitive values or calling the writeObject method of ObjectOutput for objects, strings, and arrays.
| |