public class T_SecondaryIndexRow
extends java.lang.Object
This class creates a new DataValueDescriptor array which will be the row used to insert into the secondary index. The fields of this object array are made up of references to DataValueDescriptors provided by the caller: the DataValueDescriptors in the template and a RowLocation. The interface is designed to support the standard access method interface where callers provide a single template and then read rows into that template over and over. This class keeps a reference to the objects in the template and the rowlocation, so the state of this object changes whenever the caller changes the template. The caller provides a template which will contain a heap row, and a RowLocation which provides the location of the row within the heap table.
So for example to create an index from a base table by reading the base table and inserting each row one at a time into the secondary index you would do something like: DataValueDescriptors[] template = get_template_for_base_table(); RowLocation rowloc = ScanController_var.newRowLocationTemplate(); T_SecondaryIndexRow indrow = new T_SecondaryIndexRow(); indrow.init(template, rowloc, numcols_in_index); while (ScanController_variable.next()) { fetch(template) fetchLocation(rowloc) ConglomerateController_on_btree.insert(indrow.getRow()); }
Modifier and Type | Field and Description |
---|---|
(package private) org.apache.derby.iapi.types.RowLocation |
init_rowlocation |
(package private) org.apache.derby.iapi.types.DataValueDescriptor[] |
row |
Constructor and Description |
---|
T_SecondaryIndexRow() |
Modifier and Type | Method and Description |
---|---|
org.apache.derby.iapi.types.DataValueDescriptor[] |
getRow()
Return the secondary index row.
|
void |
init(org.apache.derby.iapi.types.DataValueDescriptor[] template,
org.apache.derby.iapi.types.RowLocation rowlocation,
int numkeys)
Initialize the class.
|
java.lang.String |
toString() |
org.apache.derby.iapi.types.DataValueDescriptor[] row
org.apache.derby.iapi.types.RowLocation init_rowlocation
public void init(org.apache.derby.iapi.types.DataValueDescriptor[] template, org.apache.derby.iapi.types.RowLocation rowlocation, int numkeys) throws org.apache.derby.iapi.error.StandardException
Save away pointers to the base table template row, and the rowlocation class. Build default map of base columns to key columns, this map can be changed with setMap().
template
- The template for the base table row.rowlocation
- The template for the row location.numkeys
- The total number of columns in the secondary index
including the rowlocation column.org.apache.derby.iapi.error.StandardException
- Standard exception policy.public org.apache.derby.iapi.types.DataValueDescriptor[] getRow()
Return the DataValueDescriptor array that represents the branch row, for use in raw store calls to fetch, insert, and update.
public java.lang.String toString()
toString
in class java.lang.Object
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.