Top Description Fields Methods
org.apache.derby.iapi.store.access.conglomerate

public Interface ConglomerateFactory

extends MethodFactory
Known Direct Implementers
org.apache.derby.impl.store.access.btree.index.B2IFactory, org.apache.derby.impl.store.access.heap.HeapConglomerateFactory
Imports
java.util.Properties, org.apache.derby.catalog.UUID, org.apache.derby.shared.common.error.StandardException, org.apache.derby.iapi.store.access.AccessFactory, .ColumnOrdering, org.apache.derby.iapi.store.raw.ContainerKey, .PageKey, .Transaction, org.apache.derby.iapi.types.DataValueDescriptor

The factory interface for all conglomerate access methods.

Field Summary

Modifier and TypeField and Description
public static final int
public static final int
Inherited from org.apache.derby.iapi.store.access.conglomerate.MethodFactory:
MODULE

Method Summary

Modifier and TypeMethod and Description
public Conglomerate
createConglomerate(TransactionManager
transaction to perform the create in.
xact_mgr
,
int
segment to create the conglomerate in.
segment
,
long
containerid to assign the container, or ContainerHandle.DEFAULT_ASSIGN_ID if you want raw store to assign an id.
input_containerid
,
DataValueDescriptor[]
Template of row in the conglomerate.
template
,
ColumnOrdering[]
columns sort order for Index creation
columnOrder
,
int[]
collation ids of columns in the conglomerate.
collationIds
,
Properties
Properties associated with the conglomerate.
properties
,
int temporaryFlag)

Create the conglomerate and return a conglomerate object for it.

public int

Returns:

an unique identifier used to the factory into the conglomid.
getConglomerateFactoryId
()

Return the conglomerate factory id.

Return a number in the range of 0-15 which identifies this factory.

public void
insertUndoNotify(AccessFactory
current access_factory of the aborted insert.
access_factory
,
Transaction
transaction that is being backed out.
xact
,
PageKey
page key of the aborted insert.
page_key
)

Interface to be called when an undo of an insert is processed.

public Conglomerate

Returns:

An instance of the conglomerate.
readConglomerate
(TransactionManager
transaction to perform the create in.
xact_mgr
,
ContainerKey
The unique id of the existing conglomerate.
container_key
)

Return Conglomerate object for conglomerate with container_key.

Inherited from org.apache.derby.iapi.store.access.conglomerate.MethodFactory:
defaultPropertiesprimaryFormatprimaryImplementationTypesupportsFormatsupportsImplementation

Field Detail

BTREE_FACTORY_IDback to summary
public static final int BTREE_FACTORY_ID
HEAP_FACTORY_IDback to summary
public static final int HEAP_FACTORY_ID

Method Detail

createConglomerateback to summary
public Conglomerate createConglomerate(TransactionManager xact_mgr, int segment, long input_containerid, DataValueDescriptor[] template, ColumnOrdering[] columnOrder, int[] collationIds, Properties properties, int temporaryFlag) throws StandardException

Create the conglomerate and return a conglomerate object for it. It is expected that the caller of this method will place the the resulting object in the conglomerate directory.

Parameters
xact_mgr:TransactionManager

transaction to perform the create in.

segment:int

segment to create the conglomerate in.

input_containerid:long

containerid to assign the container, or ContainerHandle.DEFAULT_ASSIGN_ID if you want raw store to assign an id.

template:DataValueDescriptor[]

Template of row in the conglomerate.

columnOrder:ColumnOrdering[]

columns sort order for Index creation

collationIds:int[]

collation ids of columns in the conglomerate.

properties:Properties

Properties associated with the conglomerate.

Exceptions
StandardException:
if the conglomerate could not be opened for some reason, or if an error occurred in one of the lower level modules.
getConglomerateFactoryIdback to summary
public int getConglomerateFactoryId()

Return the conglomerate factory id.

Return a number in the range of 0-15 which identifies this factory. Code which names conglomerates depends on this range currently, but could be easily changed to handle larger ranges. One hex digit seemed reasonable for the number of conglomerate types currently implemented (heap, btree) and those that might be implemented in the future: gist, gist btree, gist rtree, hash, others? ).

Returns:int

an unique identifier used to the factory into the conglomid.

insertUndoNotifyback to summary
public void insertUndoNotify(AccessFactory access_factory, Transaction xact, PageKey page_key) throws StandardException

Interface to be called when an undo of an insert is processed.

Implementer of this class provides interface to be called by the raw store when an undo of an insert is processed. Initial implementation will be by Access layer to queue space reclaiming events if necessary when a rows is logically "deleted" as part of undo of the original insert. This undo can happen a lot for many applications if they generate expected and handled duplicate key errors.

Caller may decide to call or not based on deleted row count of the page, or if overflow rows/columns are present.

Parameters
access_factory:AccessFactory

current access_factory of the aborted insert.

xact:Transaction

transaction that is being backed out.

page_key:PageKey

page key of the aborted insert.

Exceptions
StandardException:
Standard exception policy.
readConglomerateback to summary
public Conglomerate readConglomerate(TransactionManager xact_mgr, ContainerKey container_key) throws StandardException

Return Conglomerate object for conglomerate with container_key.

Return the Conglomerate Object. This is implementation specific. Examples of what will be done is using the key to find the file where the conglomerate is located, and then executing implementation specific code to instantiate an object from reading a "special" row from a known location in the file. In the btree case the btree conglomerate is stored as a column in the control row on the root page.

This operation is costly so it is likely an implementation using this will cache the conglomerate row in memory so that subsequent accesses need not perform this operation.

Parameters
xact_mgr:TransactionManager

transaction to perform the create in.

container_key:ContainerKey

The unique id of the existing conglomerate.

Returns:Conglomerate

An instance of the conglomerate.

Exceptions
StandardException:
Standard exception policy.