Class PriorityAggregator
PriorityAggregator is used to explicitly control the scheduling priority and timeouts for execution of IEntryAggregator -based methods.
Inherited Members
Namespace: Tangosol.Util.Aggregator
Assembly: Coherence.dll
Syntax
public class PriorityAggregator : AbstractPriorityTask, IPriorityTask, IParallelAwareAggregator, IEntryAggregator, IPortableObject
Remarks
For example, let's assume that there is an Orders cache that belongs to a partitioned cache service configured with a request-timeout and task-timeout of 5 seconds. Also assume that we are willing to wait longer for a particular aggregation request that scans the entire cache. Then we could override the default timeout values by using the PriorityAggregator as follows:
DoubleAverage aggrStandard = new DoubleAverage("Price");
PriorityAggregator aggrPriority = new PriorityAggregator(aggrStandard);
aggrPriority.ExecutionTimeoutMillis = PriorityTaskTimeout.None;
aggrPriority.RequestTimeoutMillis = PriorityTaskTimeout.None;
cacheOrders.Aggregate(null, aggrPriority);
This is an advanced feature which should be used judiciously.
Constructors
PriorityAggregator()
Default constructor.
Declaration
public PriorityAggregator()
PriorityAggregator(IParallelAwareAggregator)
Construct a PriorityAggregator.
Declaration
public PriorityAggregator(IParallelAwareAggregator aggregator)
Parameters
Type | Name | Description |
---|---|---|
IParallelAwareAggregator | aggregator | The IParallelAwareAggregator wrapped by this PriorityAggregator. |
Properties
Aggregator
Obtain the underlying aggregator.
Declaration
public IParallelAwareAggregator Aggregator { get; }
Property Value
Type | Description |
---|---|
IParallelAwareAggregator | The aggregator wrapped by this PriorityAggregator. |
ParallelAggregator
Get an aggregator that can take the place of this aggregator in situations in which the IInvocableCache can aggregate in parallel.
Declaration
public IEntryAggregator ParallelAggregator { get; }
Property Value
Type | Description |
---|---|
IEntryAggregator | The aggregator that will be run in parallel. |
Methods
Aggregate(ICollection)
Process a set of IInvocableCacheEntry objects in order to produce an aggregated result.
Declaration
public 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. |
AggregateResults(ICollection)
Aggregate the results of the parallel aggregations.
Declaration
public object AggregateResults(ICollection results)
Parameters
Type | Name | Description |
---|---|---|
ICollection | results | Results to aggregate. |
Returns
Type | Description |
---|---|
object | The aggregation of the parallel aggregation results. |
ReadExternal(IPofReader)
Restore the contents of a user type instance by reading its state using the specified IPofReader object.
Declaration
public override void ReadExternal(IPofReader reader)
Parameters
Type | Name | Description |
---|---|---|
IPofReader | reader | The IPofReader from which to read the object's state. |
Overrides
Remarks
This implementation reserves property index 10.
Exceptions
Type | Condition |
---|---|
IOException | If an I/O error occurs. |
ToString()
Return a human-readable description for this PriorityAggregator.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | A string description of the PriorityAggregator. |
Overrides
WriteExternal(IPofWriter)
Save the contents of a POF user type instance by writing its state using the specified IPofWriter object.
Declaration
public override void WriteExternal(IPofWriter writer)
Parameters
Type | Name | Description |
---|---|---|
IPofWriter | writer | The IPofWriter to which to write the object's state. |
Overrides
Remarks
This implementation reserves property index 10.
Exceptions
Type | Condition |
---|---|
IOException | If an I/O error occurs. |