Top Description Fields Constructors Methods
org.apache.derby.impl.sql.execute

pack-priv Class GenericAggregator

extends Object
Class Inheritance
Imports
java.lang.reflect.Constructor, org.apache.derby.shared.common.error.StandardException, org.apache.derby.iapi.services.io.Storable, org.apache.derby.iapi.services.loader.ClassFactory, org.apache.derby.shared.common.sanity.SanityManager, org.apache.derby.iapi.sql.execute.ExecAggregator, .ExecRow, org.apache.derby.iapi.types.DataValueDescriptor, .UserDataValue

Adaptor that sits between execution layer and aggregates.

Field Summary

Modifier and TypeField and Description
private final AggregatorInfo
pack-priv int
private ExecAggregator
private final ClassFactory
private int
private int

Constructor Summary

AccessConstructor and Description
pack-priv
GenericAggregator(AggregatorInfo
information about the user aggregate
aggInfo
,
ClassFactory
the class factory.
cf
)

Constructor:

Method Summary

Modifier and TypeMethod and Description
pack-priv void
accumulate(ExecRow
the row with the input colum
inputRow
,
ExecRow
the row with the aggregator
accumulateRow
)

Accumulate the aggregate results.

pack-priv void
accumulate(Object[]
the row with the input colum
inputRow
,
Object[]
the row with the aggregator
accumulateRow
)

Accumulate the aggregate results.

pack-priv void
accumulate(DataValueDescriptor inputColumn, DataValueDescriptor aggregatorColumn)

Accumulate the aggregate results.

pack-priv boolean
finish(ExecRow
the row with the result and the aggregator
row
)

Get the results of the aggregation and put it in the result column.

pack-priv AggregatorInfo
pack-priv ExecAggregator

Returns:

an exec aggregator
getAggregatorInstance
()

Get a new instance of the aggregator and initialize it.

pack-priv int
getColumnId()

Return the column id that is being aggregated

pack-priv DataValueDescriptor
pack-priv void
initialize(ExecRow
the row with the aggregator to be initialized
row
)

Initialize the aggregator

pack-priv void
merge(ExecRow
the row with the input colum
inputRow
,
ExecRow
the row with the aggregator
mergeRow
)

Merge the aggregate results.

pack-priv void
merge(Object[]
the row with the input colum
inputRow
,
Object[]
the row with the aggregator
mergeRow
)

Merge the aggregate results.

pack-priv void
merge(Storable aggregatorColumnIn, Storable aggregatorColumnOut)

Merge two partial aggregations.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

aggInfoback to summary
private final AggregatorInfo aggInfo
aggregatorColumnIdback to summary
pack-priv int aggregatorColumnId
cachedAggregatorback to summary
private ExecAggregator cachedAggregator
cfback to summary
private final ClassFactory cf
inputColumnIdback to summary
private int inputColumnId
resultColumnIdback to summary
private int resultColumnId

Constructor Detail

GenericAggregatorback to summary
pack-priv GenericAggregator(AggregatorInfo aggInfo, ClassFactory cf)

Constructor:

Parameters
aggInfo:AggregatorInfo

information about the user aggregate

cf:ClassFactory

the class factory.

Method Detail

accumulateback to summary
pack-priv void accumulate(ExecRow inputRow, ExecRow accumulateRow) throws StandardException

Accumulate the aggregate results. This is the guts of the aggregation. We will call the user aggregate on itself to do the aggregation.

Parameters
inputRow:ExecRow

the row with the input colum

accumulateRow:ExecRow

the row with the aggregator

Exceptions
StandardException:
on error
accumulateback to summary
pack-priv void accumulate(Object[] inputRow, Object[] accumulateRow) throws StandardException

Accumulate the aggregate results. This is the guts of the aggregation. We will call the user aggregate on itself to do the aggregation.

Parameters
inputRow:Object[]

the row with the input colum

accumulateRow:Object[]

the row with the aggregator

Exceptions
StandardException:
on error
accumulateback to summary
pack-priv void accumulate(DataValueDescriptor inputColumn, DataValueDescriptor aggregatorColumn) throws StandardException

Accumulate the aggregate results. This is the guts of the aggregation. We will call the user aggregate on itself to do the aggregation.

Exceptions
StandardException:
on error
finishback to summary
pack-priv boolean finish(ExecRow row) throws StandardException

Get the results of the aggregation and put it in the result column.

Parameters
row:ExecRow

the row with the result and the aggregator

Exceptions
StandardException:
on error
getAggregatorInfoback to summary
pack-priv AggregatorInfo getAggregatorInfo()
getAggregatorInstanceback to summary
pack-priv ExecAggregator getAggregatorInstance() throws StandardException

Get a new instance of the aggregator and initialize it.

Returns:ExecAggregator

an exec aggregator

Exceptions
StandardException:
on error
getColumnIdback to summary
pack-priv int getColumnId()

Return the column id that is being aggregated

getInputColumnValueback to summary
pack-priv DataValueDescriptor getInputColumnValue(ExecRow row) throws StandardException
initializeback to summary
pack-priv void initialize(ExecRow row) throws StandardException

Initialize the aggregator

Parameters
row:ExecRow

the row with the aggregator to be initialized

Exceptions
StandardException:
on error
mergeback to summary
pack-priv void merge(ExecRow inputRow, ExecRow mergeRow) throws StandardException

Merge the aggregate results. This is the guts of the aggregation. We will call the user aggregate on itself to do the aggregation.

Parameters
inputRow:ExecRow

the row with the input colum

mergeRow:ExecRow

the row with the aggregator

Exceptions
StandardException:
on error
mergeback to summary
pack-priv void merge(Object[] inputRow, Object[] mergeRow) throws StandardException

Merge the aggregate results. This is the guts of the aggregation. We will call the user aggregate on itself to do the aggregation.

Parameters
inputRow:Object[]

the row with the input colum

mergeRow:Object[]

the row with the aggregator

Exceptions
StandardException:
on error
mergeback to summary
pack-priv void merge(Storable aggregatorColumnIn, Storable aggregatorColumnOut) throws StandardException

Merge two partial aggregations. This is how the sorter merges partial aggregates.

Exceptions
StandardException:
on error