Top Description Fields Constructors Methods
org.apache.derby.iapi.sql.dictionary

public final Class ConglomerateDescriptor

extends UniqueTupleDescriptor
implements Provider
Class Inheritance
All Implemented Interfaces
org.apache.derby.iapi.sql.depend.Provider, org.apache.derby.catalog.Dependable
Imports
org.apache.derby.iapi.sql.conn.LanguageConnectionContext, org.apache.derby.iapi.sql.depend.DependencyManager, .Provider, org.apache.derby.catalog.UUID, .DependableFinder, .Dependable, org.apache.derby.shared.common.error.StandardException, org.apache.derby.shared.common.reference.SQLState, org.apache.derby.shared.common.util.ArrayUtil, org.apache.derby.shared.common.sanity.SanityManager, org.apache.derby.iapi.sql.StatementType, org.apache.derby.iapi.store.access.TransactionController, org.apache.derby.iapi.services.io.StoredFormatIds, org.apache.derby.iapi.services.uuid.UUIDFactory, org.apache.derby.iapi.services.monitor.Monitor

The ConglomerateDescriptor class is used to get information about conglomerates for the purpose of optimization. A ConglomerateDescriptor can map to a base table, an index or a index backing a constraint. Multiple ConglomerateDescriptors can map to a single underlying store conglomerate, such as when multiple index definitions share a physical file.

Note

The language module does not have to know much about conglomerates with this architecture. To get the cost of using a conglomerate, all it has to do is pass the ConglomerateDescriptor to the access methods, along with the predicate. What the access methods need from a ConglomerateDescriptor remains to be seen.

Version
0.1

Field Summary

Modifier and TypeField and Description
private transient String[]
private long
private final boolean
private final boolean
private final IndexRowGenerator
private String
private final UUID
private final UUID
private final UUID

Constructor Summary

AccessConstructor and Description
pack-priv
ConglomerateDescriptor(DataDictionary
The data dictionary that this descriptor lives in
dataDictionary
,
long
The number for the conglomerate we're interested in
conglomerateNumber
,
String
The name of the conglomerate, if any
name
,
boolean
TRUE means the conglomerate is indexable, FALSE means it isn't
indexable
,
IndexRowGenerator
The descriptor of the index if it's not a heap
indexRowGenerator
,
boolean
TRUE means the conglomerate is an index backing up a constraint, FALSE means it isn't
forConstraint
,
UUID
UUID for this conglomerate
uuid
,
UUID
UUID for the table that this conglomerate belongs to
tableID
,
UUID
UUID for the schema that this conglomerate belongs to
schemaID
)

Constructor for a conglomerate descriptor.

Method Summary

Modifier and TypeMethod and Description
public ConglomerateDescriptor

Returns:

A conglomerate descriptor, pulled from the received array, that describes what a physical conglomerate would have to look to like in order to support all sharing descriptors (minus "this" if ignoreThis is true).
describeSharedConglomerate
(ConglomerateDescriptor[]
Array of conglomerate descriptors in which to search; the array may include an entry for "this"; it should not be null.
descriptors
,
boolean
If true then we will NOT consider "this" conglomerate descriptor in our search. That is, we will find a descriptor to describe what a physical conglomerate would have to look like in order to support all sharing descriptors OTHER THAN this one.
ignoreThis
)

This method searches the received array of conglom descriptors to find all descriptors that currently share a physical conglom with "this".

public ConglomerateDescriptor

Returns:

If the conglomerate described by this descriptor is an index conglomerate that is shared by multiple constraints/indexes, then we may have to create a new conglomerate to satisfy the constraints/indexes which remain after we drop the existing conglomerate. If that's needed then we'll return a conglomerate descriptor which describes what the new conglomerate must look like. It is then up to the caller of this method to create a new corresponding conglomerate. We don't create the index here because depending on who called us, it might not make sense to create it--esp. if we get here because of a DROP TABLE.
drop
(LanguageConnectionContext
Connection context to use for dropping
lcc
,
TableDescriptor
TableDescriptor for the table to which this conglomerate belongs
td
)

Drop this ConglomerateDescriptor when it represents an index.

public String

Returns:

char The provider's type.
getClassType
()

Implements org.apache.derby.catalog.Dependable.getClassType.

Get the provider's type.

public String[]

Returns:

the column names for the conglomerate descriptor.
getColumnNames
()

Get the column names for this conglomerate descriptor.

public String

Returns:

The name of the conglomerate, null if it's the heap for a table.
getConglomerateName
()

Gets the name of the conglomerate.

public long

Returns:

A long identifier for the conglomerate
getConglomerateNumber
()

Gets the number for the conglomerate.

public DependableFinder

Returns:

the stored form of this provider
getDependableFinder
()

Implements org.apache.derby.catalog.Dependable.getDependableFinder.

Get an object which can be written to disk and which, when read from disk, will find or reconstruct this in-memory Dependable.

