Show / Hide Table of Contents

Class PofExtractor

POF-based IValueExtractor implementation. PofExtractor takes advantage of POF's indexed state to extract part of an object without needing to deserialize the entire object.

Inheritance
object
AbstractExtractor
PofExtractor
Implements
IValueExtractor
IQueryCacheComparer
IComparer
IPortableObject
Inherited Members
AbstractExtractor.Target
AbstractExtractor.Extract(object)
AbstractExtractor.Compare(object, object)
AbstractExtractor.CompareEntries(IQueryCacheEntry, IQueryCacheEntry)
AbstractExtractor.ExtractOriginalFromEntry(CacheEntry)
AbstractExtractor.VALUE
AbstractExtractor.KEY
AbstractExtractor.m_target
object.Equals(object, object)
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
Namespace: Tangosol.Util.Extractor
Assembly: Coherence.dll
Syntax
[Serializable]
public class PofExtractor : AbstractExtractor, IValueExtractor, IQueryCacheComparer, IComparer, IPortableObject
Remarks

POF uses a compact form in the serialized value when possible. For example, some numeric values are represented as special POF intrinsic types in which the type implies the value. As a result, POF requires the receiver of a value to have implicit knowledge of the type. PofExtractor uses the type supplied in the constructor as the source of the type information. If the type is null, PofExtractor will infer the type from the serialized state. Example where extracted value is Double:

IValueExtractor extractor = new PofExtractor(typeof(Double), 2);

Example where extracted value should be inferred:

IValueExtractor extractor = new PofExtractor(null, 2);

Constructors

PofExtractor()

Default constructor.

Declaration
public PofExtractor()

PofExtractor(Type, int)

Constructs a PofExtractor based on a property index.

Declaration
public PofExtractor(Type type, int index)
Parameters
Type Name Description
Type type

The required type of the extracted value or null if the type is to be inferred from the serialized state.

int index

Property index.

Remarks

This constructor is equivalent to:

PofExtractor extractor = 
    new PofExtractor(type, new SimplePofPath(index), VALUE);

PofExtractor(Type, IPofNavigator)

Constructs a PofExtractor based on a POF navigator.

Declaration
public PofExtractor(Type type, IPofNavigator navigator)
Parameters
Type Name Description
Type type

The required type of the extracted value or null if the type is to be inferred from the serialized state.

IPofNavigator navigator

POF navigator.

PofExtractor(Type, IPofNavigator, int)

Constructs a PofExtractor based on a POF navigator and the entry extraction target.

Declaration
public PofExtractor(Type type, IPofNavigator navigator, int target)
Parameters
Type Name Description
Type type

The required type of the extracted value or null if the type is to be inferred from the serialized state.

IPofNavigator navigator

POF navigator.

int target

One of the VALUE or KEY values.

Properties

Navigator

Obtain the IPofNavigator for this extractor.

Declaration
public IPofNavigator Navigator { get; }
Property Value
Type Description
IPofNavigator

TypeExtracted

Obtain the type of the extracted value.

Declaration
public Type TypeExtracted { get; }
Property Value
Type Description
Type

The expected type.

Methods

Equals(object)

Compare the PofExtractor with another object to determine equality.

Declaration
public override bool Equals(object o)
Parameters
Type Name Description
object o

Object to compare with

Returns
Type Description
bool

true iff this PofExtractor and the passed object are equivalent

Overrides
object.Equals(object)
Remarks

Two PofExtractor objects are considered equal iff their paths are equal and they have the same target (key or value).

ExtractFromEntry(ICacheEntry)

Extracts the value from the passed ICacheEntry object.

Declaration
public override object ExtractFromEntry(ICacheEntry entry)
Parameters
Type Name Description
ICacheEntry entry

An Entry object to extract a value from

Returns
Type Description
object

The extracted value

Overrides
AbstractExtractor.ExtractFromEntry(ICacheEntry)
Remarks

This method will always throw a NotSupportedException if called directly by the .NET client application, as its execution is only meaningful within the cluster.

It is expected that this extractor will only be used against POF-encoded binary entries within a remote partitioned cache.
Exceptions
Type Condition
NotSupportedException

Always, as it is expected that this extractor will only be executed within the cluster.

GetHashCode()

Determine a hash value for the PofExtractor object.

Declaration
public override int GetHashCode()
Returns
Type Description
int

An integer hash value for this PofExtractor object

Overrides
object.GetHashCode()

GetPofTypeId(IPofContext)

Compute the expected pof type id based on the type.

Declaration
protected int GetPofTypeId(IPofContext ctx)
Parameters
Type Name Description
IPofContext ctx

Pof context.

Returns
Type Description
int

Pof type id or T_UNKNOWN if the type is null.

ReadExternal(IPofReader)

Restore the contents of a user type instance by reading its state using the specified IPofReader object.

Declaration
public void ReadExternal(IPofReader reader)
Parameters
Type Name Description
IPofReader reader

The IPofReader from which to read the object's state.

Exceptions
Type Condition
IOException

If an I/O error occurs.

ToString()

Return a human-readable description for this PofExtractor.

Declaration
public override string ToString()
Returns
Type Description
string

String description of the PofExtractor

Overrides
object.ToString()

WriteExternal(IPofWriter)

Save the contents of a POF user type instance by writing its state using the specified IPofWriter object.

Declaration
public void WriteExternal(IPofWriter writer)
Parameters
Type Name Description
IPofWriter writer

The IPofWriter to which to write the object's state.

Exceptions
Type Condition
IOException

If an I/O error occurs.

Implements

IValueExtractor
IQueryCacheComparer
IComparer
IPortableObject
In this article
Back to top Copyright © 2000, 2024, Oracle and/or its affiliates.