|
CoherenceTM v3.3 Copyright© 2000-2007 by Oracle Corporation |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.tangosol.util.Base
com.tangosol.util.BitHelper
com.tangosol.util.ExternalizableHelper
com.tangosol.net.AbstractPriorityTask
com.tangosol.util.aggregator.PriorityAggregator
public class PriorityAggregator
PriorityAggregator is used to explicitly control the scheduling priority and timeouts for execution of EntryAggregator-based methods.
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("getPrice"); PriorityAggregator aggrPriority = new PriorityAggregator(aggrStandard); aggrPriority.setExecutionTimeoutMillis(PriorityTask.TIMEOUT_NONE); aggrPriority.setRequestTimeoutMillis(PriorityTask.TIMEOUT_NONE); cacheOrders.aggregate((Filter) null, aggrPriority);This is an advanced feature which should be used judiciously.
Field Summary |
---|
Fields inherited from interface com.tangosol.net.PriorityTask |
---|
SCHEDULE_FIRST, SCHEDULE_IMMEDIATE, SCHEDULE_STANDARD, TIMEOUT_DEFAULT, TIMEOUT_NONE |
Constructor Summary | |
---|---|
PriorityAggregator()
Default constructor (necessary for the ExternalizableLite interface). |
|
PriorityAggregator(InvocableMap.ParallelAwareAggregator aggregator)
Construct a PriorityAggregator. |
Method Summary | |
---|---|
Object |
aggregate(Set setEntries)
Process a set of InvocableMap.Entry objects in order to produce an aggregated result. |
Object |
aggregateResults(Collection collResults)
Aggregate the results of the parallel aggregations. |
InvocableMap.ParallelAwareAggregator |
getAggregator()
Obtain the underlying aggregator. |
InvocableMap.EntryAggregator |
getParallelAggregator()
Get an aggregator that can take the place of this aggregator in situations in which the InvocableMap can aggregate in parallel. |
void |
readExternal(DataInput in)
Restore the contents of this object by loading the object's state from the passed DataInput object. |
void |
readExternal(PofReader in)
Restore the contents of a user type instance by reading its state using the specified PofReader object. |
String |
toString()
Return a human-readable description for this PriorityAggregator. |
void |
writeExternal(DataOutput out)
Save the contents of this object by storing the object's state into the passed DataOutput object. |
void |
writeExternal(PofWriter out)
Save the contents of a POF user type instance by writing its state using the specified PofWriter object. |
Methods inherited from class com.tangosol.net.AbstractPriorityTask |
---|
getExecutionTimeoutMillis, getRequestTimeoutMillis, getSchedulingPriority, runCanceled, setExecutionTimeoutMillis, setRequestTimeoutMillis, setSchedulingPriority |
Methods inherited from class com.tangosol.util.BitHelper |
---|
countBits, countBits, countBits, indexOfLSB, indexOfLSB, indexOfLSB, indexOfMSB, indexOfMSB, indexOfMSB, toBitString, toBitString, toBitString |
Constructor Detail |
---|
public PriorityAggregator()
public PriorityAggregator(InvocableMap.ParallelAwareAggregator aggregator)
aggregator
- the aggregator wrapped by this PriorityAggregatorMethod Detail |
---|
public InvocableMap.EntryAggregator getParallelAggregator()
getParallelAggregator
in interface InvocableMap.ParallelAwareAggregator
public Object aggregateResults(Collection collResults)
aggregateResults
in interface InvocableMap.ParallelAwareAggregator
public Object aggregate(Set setEntries)
aggregate
in interface InvocableMap.EntryAggregator
setEntries
- a Set of read-only InvocableMap.Entry objects to
aggregate
public InvocableMap.ParallelAwareAggregator getAggregator()
public String toString()
public void readExternal(DataInput in) throws IOException
readExternal
in interface ExternalizableLite
readExternal
in class AbstractPriorityTask
in
- the DataInput stream to read data from in order to restore
the state of this object
IOException
- if an I/O exception occurs
NotActiveException
- if the object is not in its initial
state, and therefore cannot be deserialized intopublic void writeExternal(DataOutput out) throws IOException
writeExternal
in interface ExternalizableLite
writeExternal
in class AbstractPriorityTask
out
- the DataOutput stream to write the state of this object to
IOException
- if an I/O exception occurspublic void readExternal(PofReader in) throws IOException
The AbstractPriorityTask implementation reserves property indexes 0 - 9.
The PriorityAggregator implementation reserves property index 10.
readExternal
in interface PortableObject
readExternal
in class AbstractPriorityTask
in
- the PofReader from which to read the object's state
IOException
- if an I/O error occurspublic void writeExternal(PofWriter out) throws IOException
The AbstractPriorityTask implementation reserves property indexes 0 - 9.
The PriorityAggregator implementation reserves property index 10.
writeExternal
in interface PortableObject
writeExternal
in class AbstractPriorityTask
out
- the PofWriter to which to write the object's state
IOException
- if an I/O error occurs
|
CoherenceTM v3.3 Copyright© 2000-2007 by Oracle Corporation |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |