Oracle® Fusion Middleware C++ API Reference for Oracle Coherence
12c (12.2.1.4.0)

E90870-01

PriorityAggregator Class Reference

#include <coherence/util/aggregator/PriorityAggregator.hpp>

Inherits AbstractPriorityTask, and InvocableMap::ParallelAwareAggregator.

List of all members.


Detailed Description

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:

   Float64Average::Handle aggrStandard =
           Float64Average::create(ReflectionExtractor::create("getPrice"));
   PriorityAggregator::Handle aggrPriority =
           PriorityAggregator::create(aggrStandard);
   aggrPriority->setExecutionTimeoutMillis(PriorityTask::timeout_none);
   aggrPriority->setRequestTimeoutMillis(PriorityTask::timeout_none);
   cacheOrders->aggregate(NULL, aggrPriority);
 

This is an advanced feature which should be used judiciously.

Author:
djl 2008.05.16

Public Types

typedef spec::Handle Handle
 PriorityAggregator Handle definition.
typedef spec::View View
 PriorityAggregator View definition.
typedef spec::Holder Holder
 PriorityAggregator Holder definition.

Public Member Functions

virtual Object::Holder aggregate (Set::View vSetEntries)
 Process a set of InvocableMap::Entry objects in order to produce an aggregated result.

Parameters:
vSetEntries a Set of read-only InvocableMap::Entry objects to aggregate
Returns:
the aggregated result from processing the entries

virtual
InvocableMap::EntryAggregator::Handle 
getParallelAggregator ()
 Get an aggregator that can take the place of this aggregator in situations in which the InvocableMap can aggregate in parallel.

Returns:
the aggregator that will be run in parallel

virtual Object::Holder aggregateResults (Collection::View vCollResults)
 Aggregate the results of the parallel aggregations.

Parameters:
vCollResults the parallel aggregation results
Returns:
the aggregation of the parallel aggregation results

virtual void readExternal (PofReader::Handle hIn)
 
virtual void writeExternal (PofWriter::Handle hOut) const
 
virtual TypedHandle
< const String
toString () const
 Output a human-readable description of this Object to the given stream.

Note that when overriding this method the return type must be TypedHandle<const String> rather then String::View. These two types are assignment compatible but not equivalent and declaring the override with String::View will not be a compatible override.

coherence::lang::operator<<(std::ostream, Object::View) is defined and will call into the toString method, to output Objects. If a managed String object is desired, the COH_TO_STRING macro can be used to build up a String from streamable contents and is generally how toString() will be implemented.

 Object::View vKey   = ...
 Object::View vValue = ...
 std::cout << vKey << " = " << vValue << std::endl;

 String::View vs = COH_TO_STRING(vKey << " = " << vValue);

The COH_TO_STRING macro is also the most common way to implement the toString method. For example:

 virtual TypedHandle<const String> Person::toString() const
     {
     return COH_TO_STRING("Name: " << f_sName << " SSN: " << f_nSSN);
     }

Returns:
a string representation of this object

virtual
InvocableMap::ParallelAwareAggregator::Handle 
getAggregator ()
 Obtain the underlying aggregator.
virtual
InvocableMap::ParallelAwareAggregator::View 
getAggregator () const
 Obtain the underlying aggregator.

Protected Member Functions

 PriorityAggregator ()
 Default constructor (necessary for the PortableObject interface).
 PriorityAggregator (InvocableMap::ParallelAwareAggregator::Handle hAggregator)
 Construct a PriorityAggregator.

Constructor & Destructor Documentation

PriorityAggregator ( InvocableMap::ParallelAwareAggregator::Handle  hAggregator  )  [protected]

Construct a PriorityAggregator.

Parameters:
hAggregator the aggregator wrapped by this PriorityAggregator


Member Function Documentation

virtual InvocableMap::ParallelAwareAggregator::Handle getAggregator (  )  [virtual]

Obtain the underlying aggregator.

Returns:
the aggregator wrapped by this PriorityAggregator

virtual InvocableMap::ParallelAwareAggregator::View getAggregator (  )  const [virtual]

Obtain the underlying aggregator.

Returns:
the aggregator wrapped by this PriorityAggregator


The documentation for this class was generated from the following file:
Copyright © 2000, 2019, Oracle and/or its affiliates. All rights reserved.