Class ConverterCollections.ConverterInvocableCache
A Converter InvocableCache views an underlying IInvocableCache through a set of key and value IConverters.
Inheritance
Inherited Members
Namespace: Tangosol.Util
Assembly: Coherence.dll
Syntax
[Serializable]
public class ConverterCollections.ConverterInvocableCache : ConverterCollections.ConverterCache, IInvocableCache, ICache, IDictionary, ICollection, IEnumerable
Constructors
ConverterInvocableCache(IInvocableCache, IConverter, IConverter, IConverter, IConverter)
Constructor.
Declaration
public ConverterInvocableCache(IInvocableCache cache, IConverter convKeyUp, IConverter convKeyDown, IConverter convValUp, IConverter convValDown)
Parameters
Type | Name | Description |
---|---|---|
IInvocableCache | cache | The underlying IInvocableCache. |
IConverter | convKeyUp | The IConverter to view the underlying cache's keys through. |
IConverter | convKeyDown | The IConverter to use to pass keys down to the underlying cache. |
IConverter | convValUp | The IConverter to view the underlying cache's values through. |
IConverter | convValDown | The IConverter to use to pass values down to the underlying cache. |
Properties
InvocableCache
The underlying IInvocableCache.
Declaration
public virtual IInvocableCache InvocableCache { get; }
Property Value
Type | Description |
---|---|
IInvocableCache | The underlying IInvocableCache. |
Methods
Aggregate(ICollection, IEntryAggregator)
Perform an aggregating operation against the entries specified by the passed keys.
Declaration
public virtual object Aggregate(ICollection keys, IEntryAggregator agent)
Parameters
Type | Name | Description |
---|---|---|
ICollection | keys | The collection of keys that specify the entries within this cache to aggregate across. |
IEntryAggregator | agent | The IEntryAggregator that is used to aggregate across the specified entries of this dictionary. |
Returns
Type | Description |
---|---|
object | The result of the aggregation. |
Aggregate(IFilter, IEntryAggregator)
Perform an aggregating operation against the collection of entries that are selected by the given IFilter.
Declaration
public virtual object Aggregate(IFilter filter, IEntryAggregator agent)
Parameters
Type | Name | Description |
---|---|---|
IFilter | filter | an IFilter that is used to select entries within this cache to aggregate across. |
IEntryAggregator | agent | The IEntryAggregator that is used to aggregate across the selected entries of this dictionary. |
Returns
Type | Description |
---|---|
object | The result of the aggregation. |
Invoke(object, IEntryProcessor)
Invoke the passed IEntryProcessor against the entry specified by the passed key, returning the result of the invocation.
Declaration
public virtual object Invoke(object key, IEntryProcessor agent)
Parameters
Type | Name | Description |
---|---|---|
object | key | The key to process; it is not required to exist within the dictionary. |
IEntryProcessor | agent | The IEntryProcessor to use to process the specified key. |
Returns
Type | Description |
---|---|
object | The result of the invocation as returned from the IEntryProcessor. |
InvokeAll(ICollection, IEntryProcessor)
Invoke the passed IEntryProcessor against the entries specified by the passed keys, returning the result of the invocation for each.
Declaration
public virtual IDictionary InvokeAll(ICollection keys, IEntryProcessor agent)
Parameters
Type | Name | Description |
---|---|---|
ICollection | keys | The keys to process; these keys are not required to exist within the dictionary. |
IEntryProcessor | agent | The IEntryProcessor to use to process the specified keys. |
Returns
Type | Description |
---|---|
IDictionary | A dictionary containing the results of invoking the IEntryProcessor against each of the specified keys. |
InvokeAll(IFilter, IEntryProcessor)
Invoke the passed IEntryProcessor against the set of entries that are selected by the given IFilter, returning the result of the invocation for each.
Declaration
public virtual IDictionary InvokeAll(IFilter filter, IEntryProcessor agent)
Parameters
Type | Name | Description |
---|---|---|
IFilter | filter | An IFilter that results in the collection of keys to be processed. |
IEntryProcessor | agent | The IEntryProcessor to use to process the specified keys. |
Returns
Type | Description |
---|---|
IDictionary | A dictionary containing the results of invoking the IEntryProcessor against the keys that are selected by the given IFilter. |
Remarks
Unless specified otherwise, IInvocableCache implementations will perform this operation in two steps: (1) use the filter to retrieve a matching entry collection; (2) apply the agent to every filtered entry. This algorithm assumes that the agent's processing does not affect the result of the specified filter evaluation, since the filtering and processing could be performed in parallel on different threads.
If this assumption does not hold, the processor logic has to be idempotent, or at least re-evaluate the filter. This could be easily accomplished by wrapping the processor with the ConditionalProcessor.