public interface Conglomerate extends Storable, DataValueDescriptor
The Conglomerate interface is implemented by each access method. The implementation must maintain enough information to properly open the conglomerate and scans, and to drop the conglomerate. This information typically will include the id of the container or containers in which the conglomerate is stored, and my also include property information.
Conglomerates are created by a conglomerate factory. The access manager stores them in a directory (which is why they implement Storable).
UNKNOWN_LOGICAL_LENGTH
ORDER_OP_EQUALS, ORDER_OP_GREATEROREQUALS, ORDER_OP_GREATERTHAN, ORDER_OP_LESSOREQUALS, ORDER_OP_LESSTHAN
Modifier and Type | Method and Description |
---|---|
void |
addColumn(TransactionManager xact_manager,
int column_id,
Storable template_column,
int collation_id)
Add a column to the conglomerate.
|
void |
compressConglomerate(TransactionManager xact_manager,
Transaction rawtran) |
ScanManager |
defragmentConglomerate(TransactionManager xact_manager,
Transaction rawtran,
boolean hold,
int open_mode,
int lock_level,
LockingPolicy locking_policy,
int isolation_level)
Online compress table.
|
void |
drop(TransactionManager xact_manager)
Drop this conglomerate.
|
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.
|
long |
getContainerid()
Get the containerid of conglomerate.
|
DynamicCompiledOpenConglomInfo |
getDynamicCompiledConglomInfo()
Return dynamic information about the conglomerate to be dynamically
reused in repeated execution of a statement.
|
ContainerKey |
getId()
Get the id of the container of the conglomerate.
|
StaticCompiledOpenConglomInfo |
getStaticCompiledConglomInfo(TransactionController tc,
long conglomId)
Return static information about the conglomerate to be included in a
a compiled plan.
|
boolean |
isTemporary()
Is this conglomerate temporary?
|
long |
load(TransactionManager xact_manager,
boolean createConglom,
RowLocationRetRowSource rowSource)
Bulk load into the conglomerate.
|
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 conglomerate 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 scan controller.
|
StoreCostController |
openStoreCost(TransactionManager xact_manager,
Transaction rawtran)
Return an open StoreCostController for the conglomerate.
|
void |
purgeConglomerate(TransactionManager xact_manager,
Transaction rawtran) |
checkHostVariable, cloneHolder, cloneValue, coalesce, compare, compare, compare, compare, equals, estimateMemoryUsage, getBoolean, getByte, getBytes, getDate, getDouble, getFloat, getInt, getLength, getLong, getNewNull, getObject, getShort, getStream, getString, getTime, getTimestamp, getTraceString, getTypeName, 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, setValueFromResultSet, typePrecedence, typeToBigDecimal
isNull, restoreToNull
getTypeFormatId
void addColumn(TransactionManager xact_manager, int column_id, Storable template_column, int collation_id) throws StandardException
This routine update's the in-memory object version of the Conglomerate to have one more column of the type described by the input template column. Note that not all conglomerates may support this feature.
xact_manager
- The TransactionController under which this
operation takes place.column_id
- The column number to add this column at.template_column
- An instance of the column to be added to table.collation_id
- Collation id of the added column.StandardException
- Standard exception policy.void drop(TransactionManager xact_manager) throws StandardException
StandardException
- Standard exception policy.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.rawtran
- The raw store xact to associate all ops with.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).locking_policy
- The LockingPolicy to use to open the conglomerate.isolation_level
- The isolation level to lock the conglomerate at.
One of (ISOLATION_READ_COMMITTED,
ISOLATION_REPEATABLE_READ, or
ISOLATION_SERIALIZABLE).scanColumnList
- A description of which columns to return from
every fetch in the scan. fetchRow
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.StandardException
- Standard exception policy.long getContainerid()
Will have to change when a conglomerate could have more than one containerid.
ContainerKey getId()
Will have to change when a conglomerate could have more than one container. The ContainerKey is a combination of the container id and segment id.
StaticCompiledOpenConglomInfo getStaticCompiledConglomInfo(TransactionController tc, 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.
tc
- The TransactionController under which this operation
takes place.conglomId
- The identifier of the conglomerate to open.StandardException
- Standard exception policy.DynamicCompiledOpenConglomInfo getDynamicCompiledConglomInfo() throws StandardException
The dynamic info is a set of variables to be used in a given ScanController or ConglomerateController. It can only be used in one controller at a time. It is up to the caller to insure the correct thread access to this info. The type of info in this is a scratch template for btree traversal, other scratch variables for qualifier evaluation, ...
StandardException
- Standard exception policy.boolean isTemporary()
long load(TransactionManager xact_manager, boolean createConglom, RowLocationRetRowSource rowSource) throws StandardException
Individual rows that are loaded into the conglomerate are not logged. After this operation, the underlying database must be backed up with a database backup rather than an transaction log backup (when we have them). This warning is put here for the benefit of future generation.
xact_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 exception policy. If
conglomerage supports uniqueness checks and has been created to
disallow duplicates, and one of the rows being loaded had key columns
which were duplicate of a row already in the conglomerate, then
raise SQLState.STORE_CONGLOMERATE_DUPLICATE_KEY_EXCEPTION.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
xact_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.TransactionController
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.ScanManager defragmentConglomerate(TransactionManager xact_manager, Transaction rawtran, boolean hold, int open_mode, int lock_level, LockingPolicy locking_policy, int isolation_level) throws StandardException
Note that all Conglomerates may not implement openCompressScan(), currently only the Heap conglomerate implements this scan.
hold
- see openScan()open_mode
- see openScan()lock_level
- see openScan()isolation_level
- see openScan()StandardException
- Standard exception policy.void purgeConglomerate(TransactionManager xact_manager, Transaction rawtran) throws StandardException
StandardException
void compressConglomerate(TransactionManager xact_manager, Transaction rawtran) throws StandardException
StandardException
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.StoreCostController
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.