java.io.Externalizable, java.io.Serializable, java.lang.Comparable, Formatable, Storable, TypedFormat, Conglomerate, DataValueDescriptor, Orderablepublic class B2I extends BTree
openScan should be called.
| Modifier and Type | Field | Description |
|---|---|---|
private static int |
BASE_MEMORY_USAGE |
|
(package private) long |
baseConglomerateId |
The id of the conglomerate which contains the base table.
|
(package private) static int |
FORMAT_NUMBER |
|
private static java.lang.String |
PROPERTY_BASECONGLOMID |
|
private static java.lang.String |
PROPERTY_ROWLOCCOLUMN |
|
(package private) int |
rowLocationColumn |
The column id (zero-based integer index) of the column which holds the row
location to the base conglomerate.
|
ascDescInfo, collation_ids, conglom_format_id, format_ids, hasCollatedTypes, id, nKeyFields, PROPERTY_ALLOWDUPLICATES, PROPERTY_MAX_ROWS_PER_PAGE_PARAMETER, PROPERTY_NKEYFIELDS, PROPERTY_NUNIQUECOLUMNS, PROPERTY_PARENTLINKS, PROPERTY_UNIQUE_WITH_DUPLICATE_NULLS, ROOTPAGEIDUNKNOWN_LOGICAL_LENGTHORDER_OP_EQUALS, ORDER_OP_GREATEROREQUALS, ORDER_OP_GREATERTHAN, ORDER_OP_LESSOREQUALS, ORDER_OP_LESSTHAN| Constructor | Description |
|---|---|
B2I() |
| Modifier and Type | Method | Description |
|---|---|---|
void |
compressConglomerate(TransactionManager xact_manager,
Transaction rawtran) |
|
void |
create(TransactionManager xact_manager,
int segmentId,
long input_conglomid,
DataValueDescriptor[] template,
ColumnOrdering[] columnOrder,
int[] collationIds,
java.util.Properties properties,
int temporaryFlag) |
Create an empty secondary index b-tree, using the generic b-tree to do the
generic part of the creation process.
|
ScanManager |
defragmentConglomerate(TransactionManager xact_manager,
Transaction rawtran,
boolean hold,
int open_mode,
int lock_level,
LockingPolicy locking_policy,
int isolation_level) |
Open a b-tree compress scan.
|
void |
drop(TransactionManager xact_manager) |
Drop this b-tree secondary index.
|
int |
estimateMemoryUsage() |
Estimate the memory usage in bytes of the data value and the overhead of the class.
|
boolean |
fetchMaxOnBTree(TransactionManager xact_manager,
Transaction rawtran,
long conglomId,
int open_mode,
int lock_level,
LockingPolicy locking_policy,
int isolation_level,
FormatableBitSet scanColumnList,
DataValueDescriptor[] fetchRow) |
Retrieve the maximum value row in an ordered conglomerate.
|
protected BTreeLockingPolicy |
getBtreeLockingPolicy(Transaction rawtran,
int lock_level,
int mode,
int isolation_level,
ConglomerateController base_cc,
OpenBTree open_btree) |
Create a new btree locking policy from scratch.
|
StaticCompiledOpenConglomInfo |
getStaticCompiledConglomInfo(TransactionController xact_manager,
long conglomId) |
Return static information about the conglomerate to be included in a
a compiled plan.
|
int |
getTypeFormatId() |
Return my format identifier.
|
long |
load(TransactionManager xact_manager,
boolean createConglom,
RowLocationRetRowSource rowSource) |
Bulk Load a B-tree secondary index.
|
ConglomerateController |
lockTable(TransactionManager xact_manager,
int open_mode,
int lock_level,
int isolation_level) |
Lock the base table.
|
ConglomerateController |
open(TransactionManager xact_manager,
Transaction rawtran,
boolean hold,
int open_mode,
int lock_level,
LockingPolicy locking_policy,
StaticCompiledOpenConglomInfo static_info,
DynamicCompiledOpenConglomInfo dynamic_info) |
Open a b-tree controller.
|
ScanManager |
openScan(TransactionManager xact_manager,
Transaction rawtran,
boolean hold,
int open_mode,
int lock_level,
LockingPolicy locking_policy,
int isolation_level,
FormatableBitSet scanColumnList,
DataValueDescriptor[] startKeyValue,
int startSearchOperator,
Qualifier[][] qualifier,
DataValueDescriptor[] stopKeyValue,
int stopSearchOperator,
StaticCompiledOpenConglomInfo static_info,
DynamicCompiledOpenConglomInfo dynamic_info) |
Open a b-tree secondary index scan controller.
|
StoreCostController |
openStoreCost(TransactionManager xact_manager,
Transaction rawtran) |
Return an open StoreCostController for the conglomerate.
|
void |
purgeConglomerate(TransactionManager xact_manager,
Transaction rawtran) |
|
void |
readExternal(java.io.ObjectInput in) |
Restore the in-memory representation from the stream.
|
private void |
traverseRight() |
Private methods of B2I, arranged alphabetically.
|
void |
writeExternal(java.io.ObjectOutput out) |
Store the stored representation of the column value in the
stream.
|
void |
writeExternal_v10_2(java.io.ObjectOutput out) |
Store the stored representation of the column value in the
stream.
|
void |
writeExternal_v10_3(java.io.ObjectOutput out) |
Store the stored representation of the column value in the
stream.
|
addColumn, create, createTemplate, getContainerid, getDynamicCompiledConglomInfo, getId, isNull, isTemporary, isUnique, isUniqueWithDuplicateNulls, restoreToNull, setUniqueWithDuplicateNulls, toStringcheckHostVariable, cloneHolder, coalesce, compare, compare, compare, compareTo, dataTypeConversion, equals, equals, flip, getBoolean, getByte, getBytes, getDate, getDouble, getFloat, getInt, getLong, getShort, getStream, getTime, getTimestamp, getTraceString, greaterOrEquals, greaterThan, hasStream, in, invalidFormat, isNotNull, isNullOp, lessOrEquals, lessThan, normalize, notEquals, outOfRange, readExternalFromArray, recycle, setBigDecimal, setInto, setInto, setObjectForCast, setToNull, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, throwLangSetMismatch, typePrecedence, typeToBigDecimalcheckHostVariable, cloneHolder, coalesce, compare, compare, compare, equals, getBoolean, getByte, getBytes, getDate, getDouble, getFloat, getInt, getLong, getShort, getStream, getTime, getTimestamp, getTraceString, greaterOrEquals, greaterThan, hasStream, in, isNotNull, isNullOp, lessOrEquals, lessThan, normalize, notEquals, readExternalFromArray, recycle, setBigDecimal, setInto, setInto, setObjectForCast, setToNull, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, typePrecedence, typeToBigDecimalcloneValue, compare, getLength, getNewNull, getObject, getString, getTypeName, hasCollatedColumns, setFrom, setValueFromResultSetprivate static final java.lang.String PROPERTY_BASECONGLOMID
private static final java.lang.String PROPERTY_ROWLOCCOLUMN
static final int FORMAT_NUMBER
long baseConglomerateId
int rowLocationColumn
private static final int BASE_MEMORY_USAGE
public int estimateMemoryUsage()
DataValueDescriptorprotected BTreeLockingPolicy getBtreeLockingPolicy(Transaction rawtran, int lock_level, int mode, int isolation_level, ConglomerateController base_cc, OpenBTree open_btree) throws StandardException
getBtreeLockingPolicy in class BTreeStandardException - Standard exception policy.public final ConglomerateController lockTable(TransactionManager xact_manager, int open_mode, int lock_level, int isolation_level) throws StandardException
Assumes that segment of the base container is the same as the segment of the btree segment.
RESOLVE - we really want to get the lock without opening the container. raw store will be providing this.
lockTable in class BTreexact_manager - Transaction to associate the lock with.StandardException - Standard exception policy.private void traverseRight()
public void create(TransactionManager xact_manager, int segmentId, long input_conglomid, DataValueDescriptor[] template, ColumnOrdering[] columnOrder, int[] collationIds, java.util.Properties properties, int temporaryFlag) throws StandardException
StandardException - Standard exception policy.BTree.create(org.apache.derby.iapi.store.raw.Transaction, int, long, org.apache.derby.iapi.types.DataValueDescriptor[], java.util.Properties, int, int)public boolean fetchMaxOnBTree(TransactionManager xact_manager, Transaction rawtran, long conglomId, int open_mode, int lock_level, LockingPolicy locking_policy, int isolation_level, FormatableBitSet scanColumnList, DataValueDescriptor[] fetchRow) throws StandardException
Returns true and fetches the rightmost row of an ordered conglomerate into "fetchRow" if there is at least one row in the conglomerate. If there are no rows in the conglomerate it returns false.
Non-ordered conglomerates will not implement this interface, calls will generate a StandardException.
RESOLVE - this interface is temporary, long term equivalent (and more) functionality will be provided by the openBackwardScan() interface.
xact_manager - The TransactionController under which this
operation takes place.conglomId - The identifier of the conglomerate
to open the scan for.open_mode - Specifiy flags to control opening of table.
OPENMODE_FORUPDATE - if set open the table for
update otherwise open table shared.lock_level - One of (MODE_TABLE, MODE_RECORD, or MODE_NONE).isolation_level - The isolation level to lock the conglomerate at.
One of (ISOLATION_READ_COMMITTED or
ISOLATION_SERIALIZABLE).scanColumnList - A description of which columns to return from
every fetch in the scan. template,
and scanColumnList work together
to describe the row to be returned by the scan -
see RowUtil for description of how these three
parameters work together to describe a "row".fetchRow - The row to retrieve the maximum value into.rawtran - The raw store xact to associate all ops with.locking_policy - The LockingPolicy to use to open the conglomerate.StandardException - Standard exception policy.public long load(TransactionManager xact_manager, boolean createConglom, RowLocationRetRowSource rowSource) throws StandardException
load in interface Conglomerateload in class BTreexact_manager - The TransactionController under which this operation
takes place.createConglom - If true, the conglomerate is being created in the
same operation as the openAndLoadConglomerate.
The enables further optimization as recovery does
not require page allocation to be logged.rowSource - Where the rows come from.StandardException - Standard Derby Error policy.
raise SQLState.STORE_CONGLOMERATE_DUPLICATE_KEY_EXCEPTION if a duplicate
key is detected in the load.Conglomerate.load(org.apache.derby.iapi.store.access.conglomerate.TransactionManager, boolean, org.apache.derby.iapi.store.access.RowLocationRetRowSource)public ConglomerateController open(TransactionManager xact_manager, Transaction rawtran, boolean hold, int open_mode, int lock_level, LockingPolicy locking_policy, StaticCompiledOpenConglomInfo static_info, DynamicCompiledOpenConglomInfo dynamic_info) throws StandardException
open in interface Conglomerateopen in class BTreexact_manager - The access xact to associate all ops on cc with.rawtran - The raw store xact to associate all ops on cc with.open_mode - A bit mask of TransactionController.MODE_* bits,
indicating info about the open.lock_level - Either TransactionController.MODE_TABLE or
TransactionController.MODE_RECORD, as passed into
the openConglomerate() call.locking_policy - The LockingPolicy to use to open the conglomerate.StandardException - Standard exception policy.Conglomerate.open(org.apache.derby.iapi.store.access.conglomerate.TransactionManager, org.apache.derby.iapi.store.raw.Transaction, boolean, int, int, org.apache.derby.iapi.store.raw.LockingPolicy, org.apache.derby.iapi.store.access.StaticCompiledOpenConglomInfo, org.apache.derby.iapi.store.access.DynamicCompiledOpenConglomInfo)public ScanManager openScan(TransactionManager xact_manager, Transaction rawtran, boolean hold, int open_mode, int lock_level, LockingPolicy locking_policy, int isolation_level, FormatableBitSet scanColumnList, DataValueDescriptor[] startKeyValue, int startSearchOperator, Qualifier[][] qualifier, DataValueDescriptor[] stopKeyValue, int stopSearchOperator, StaticCompiledOpenConglomInfo static_info, DynamicCompiledOpenConglomInfo dynamic_info) throws StandardException
StandardException - Standard exception policy.Conglomerate.openScan(org.apache.derby.iapi.store.access.conglomerate.TransactionManager, org.apache.derby.iapi.store.raw.Transaction, boolean, int, int, org.apache.derby.iapi.store.raw.LockingPolicy, int, org.apache.derby.iapi.services.io.FormatableBitSet, org.apache.derby.iapi.types.DataValueDescriptor[], int, org.apache.derby.iapi.store.access.Qualifier[][], org.apache.derby.iapi.types.DataValueDescriptor[], int, org.apache.derby.iapi.store.access.StaticCompiledOpenConglomInfo, org.apache.derby.iapi.store.access.DynamicCompiledOpenConglomInfo),
Conglomerate.openScan(org.apache.derby.iapi.store.access.conglomerate.TransactionManager, org.apache.derby.iapi.store.raw.Transaction, boolean, int, int, org.apache.derby.iapi.store.raw.LockingPolicy, int, org.apache.derby.iapi.services.io.FormatableBitSet, org.apache.derby.iapi.types.DataValueDescriptor[], int, org.apache.derby.iapi.store.access.Qualifier[][], org.apache.derby.iapi.types.DataValueDescriptor[], int, org.apache.derby.iapi.store.access.StaticCompiledOpenConglomInfo, org.apache.derby.iapi.store.access.DynamicCompiledOpenConglomInfo)public ScanManager defragmentConglomerate(TransactionManager xact_manager, Transaction rawtran, boolean hold, int open_mode, int lock_level, LockingPolicy locking_policy, int isolation_level) throws StandardException
B2I does not support a compress scan.
hold - see openScan()open_mode - see openScan()lock_level - see openScan()isolation_level - see openScan()StandardException - Standard exception policy.Conglomerate.defragmentConglomerate(org.apache.derby.iapi.store.access.conglomerate.TransactionManager, org.apache.derby.iapi.store.raw.Transaction, boolean, int, int, org.apache.derby.iapi.store.raw.LockingPolicy, int)public void purgeConglomerate(TransactionManager xact_manager, Transaction rawtran) throws StandardException
StandardExceptionpublic void compressConglomerate(TransactionManager xact_manager, Transaction rawtran) throws StandardException
StandardExceptionpublic StoreCostController openStoreCost(TransactionManager xact_manager, Transaction rawtran) throws StandardException
Return an open StoreCostController which can be used to ask about the estimated row counts and costs of ScanController and ConglomerateController operations, on the given conglomerate.
xact_manager - The TransactionController under which this
operation takes place.rawtran - raw transaction context in which scan is managed.StandardException - Standard exception policy.StoreCostControllerpublic void drop(TransactionManager xact_manager) throws StandardException
drop in interface Conglomeratedrop in class BTreeStandardException - Standard exception policy.Conglomerate.drop(org.apache.derby.iapi.store.access.conglomerate.TransactionManager),
BTree.drop(org.apache.derby.iapi.store.access.conglomerate.TransactionManager)public StaticCompiledOpenConglomInfo getStaticCompiledConglomInfo(TransactionController xact_manager, long conglomId) throws StandardException
The static info would be valid until any ddl was executed on the conglomid, and would be up to the caller to throw away when that happened. This ties in with what language already does for other invalidation of static info. The type of info in this would be containerid and array of format id's from which templates can be created. The info in this object is read only and can be shared among as many threads as necessary.
conglomId - The identifier of the conglomerate to open.xact_manager - The TransactionController under which this operation
takes place.StandardException - Standard exception policy.public int getTypeFormatId()
TypedFormat.getTypeFormatId()public void writeExternal_v10_2(java.io.ObjectOutput out)
throws java.io.IOException
For more detailed description of the ACCESS_B2I_V3_ID format see documentation at top of file.
java.io.IOExceptionExternalizable.writeExternal(java.io.ObjectOutput)public void writeExternal_v10_3(java.io.ObjectOutput out)
throws java.io.IOException
For more detailed description of the ACCESS_B2I_V3_ID and ACCESS_B2I_V4_ID formats see documentation at top of file.
java.io.IOExceptionExternalizable.writeExternal(java.io.ObjectOutput)public void writeExternal(java.io.ObjectOutput out)
throws java.io.IOException
For more detailed description of the ACCESS_B2I_V3_ID and ACCESS_B2I_V5_ID formats see documentation at top of file.
writeExternal in interface java.io.ExternalizablewriteExternal in class BTreejava.io.IOException - thrown by writeObject()Externalizable.writeExternal(java.io.ObjectOutput)public void readExternal(java.io.ObjectInput in)
throws java.io.IOException,
java.lang.ClassNotFoundException
readExternal in interface java.io.ExternalizablereadExternal in class BTreejava.lang.ClassNotFoundException - Thrown if the stored representation
is serialized and a class named in
the stream could not be found.java.io.IOException - thrown by readObject()Externalizable.readExternal(java.io.ObjectInput)Apache Derby V10.14 Internals - Copyright © 2004,2018 The Apache Software Foundation. All Rights Reserved.