Class CompositeAggregator
CompositeAggregator provides an ability to execute a collection of aggregators against the same subset of the entries in an IInvocableCache, resulting in a list of corresponding aggregation results.
Inherited Members
Namespace: Tangosol.Util.Aggregator
Assembly: Coherence.dll
Syntax
public class CompositeAggregator : IEntryAggregator, IPortableObject
Remarks
The size of the returned list will always be equal to the length of the aggregators' array.
Note: Unlike many other concrete IEntryAggregator implementations that are constructed directly, instances of CompositeAggregator should only be created using the factory method CreateInstance(IEntryAggregator[]).
Constructors
CompositeAggregator()
Default constructor.
Declaration
public CompositeAggregator()
CompositeAggregator(IEntryAggregator[])
Construct a CompositeAggregator based on a specified IEntryAggregator array.
Declaration
protected CompositeAggregator(IEntryAggregator[] aggregators)
Parameters
Type | Name | Description |
---|---|---|
IEntryAggregator[] | aggregators | An array of IEntryAggregator objects; may not be
|
Fields
m_aggregators
The underlyig IEntryAggregator array.
Declaration
protected IEntryAggregator[] m_aggregators
Field Value
Type | Description |
---|---|
IEntryAggregator[] |
Methods
Aggregate(ICollection)
Process a set of IInvocableCacheEntry objects in order to produce an aggregated result.
Declaration
public virtual object Aggregate(ICollection entries)
Parameters
Type | Name | Description |
---|---|---|
ICollection | entries | A collection of read-only IInvocableCacheEntry objects to aggregate. |
Returns
Type | Description |
---|---|
object | The aggregated result from processing the entries. |
CreateInstance(IEntryAggregator[])
Create an instance of CompositeAggregator based on a specified IEntryAggregator array.
Declaration
public static CompositeAggregator CreateInstance(IEntryAggregator[] aggregators)
Parameters
Type | Name | Description |
---|---|---|
IEntryAggregator[] | aggregators | An array of IEntryAggregator objects; must contain not less than two aggregators. |
Returns
Type | Description |
---|---|
CompositeAggregator | CompositeAggregator instance. |
Remarks
If all the aggregators in the specified array are instances of IParallelAwareAggregator, then a parallel-aware instance of the CompositeAggregator will be created.
If at least one of the specified aggregator is not parallel-aware, then the resulting CompositeAggregator will not be parallel-aware and could be ill-suited for aggregations run against large partitioned caches.
Equals(object)
Compare the CompositeAggregator with another object to determine equality.
Declaration
public override bool Equals(object o)
Parameters
Type | Name | Description |
---|---|---|
object | o | The CompositeAggregator to compare to. |
Returns
Type | Description |
---|---|
bool | true if this CompositeAggregator and the passed object are equivalent. |
Overrides
GetHashCode()
Determine a hash value for the CompositeAggregator object according to the general object.GetHashCode() contract.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | An integer hash value for this object. |
Overrides
ReadExternal(IPofReader)
Restore the contents of a user type instance by reading its state using the specified IPofReader object.
Declaration
public virtual void ReadExternal(IPofReader reader)
Parameters
Type | Name | Description |
---|---|---|
IPofReader | reader | The IPofReader from which to read the object's state. |
Exceptions
Type | Condition |
---|---|
IOException | If an I/O error occurs. |
ToString()
Return a human-readable description for this CompositeAggregator.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | A string description of the CompositeAggregator. |
Overrides
WriteExternal(IPofWriter)
Save the contents of a POF user type instance by writing its state using the specified IPofWriter object.
Declaration
public virtual void WriteExternal(IPofWriter writer)
Parameters
Type | Name | Description |
---|---|---|
IPofWriter | writer | The IPofWriter to which to write the object's state. |
Exceptions
Type | Condition |
---|---|
IOException | If an I/O error occurs. |