Show / Hide Table of Contents

Class ConditionalIndex

ConditionalIndex is an ICacheIndex implementation that uses an associated filter to evaluate whether or not an entry should be indexed. An entry's extracted value is only added to the index if the filter evaluates to true.

Inheritance
object
SimpleCacheIndex
ConditionalIndex
Implements
ICacheIndex
Inherited Members
SimpleCacheIndex.ValueExtractor
SimpleCacheIndex.IsOrdered
SimpleCacheIndex.Comparer
SimpleCacheIndex.IndexContents
SimpleCacheIndex.IndexForward
SimpleCacheIndex.Insert(ICacheEntry)
SimpleCacheIndex.Update(ICacheEntry)
SimpleCacheIndex.Delete(ICacheEntry)
SimpleCacheIndex.Initialize(bool)
SimpleCacheIndex.ExtractNewValue(ICacheEntry)
SimpleCacheIndex.ExtractOldValue(CacheEntry)
SimpleCacheIndex.EnsureCollection(object)
SimpleCacheIndex.InstatiateInverseIndex(bool, IComparer)
SimpleCacheIndex.AddInverseMapping(object, object)
SimpleCacheIndex.AddInverseMapping(IDictionary, object, object)
SimpleCacheIndex.AddInverseCollectionMapping(IDictionary, ICollection, object)
SimpleCacheIndex.RemoveInverseMapping(object, object, ICollection)
SimpleCacheIndex.RemoveInverseMapping(object, object)
SimpleCacheIndex.RemoveInverseMapping(IDictionary, object, object)
SimpleCacheIndex.CollectRemoved(object, object)
SimpleCacheIndex.LogMissingIdx(object, object)
SimpleCacheIndex.UpdateExcludedKeys(ICacheEntry, bool)
SimpleCacheIndex.IsKeyExcluded(object)
SimpleCacheIndex.Equals(object)
SimpleCacheIndex.GetHashCode()
SimpleCacheIndex.NO_VALUE
SimpleCacheIndex.m_splitCollection
SimpleCacheIndex.m_ldtLogMissingIdx
SimpleCacheIndex.m_cLogMissingIdx
SimpleCacheIndex.m_keysExcluded
SimpleCacheIndex.m_fImmutableValues
object.Equals(object, object)
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
Namespace: Tangosol.Net.Cache
Assembly: Coherence.dll
Syntax
public class ConditionalIndex : SimpleCacheIndex, ICacheIndex

Constructors

ConditionalIndex(IFilter, IValueExtractor, bool, IComparer, bool)

Construct a ConditionalIndex.

Declaration
public ConditionalIndex(IFilter filter, IValueExtractor extractor, bool ordered, IComparer comparer, bool forwardIndex)
Parameters
Type Name Description
IFilter filter

the filter that is used to evaluate the entries of the resource cache that is being indexed.

IValueExtractor extractor

the IValueExtractor that is used to extract an indexed value from a resource cache entry.

bool ordered

true iff the contents of the indexed information should be ordered; false otherwise.

IComparer comparer

the IComparer object which imposes an ordering on entries in the index; or null if the entries' values natural ordering should be used.

bool forwardIndex

specifies whether or not this index supports a forward map

Properties

Filter

Get the associated filter.

Declaration
public virtual IFilter Filter { get; }
Property Value
Type Description
IFilter

The filter.

IsForwardIndexSupported

Determine whether or not this ConditionalIndex supports a forward index.

Declaration
public bool IsForwardIndexSupported { get; }
Property Value
Type Description
bool

true if this ConditionalIndex supports a forward index; false otherwise.

IsPartial

Determine if indexed information for any entry in the indexed ICache has been excluded from this index. This information is used by IIndexAwareFilter implementations to determine the most optimal way to apply the index.

Declaration
public override bool IsPartial { get; }
Property Value
Type Description
bool

true if any entry of the indexed ICache has been excluded from the index, false otherwise

Overrides
SimpleCacheIndex.IsPartial

Methods

DeleteInternal(ICacheEntry)

Update this index in response to a delete operation on a cache.

Declaration
protected override void DeleteInternal(ICacheEntry entry)
Parameters
Type Name Description
ICacheEntry entry

The entry representing the object being inserted.

Overrides
SimpleCacheIndex.DeleteInternal(ICacheEntry)

Equals(SimpleCacheIndex)

Compares this index with another index for equality.

Declaration
public override bool Equals(SimpleCacheIndex index)
Parameters
Type Name Description
SimpleCacheIndex index

index to compare this index with.

Returns
Type Description
bool

true if the two indexes are equal; false otherwise.

Overrides
SimpleCacheIndex.Equals(SimpleCacheIndex)
Remarks

This method returns true if this index and the specified index have exactly the same contents.

EvaluateEntry(ICacheEntry)

Evaluate the given entry using this index's filter. If the entry does not pass the filter then it should be excluded from this index, making this a partial index.

Declaration
protected virtual bool EvaluateEntry(ICacheEntry entry)
Parameters
Type Name Description
ICacheEntry entry

The entry to evaluate.

Returns
Type Description
bool

true If the entry passes the filter, false otherwise.

Get(object)

Using the index information if possible, get the value associated with the specified key. This is expected to be more efficient than using the IValueExtractor against an object containing the value, because the index should already have the necessary information at hand.

Declaration
public override object Get(object key)
Parameters
Type Name Description
object key

The key that specifies the object to extract the value from.

Returns
Type Description
object

The value that would be extracted by this ICacheIndex's IValueExtractor from the object specified by the passed key; NO_VALUE if the index does not have the necessary information.

Overrides
SimpleCacheIndex.Get(object)

GetForwardValue(object)

Get the forward index value associated with the specified key.

Declaration
protected override object GetForwardValue(object key)
Parameters
Type Name Description
object key

The key.

Returns
Type Description
object

The value associated with the key.

Overrides
SimpleCacheIndex.GetForwardValue(object)

InsertInternal(ICacheEntry)

Update this index in response to a insert operation on a cache.

Declaration
protected override void InsertInternal(ICacheEntry entry)
Parameters
Type Name Description
ICacheEntry entry

The entry representing the object being inserted.

Overrides
SimpleCacheIndex.InsertInternal(ICacheEntry)

InstantiateForwardIndex()

Instantiate the forward index.

Declaration
protected override IDictionary InstantiateForwardIndex()
Returns
Type Description
IDictionary

The forward index.

Overrides
SimpleCacheIndex.InstantiateForwardIndex()

RemoveForwardEntry(object)

Remove the forward index entry for the specified key.

Declaration
protected override void RemoveForwardEntry(object key)
Parameters
Type Name Description
object key

The key to remove the forward index entry for.

Overrides
SimpleCacheIndex.RemoveForwardEntry(object)

ToString()

Returns string representation of this instance.

Declaration
public override string ToString()
Returns
Type Description
string

String representation of this instance.

Overrides
SimpleCacheIndex.ToString()

UpdateInternal(ICacheEntry)

Update this index in response to a update operation on a cache.

Declaration
protected override void UpdateInternal(ICacheEntry entry)
Parameters
Type Name Description
ICacheEntry entry

The entry representing the object being updated.

Overrides
SimpleCacheIndex.UpdateInternal(ICacheEntry)

Implements

ICacheIndex
In this article
Back to top Copyright © 2000, 2024, Oracle and/or its affiliates.