Oracle® Coherence .NET API Reference Release 3.7.1
E22844-03
Assembly: Coherence (in Coherence.dll) Version: 3.7.1.23 (3.7.1.23)
System..::.Object
Tangosol.Util.Processor..::.AbstractProcessor
Tangosol.Util.Processor..::.ConditionalRemove
E22844-03
ConditionalRemove is an IEntryProcessor that
performs an Remove(Boolean)
operation if the specified condition is satisfied.
Namespace:
Tangosol.Util.ProcessorAssembly: Coherence (in Coherence.dll) Version: 3.7.1.23 (3.7.1.23)
Syntax
| C# |
|---|
public class ConditionalRemove : AbstractProcessor, IPortableObject |
Remarks
While the ConditionalRemove processing could be implemented via direct key-based IQueryCache operations, it is more efficient and enforces concurrency control without explicit locking.
For example, the following operations are functionally similar, but the IInvocableDictionary versions (a) perform significantly better for partitioned caches; (b) provide all necessary concurrency control (which is ommited from the IQueryCache examples):
| IInvocableCache | IQueryCache |
|---|---|
| cache.invoke(key, new ConditionalRemove(filter)); | if (filter.Evaluate(cache[key]) cache.Remove(key); |
| cache.InvokeAll(colKeys, new ConditionalRemove(filter)); | foreach (object key in colKeys) if (filter.Evaluate(cache.[key]) cache.Remove(key); |
| cache.InvokeAll(filter1, new ConditionalRemove(filter2); | foreach (object key in cache.GetKeys(filter1)) if (filter2.Evaluate(cache[key]) cache.Remove(key); |
| cache.InvokeAll(filter, new ConditionalRemove(AlwaysFilter.INSTANCE)); | ICollection colKeys = cache.GetKeys(filter); cache.Keys.RemoveAll(colKeys); |
Inheritance Hierarchy
Tangosol.Util.Processor..::.AbstractProcessor
Tangosol.Util.Processor..::.ConditionalRemove