Properties properties,
int temporaryFlag)
throws StandardException
{
String property_value = null;
Transaction rawtran = xact_manager.getRawStoreXact();
if (properties == null)
{
throw(StandardException.newException(
SQLState.BTREE_PROPERTY_NOT_FOUND, PROPERTY_BASECONGLOMID));
}
// Get baseConglomerateId //
property_value = properties.getProperty(PROPERTY_BASECONGLOMID);
if (property_value == null)
{
throw(StandardException.newException(
SQLState.BTREE_PROPERTY_NOT_FOUND, PROPERTY_BASECONGLOMID));
}
if (SanityManager.DEBUG)
{
if (property_value == null)
SanityManager.THROWASSERT(
PROPERTY_BASECONGLOMID +
"property not passed to B2I.create()");
}
baseConglomerateId = Long.parseLong(property_value);
// Get rowLocationColumn //
property_value = properties.getProperty(PROPERTY_ROWLOCCOLUMN);
if (SanityManager.DEBUG)
{
if (property_value == null)
SanityManager.THROWASSERT(
PROPERTY_ROWLOCCOLUMN +
"property not passed to B2I.create()");
}
if (property_value == null)
{
throw(StandardException.newException(
SQLState.BTREE_PROPERTY_NOT_FOUND, PROPERTY_BASECONGLOMID));
}
rowLocationColumn = Integer.parseInt(property_value);
// Currently the row location column must be the last column (makes)
// comparing the columns in the index easier.
if (SanityManager.DEBUG)
{
SanityManager.ASSERT(rowLocationColumn == template.length - 1,
"rowLocationColumn is not the last column in the index");
SanityManager.ASSERT(
template[rowLocationColumn] instanceof
RowLocation);
// There must be at least one key column
if (rowLocationColumn < 1)
SanityManager.THROWASSERT(
"rowLocationColumn (" + rowLocationColumn +
") expected to be >= 1");
}
/* convert the sorting order information into a boolean array map.
* If the sorting order for the columns is not provided, we
* assign the default as Ascending Order.
* array length is equal to template length, because column order
* length changes whether it is unique or is non unique. store assumes
* template length arrays. So, we make template length array and make
* the last column as ascending instead of having lot of execeptions
* code.
*/
ascDescInfo = new boolean[template.length];
for (int i=0 ; i < ascDescInfo.length; i++)
{
if (columnOrder != null && i < columnOrder.length)
ascDescInfo[i] = columnOrder[i].getIsAscending();
else
ascDescInfo[i] = true; // default values - ascending order
}
// get collation ids from input collation ids, store it in the
// conglom state.
collation_ids =
ConglomerateUtil.createCollationIds(template.length, collationIds);
// Do the generic part of creating the b-tree.
super.create(
rawtran, segmentId, input_conglomid, template,
properties, getTypeFormatId(), temporaryFlag);
// open the base conglomerate - to get the lock
ConglomerateController base_cc =
xact_manager.openConglomerate(
baseConglomerateId,
false,
TransactionController.OPENMODE_FOR_LOCK_ONLY,
TransactionController.MODE_TABLE,
TransactionController.ISOLATION_SERIALIZABLE);
OpenBTree open_btree = new OpenBTree();
BTreeLockingPolicy b2i_locking_policy =
new B2ITableLocking3(
rawtran,
TransactionController.MODE_TABLE,
rawtran.newLockingPolicy(
LockingPolicy.MODE_CONTAINER,
TransactionController.ISOLATION_SERIALIZABLE, true),
base_cc, open_btree);