public String
public String
getDescriptorType()

Overrides org.apache.derby.iapi.sql.dictionary.TupleDescriptor.getDescriptorType.

Each descriptor must identify itself with its type; i.e index, check constraint whatever.

public IndexRowGenerator

Returns:

The index descriptor for this conglomerate, if any.
getIndexDescriptor
()

Gets the index row generator for this conglomerate, null if the conglomerate is not an index.

public UUID

Returns:

The provider's UUID
getObjectID
()

Implements org.apache.derby.catalog.Dependable.getObjectID.

Get the provider's UUID

public String

Returns:

String The name of this provider.
getObjectName
()

Implements org.apache.derby.catalog.Dependable.getObjectName.

Return the name of this Provider.

public UUID

Returns:

The UUID String for the schema that the conglomerate belongs to
getSchemaID
()

Gets the UUID for the schema that the conglomerate belongs to.

public UUID

Returns:

The UUID String for the conglomerate
getTableID
()

Gets the UUID for the table that the conglomerate belongs to.

public UUID

Returns:

The UUID String for the conglomerate
getUUID
()

Implements abstract org.apache.derby.iapi.sql.dictionary.UniqueTupleDescriptor.getUUID.

Gets the UUID String for the conglomerate.

public boolean

Returns:

TRUE if the conglomerate is an index backing up a constraint, FALSE if not
isConstraint
()

Tells whether the conglomerate is an index backing up a constraint.

public boolean

Returns:

TRUE if the conglomerate can be used as an index, FALSE if not
isIndex
()

Tells whether the conglomerate can be used as an index.

public void
setColumnNames(String[]
0-based array of column names.
columnNames
)

Set the column names for this conglomerate descriptor.

public void
setConglomerateName(String
The new name of the conglomerate.
newName
)

Set the name of the conglomerate.

public void
setConglomerateNumber(long
The new conglomerate number.
conglomerateNumber
)

Set the conglomerate number.

public String

Returns:

The conglomerate descriptor as a String
toString
()

Overrides java.lang.Object.toString.

Convert the conglomerate descriptor to a String

Field Detail

columnNamesback to summary
private transient String[] columnNames
conglomerateNumberback to summary
private long conglomerateNumber
forConstraintback to summary
private final boolean forConstraint
indexableback to summary
private final boolean indexable
indexRowGeneratorback to summary
private final IndexRowGenerator indexRowGenerator
nameback to summary
private String name
schemaIDback to summary
private final UUID schemaID
tableIDback to summary
private final UUID tableID
uuidback to summary
private final UUID uuid

Constructor Detail

ConglomerateDescriptorback to summary
pack-priv ConglomerateDescriptor(DataDictionary dataDictionary, long conglomerateNumber, String name, boolean indexable, IndexRowGenerator indexRowGenerator, boolean forConstraint, UUID uuid, UUID tableID, UUID schemaID)

Constructor for a conglomerate descriptor.

Parameters
dataDictionary:DataDictionary

The data dictionary that this descriptor lives in

conglomerateNumber:long

The number for the conglomerate we're interested in

name:String

The name of the conglomerate, if any

indexable:boolean

TRUE means the conglomerate is indexable, FALSE means it isn't

indexRowGenerator:IndexRowGenerator

The descriptor of the index if it's not a heap

forConstraint:boolean

TRUE means the conglomerate is an index backing up a constraint, FALSE means it isn't

uuid:UUID

UUID for this conglomerate

tableID:UUID

UUID for the table that this conglomerate belongs to

schemaID:UUID

UUID for the schema that this conglomerate belongs to

Method Detail

describeSharedConglomerateback to summary
public ConglomerateDescriptor describeSharedConglomerate(ConglomerateDescriptor[] descriptors, boolean ignoreThis) throws StandardException

This method searches the received array of conglom descriptors to find all descriptors that currently share a physical conglom with "this". The method then searches within those sharing descriptors to find one that fully describes what a physical conglom would have to look like in order to support _all_ of the sharing descriptors in the array--esp. one that correctly enforces the uniqueness requirements for those descriptors.

Parameters
descriptors:ConglomerateDescriptor[]

Array of conglomerate descriptors in which to search; the array may include an entry for "this"; it should not be null.

ignoreThis:boolean

If true then we will NOT consider "this" conglomerate descriptor in our search. That is, we will find a descriptor to describe what a physical conglomerate would have to look like in order to support all sharing descriptors OTHER THAN this one.

Returns:ConglomerateDescriptor

A conglomerate descriptor, pulled from the received array, that describes what a physical conglomerate would have to look to like in order to support all sharing descriptors (minus "this" if ignoreThis is true).

dropback to summary
public ConglomerateDescriptor drop(LanguageConnectionContext lcc, TableDescriptor td) throws StandardException

