Top Description Fields Constructors Methods
org.apache.derby.impl.store.access.conglomerate

public Class OpenConglomerateScratchSpace

extends Object
implements DynamicCompiledOpenConglomInfo
Class Inheritance
All Implemented Interfaces
org.apache.derby.iapi.store.access.DynamicCompiledOpenConglomInfo
Imports
org.apache.derby.shared.common.error.StandardException, org.apache.derby.iapi.store.access.DynamicCompiledOpenConglomInfo, .RowUtil, org.apache.derby.iapi.store.raw.Transaction, org.apache.derby.iapi.types.DataValueDescriptor, org.apache.derby.iapi.services.io.FormatableBitSet, org.apache.derby.shared.common.sanity.SanityManager

A utility class to store and use temporary scratch space associated with a conglomerate.

Field Summary

Modifier and TypeField and Description
private final int[]
private final int[]
format_ids

A complete array of format id's and collation_ids for this conglomerate.

private final boolean
hasCollatedTypes

Tells if there is at least one type in the conglomerate whose collation isn't StringDataValue.COLLATION_TYPE_UCS_BASIC.

private DataValueDescriptor[]
row_for_export_template

A template of info about the classes in the returned row.

private DataValueDescriptor[]
scratch_row

A Scratch row used for qualifying rows in the conglomerate.

private RowPosition
scratch_row_position

Scratch space used by ConglomerateController.

private DataValueDescriptor[]
scratch_template

A Scratch template used for searching and qualifying rows in the conglomerate.

Constructor Summary

AccessConstructor and Description
public
OpenConglomerateScratchSpace(int[]
format identifiers for columns in the row
format_ids
,
int[]
collation identifiers for the columns in the row
collation_ids
,
boolean
whether there is at least one collated type with a collation other than UCS BASIC in the conglomerate
hasCollatedTypes
)

Creates a new scratch space.

Method Summary

Modifier and TypeMethod and Description
public DataValueDescriptor[]

Returns:

The row to use.
get_row_for_export
(Transaction rawtran)

Return an empty template (possibly partial) row to be given back to a client.

public DataValueDescriptor[]

Returns:

The row to use.
get_scratch_row
(Transaction rawtran)

Return an empty template (possibly partial) row to be used and reused internally for processing.

public RowPosition

Returns:

a scratch RowPosition.
get_scratch_row_position
()

Return a scratch RowPosition.

public DataValueDescriptor[]

Returns:

The template to use.
get_template
(Transaction rawtran)

Return a complete empty row.

public boolean

Returns:

true if there is at least one column with a collation different than UCS BASIC.
hasCollatedTypes
()

Tells if there is at least one column with a collation different than UCS BASIC in the conglomerate.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

collation_idsback to summary
private final int[] collation_ids
format_idsback to summary
private final int[] format_ids

A complete array of format id's and collation_ids for this conglomerate.

hasCollatedTypesback to summary
private final boolean hasCollatedTypes

Tells if there is at least one type in the conglomerate whose collation isn't StringDataValue.COLLATION_TYPE_UCS_BASIC. This can be determined by looking at the collation ids, but now the caller is passing in the value to avoid having to look at all the collation ids multiple times.

row_for_export_templateback to summary
private DataValueDescriptor[] row_for_export_template

A template of info about the classes in the returned row.

This template is allocated on demand, and is used to efficiently create new rows for export from this class. This variable is for use by get_row_for_export().

scratch_rowback to summary
private DataValueDescriptor[] scratch_row

A Scratch row used for qualifying rows in the conglomerate. This is a row which matches the FormatableBitSet of rows being returned.

scratch_row_positionback to summary
private RowPosition scratch_row_position

Scratch space used by ConglomerateController.

See Also
org.apache.derby.iapi.store.access.ConglomerateController#delete, org.apache.derby.iapi.store.access.ConglomerateController#replace
scratch_templateback to summary
private DataValueDescriptor[] scratch_template

A Scratch template used for searching and qualifying rows in the conglomerate. This is a full template, independent of the FormatableBitSet used for access.

Constructor Detail

OpenConglomerateScratchSpaceback to summary
public OpenConglomerateScratchSpace(int[] format_ids, int[] collation_ids, boolean hasCollatedTypes)

Creates a new scratch space.

Parameters
format_ids:int[]

format identifiers for columns in the row

collation_ids:int[]

collation identifiers for the columns in the row

hasCollatedTypes:boolean

whether there is at least one collated type with a collation other than UCS BASIC in the conglomerate

Method Detail

get_row_for_exportback to summary
public DataValueDescriptor[] get_row_for_export(Transaction rawtran) throws StandardException

Return an empty template (possibly partial) row to be given back to a client.

The main use of this is for fetchSet() and fetchNextGroup() which allocate rows and then give them back entirely to the caller.

Returns:DataValueDescriptor[]

The row to use.

Exceptions
StandardException:
Standard exception policy.
get_scratch_rowback to summary
public DataValueDescriptor[] get_scratch_row(Transaction rawtran) throws StandardException

Return an empty template (possibly partial) row to be used and reused internally for processing.

The main use of this is for qualifying rows where a row has not been provided by the client. This routine cache's a single row for reuse by the caller, if the caller needs 2 concurrent scratch rows, some other mechanism must be used.

Returns:DataValueDescriptor[]

The row to use.

Exceptions
StandardException:
Standard exception policy.
get_scratch_row_positionback to summary
public RowPosition get_scratch_row_position()

Return a scratch RowPosition.

Used by GenericConglomerateController.delete() and GenericConglomerateController.replace(). It may be reused so callers must insure that object no longer needed before next possible call to get it again.

Returns:RowPosition

a scratch RowPosition.

get_templateback to summary
public DataValueDescriptor[] get_template(Transaction rawtran) throws StandardException

Return a complete empty row.

The main use of this is for searching a tree where a complete copy of the row is needed for searching.

Returns:DataValueDescriptor[]

The template to use.

Exceptions
StandardException:
Standard exception policy.
hasCollatedTypesback to summary
public boolean hasCollatedTypes()

Tells if there is at least one column with a collation different than UCS BASIC in the conglomerate.

Returns:boolean

true if there is at least one column with a collation different than UCS BASIC.