Show / Hide Table of Contents

Class PriorityProcessor

PriorityProcessor is used to explicitly control the scheduling priority and timeouts for execution of IEntryProcessor -based methods.

Inheritance
object
AbstractPriorityTask
PriorityProcessor
Implements
IPriorityTask
IEntryProcessor
IPortableObject
Inherited Members
AbstractPriorityTask.SchedulingPriority
AbstractPriorityTask.ExecutionTimeoutMillis
AbstractPriorityTask.RequestTimeoutMillis
AbstractPriorityTask.RunCanceled(bool)
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
Namespace: Tangosol.Util.Processor
Assembly: Coherence.dll
Syntax
public class PriorityProcessor : AbstractPriorityTask, IPriorityTask, IEntryProcessor, IPortableObject
Remarks

For example, let's assume that there is a cache that belongs to a partitioned cache service configured with a task-timeout of 5 seconds. Also assume that there is a particular PreloadRequest processor that could take much longer to complete due to a large amount of database related processing. Then we could override the default task timeout value by using the PriorityProcessor as follows:

PreloadRequest     procStandard = PreloadRequest.Instance;
PriorityProcessor  procPriority = new PriorityProcessor(procStandard);
procPriority.ExecutionTimeoutMillis = PriorityTaskTimeout.None;
cache.ProcessAll(keys, procPriority);

This is an advanced feature which should be used judiciously.

Constructors

PriorityProcessor()

Default constructor.

Declaration
public PriorityProcessor()

PriorityProcessor(IEntryProcessor)

Construct a PriorityProcessor.

Declaration
public PriorityProcessor(IEntryProcessor processor)
Parameters
Type Name Description
IEntryProcessor processor

The processor wrapped by this PriorityProcessor.

Properties

Processor

Obtain the underlying processor.

Declaration
public IEntryProcessor Processor { get; }
Property Value
Type Description
IEntryProcessor

The processor wrapped by this PriorityProcessor.

Methods

Process(IInvocableCacheEntry)

Process an IInvocableCacheEntry.

Declaration
public object Process(IInvocableCacheEntry entry)
Parameters
Type Name Description
IInvocableCacheEntry entry

The IInvocableCacheEntry to process.

Returns
Type Description
object

The result of the processing, if any.

ProcessAll(ICollection)

Process a collection of IInvocableCacheEntry objects.

Declaration
public IDictionary ProcessAll(ICollection entries)
Parameters
Type Name Description
ICollection entries

A read-only collection of IInvocableCacheEntry objects to process.

Returns
Type Description
IDictionary

A dictionary containing the results of the processing, up to one entry for each IInvocableCacheEntry that was processed, keyed by the keys of the dictionary that were processed, with a corresponding value being the result of the processing for each key.

Remarks

This method is semantically equivalent to:

IDictionary results = new Hashtable();
foreach (IInvocableCacheEntry entry in entries)
{
    results[entry.Key] = Process(entry);
}
return results;

ReadExternal(IPofReader)

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

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

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

Overrides
AbstractPriorityTask.ReadExternal(IPofReader)
Remarks

This implementation reserves property index 10.

Exceptions
Type Condition
IOException

If an I/O error occurs.

ToString()

Return a human-readable description for this PriorityProcessor.

Declaration
public override string ToString()
Returns
Type Description
string

A string description of the PriorityProcessor.

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 override void WriteExternal(IPofWriter writer)
Parameters
Type Name Description
IPofWriter writer

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

Overrides
AbstractPriorityTask.WriteExternal(IPofWriter)
Remarks

This implementation reserves property index 10.

Exceptions
Type Condition
IOException

If an I/O error occurs.

Implements

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