Drop this ConglomerateDescriptor when it represents an index. If this is the last desciptor for a physical index then the physical index (conglomerate) and its descriptor will be dropped.

Parameters
lcc:LanguageConnectionContext

Connection context to use for dropping

td:TableDescriptor

TableDescriptor for the table to which this conglomerate belongs

Returns:ConglomerateDescriptor

If the conglomerate described by this descriptor is an index conglomerate that is shared by multiple constraints/indexes, then we may have to create a new conglomerate to satisfy the constraints/indexes which remain after we drop the existing conglomerate. If that's needed then we'll return a conglomerate descriptor which describes what the new conglomerate must look like. It is then up to the caller of this method to create a new corresponding conglomerate. We don't create the index here because depending on who called us, it might not make sense to create it--esp. if we get here because of a DROP TABLE.

getClassTypeback to summary
public String getClassType()

Implements org.apache.derby.catalog.Dependable.getClassType.

Get the provider's type.

Returns:String

char The provider's type.

getColumnNamesback to summary
public String[] getColumnNames()

Get the column names for this conglomerate descriptor. This is useful for tracing the optimizer.

Returns:String[]

the column names for the conglomerate descriptor.

getConglomerateNameback to summary
public String getConglomerateName()

Gets the name of the conglomerate. For heaps, this is null. For indexes, it is the index name.

Returns:String

The name of the conglomerate, null if it's the heap for a table.

getConglomerateNumberback to summary
public long getConglomerateNumber()

Gets the number for the conglomerate.

Returns:long

A long identifier for the conglomerate

getDependableFinderback to summary
public DependableFinder getDependableFinder()

Implements org.apache.derby.catalog.Dependable.getDependableFinder.

Doc from org.apache.derby.catalog.Dependable.getDependableFinder.

Get an object which can be written to disk and which, when read from disk, will find or reconstruct this in-memory Dependable.

Returns:DependableFinder

the stored form of this provider

getDescriptorNameback to summary
public String getDescriptorName()

Overrides org.apache.derby.iapi.sql.dictionary.TupleDescriptor.getDescriptorName.

See Also
TupleDescriptor#getDescriptorName
getDescriptorTypeback to summary
public String getDescriptorType()

Overrides org.apache.derby.iapi.sql.dictionary.TupleDescriptor.getDescriptorType.

Doc from org.apache.derby.iapi.sql.dictionary.TupleDescriptor.getDescriptorType.

Each descriptor must identify itself with its type; i.e index, check constraint whatever.

See Also
TupleDescriptor#getDescriptorType
getIndexDescriptorback to summary
public IndexRowGenerator getIndexDescriptor()

Gets the index row generator for this conglomerate, null if the conglomerate is not an index.

Returns:IndexRowGenerator

The index descriptor for this conglomerate, if any.

getObjectIDback to summary
public UUID getObjectID()

Implements org.apache.derby.catalog.Dependable.getObjectID.

Get the provider's UUID

Returns:UUID

The provider's UUID

getObjectNameback to summary
public String getObjectName()

Implements org.apache.derby.catalog.Dependable.getObjectName.

Return the name of this Provider. (Useful for errors.)

Returns:String

String The name of this provider.

getSchemaIDback to summary
public UUID getSchemaID()

Gets the UUID for the schema that the conglomerate belongs to.

Returns:UUID

The UUID String for the schema that the conglomerate belongs to

getTableIDback to summary
public UUID getTableID()

Gets the UUID for the table that the conglomerate belongs to.

Returns:UUID

The UUID String for the conglomerate

getUUIDback to summary
public UUID getUUID()

Implements abstract org.apache.derby.iapi.sql.dictionary.UniqueTupleDescriptor.getUUID.

Gets the UUID String for the conglomerate.

Returns:UUID

The UUID String for the conglomerate

isConstraintback to summary
public boolean isConstraint()

Tells whether the conglomerate is an index backing up a constraint.

Returns:boolean

TRUE if the conglomerate is an index backing up a constraint, FALSE if not

isIndexback to summary
public boolean isIndex()

Tells whether the conglomerate can be used as an index.

Returns:boolean

TRUE if the conglomerate can be used as an index, FALSE if not

setColumnNamesback to summary
public void setColumnNames(String[] columnNames)

Set the column names for this conglomerate descriptor. This is useful for tracing the optimizer.

Parameters
columnNames:String[]

0-based array of column names.

setConglomerateNameback to summary
public void setConglomerateName(String newName)

Set the name of the conglomerate. Used only by rename index.

Parameters
newName:String

The new name of the conglomerate.

setConglomerateNumberback to summary
public void setConglomerateNumber(long conglomerateNumber)

Set the conglomerate number. This is useful when swapping conglomerates, like for bulkInsert.

Parameters
conglomerateNumber:long

The new conglomerate number.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Convert the conglomerate descriptor to a String

Returns:String

The conglomerate descriptor as a String