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

public final Class ConglomerateUtil

extends Object
Class Inheritance
Imports
org.apache.derby.shared.common.reference.Property, org.apache.derby.shared.common.sanity.SanityManager, org.apache.derby.iapi.services.io.CompressedNumber, .Formatable, .FormatIdUtil, org.apache.derby.iapi.store.access.RowUtil, org.apache.derby.iapi.store.raw.FetchDescriptor, .Page, .RawStoreFactory, .RecordHandle, org.apache.derby.iapi.types.DataValueDescriptor, .StringDataValue, java.io.IOException, .ObjectInput, .ObjectOutput, java.util.Properties

Static utility routine package for all Conglomerates.

A collection of static utility routines that are shared by multiple Conglomerate implementations.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static int[]

Returns:

An array of collation id's describing the input array of objects.
createCollationIds
(int sizeof_ids, int[] collationIds)

Given an array of columnOrderings, return an array of collation ids.

public static int[]

Returns:

An array of format id's describing the input array of objects.
createFormatIds
(DataValueDescriptor[]
a row.
template
)

Given an array of objects, return an array of format id's.

public static Properties

Returns:

The Property set filled in.
createRawStorePropertySet
(Properties
If non-null the property set to fill in.
prop
)

Create a list of all the properties that Access wants to export through the getInternalTablePropertySet() call.

public static Properties

Returns:

The Property set filled in.
createUserRawStorePropertySet
(Properties
If non-null the property set to fill in.
prop
)

Create a list of all the properties that Access wants to export through the getInternalTablePropertySet() call.

public static String
debugPage(Page page, int start_slot, boolean full_rh, DataValueDescriptor[] template)

Format a page of data, as access see's it.

public static boolean

Returns:

true if at least one column has a different collation than UCS BASIC, false otherwise.
readCollationIdArray
(int[]
update's only those array entries that have been set in the sparse array stream. Those values are set as indicated by reading the sparse array from the stream.
collation_id_array
,
ObjectInput
The stream to read the collation info from.
in
)

Read "sparse" array of collation id's

The format to be read first has the number of entries as a compressed int.

public static int[]

Returns:

A new array of format id's.
readFormatIdArray
(int
The number of format ids to read.
num
,
ObjectInput
The stream to read the array of format id's from.
in
)

Read a format id array in from a stream.

public static void
writeCollationIdArray(int[]
The array of collation ids to write.
collation_id_array
,
ObjectOutput
The stream to write the collation id's to.
out
)

Write array of collation id's as a sparse array.

public static void
writeFormatIdArray(int[]
The array of format ids to write.
format_id_array
,
ObjectOutput
The stream to write the array of format id's to.
out
)

Write a format id array to a stream.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ConglomerateUtilback to summary
public ConglomerateUtil()

Method Detail

createCollationIdsback to summary
public static int[] createCollationIds(int sizeof_ids, int[] collationIds)

Given an array of columnOrderings, return an array of collation ids.

If input array is null, produce a default collation_id array of all StringDataValue.COLLATION_TYPE_UCS_BASIC values.

Returns:int[]

An array of collation id's describing the input array of objects.

createFormatIdsback to summary
public static int[] createFormatIds(DataValueDescriptor[] template)

Given an array of objects, return an array of format id's.

Parameters
template:DataValueDescriptor[]

a row.

Returns:int[]

An array of format id's describing the input array of objects.

createRawStorePropertySetback to summary
public static Properties createRawStorePropertySet(Properties prop)

Create a list of all the properties that Access wants to export through the getInternalTablePropertySet() call.

This utility routine creates a list of properties that are shared by all conglomerates. This list contains the following: derby.storage.initialPages derby.storage.minimumRecordSize derby.storage.pageReservedSpace derby.storage.pageSize derby.storage.reusableRecordId

Parameters
prop:Properties

If non-null the property set to fill in.

Returns:Properties

The Property set filled in.

createUserRawStorePropertySetback to summary
public static Properties createUserRawStorePropertySet(Properties prop)

Create a list of all the properties that Access wants to export through the getInternalTablePropertySet() call.

This utility routine creates a list of properties that are shared by all conglomerates. This list contains the following: derby.storage.initialPages derby.storage.minimumRecordSize derby.storage.pageReservedSpace derby.storage.pageSize

Parameters
prop:Properties

If non-null the property set to fill in.

Returns:Properties

The Property set filled in.

debugPageback to summary
public static String debugPage(Page page, int start_slot, boolean full_rh, DataValueDescriptor[] template)

Format a page of data, as access see's it.

readCollationIdArrayback to summary
public static boolean readCollationIdArray(int[] collation_id_array, ObjectInput in) throws IOException

Read "sparse" array of collation id's

The format to be read first has the number of entries as a compressed int. And then for each non-COLLATION_TYPE_UCS_BASIC value there is pair of compressed ints: (array offset, array entry value)

reads the sparse array as written by writeCollationIdArray().

Parameters
collation_id_array:int[]

update's only those array entries that have been set in the sparse array stream. Those values are set as indicated by reading the sparse array from the stream.

in:ObjectInput

The stream to read the collation info from.

Returns:boolean

true if at least one column has a different collation than UCS BASIC, false otherwise.

readFormatIdArrayback to summary
public static int[] readFormatIdArray(int num, ObjectInput in) throws IOException

Read a format id array in from a stream.

Parameters
num:int

The number of format ids to read.

in:ObjectInput

The stream to read the array of format id's from.

Returns:int[]

A new array of format id's.

Exceptions
IOException:
Thown on read error.
writeCollationIdArrayback to summary
public static void writeCollationIdArray(int[] collation_id_array, ObjectOutput out) throws IOException

Write array of collation id's as a sparse array.

The format only writes out those array entries which are not StringDataValue.COLLATION_TYPE_UCS_BASIC. The sparse array first writes the number of entries as a compressed int. And then for each non-COLLATION_TYPE_UCS_BASIC, it writes out a pair of compressed ints: (array offset, array entry value)

Parameters
collation_id_array:int[]

The array of collation ids to write.

out:ObjectOutput

The stream to write the collation id's to.

Exceptions
IOException:
Thown on write error.
writeFormatIdArrayback to summary
public static void writeFormatIdArray(int[] format_id_array, ObjectOutput out) throws IOException

Write a format id array to a stream.

Parameters
format_id_array:int[]

The array of format ids to write.

out:ObjectOutput

The stream to write the array of format id's to.

Exceptions
IOException:
Thown on write error.