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
System.Object
AbstractExtractor
PofExtractor
Implements
IValueExtractor
IQueryCacheComparer
System.Collections.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
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: Tangosol.Util.Extractor
Assembly: Coherence.Core.dll
Syntax
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

| Improve this Doc View Source

PofExtractor()

Default constructor.

Declaration
public PofExtractor()
| Improve this Doc View Source

PofExtractor(Type, Int32)

Constructs a PofExtractor based on a property index.

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

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

System.Int32 index

Property index.

Remarks

This constructor is equivalent to:

PofExtractor extractor = 
    new PofExtractor(type, new SimplePofPath(index), VALUE);
| Improve this Doc View Source

PofExtractor(Type, IPofNavigator)

Constructs a PofExtractor based on a POF navigator.

Declaration
public PofExtractor(Type type, IPofNavigator navigator)
Parameters
Type Name Description
System.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.

| Improve this Doc View Source

PofExtractor(Type, IPofNavigator, Int32)

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
System.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.

System.Int32 target

One of the VALUE or KEY values.

Properties

| Improve this Doc View Source

Navigator

Obtain the IPofNavigator for this extractor.

Declaration
public IPofNavigator Navigator { get; }
Property Value
Type Description
IPofNavigator
| Improve this Doc View Source

TypeExtracted

Obtain the type of the extracted value.

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

The expected type.

Methods

| Improve this Doc View Source

Equals(Object)

Compare the PofExtractor with another object to determine equality.

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

Object to compare with

Returns
Type Description
System.Boolean

true iff this PofExtractor and the passed object are equivalent

Overrides
System.Object.Equals(System.Object)
Remarks

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

| Improve this Doc View Source

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
System.Object

The extracted value

Overrides
AbstractExtractor.ExtractFromEntry(ICacheEntry)
Remarks

This method will always throw a System.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
System.NotSupportedException

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

| Improve this Doc View Source

GetHashCode()

Determine a hash value for the PofExtractor object.

Declaration
public override int GetHashCode()
Returns
Type Description
System.Int32

An integer hash value for this PofExtractor object

Overrides
System.Object.GetHashCode()
| Improve this Doc View Source

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
System.Int32

Pof type id or Tangosol.IO.Pof.PofConstants.T_UNKNOWN if the type is null.

| Improve this Doc View Source

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
System.IO.IOException

If an I/O error occurs.

| Improve this Doc View Source

ToString()

Return a human-readable description for this PofExtractor.

Declaration
public override string ToString()
Returns
Type Description
System.String

String description of the PofExtractor

Overrides
System.Object.ToString()
| Improve this Doc View Source

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
System.IO.IOException

If an I/O error occurs.

Implements

IValueExtractor
IQueryCacheComparer
System.Collections.IComparer
IPortableObject
  • Improve this Doc
  • View Source
In This Article
Back to top Copyright © 2000, 2020, Oracle and/or its affiliates. All rights reserved.