Options
All
  • Public
  • Public/Protected
  • All
Menu

Class PriorityAggregator<K, V, R>

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

For example, let's assume that there is an `Orders`` cache that belongs to a partitioned cache service configured with a *request-timeout* and *task-timeout* of 5 seconds. Also assume that we are willing to wait longer for a particular aggregation request that scans the entire cache. Then we could override the default timeout values by using the PriorityAggregator as follows:

const sumAggr = new SumAggregator('cost')
const priorityAgg = new PriorityAggregator(sumAggr)
priorityAgg.executionTimeout = Timeout.NONE
priorityAgg.requestTimeout = Timeout.NONE
cacheOrders.aggregate(aFilter, priorityAgg)

This is an advanced feature which should be used judiciously.

Type parameters

  • K = any

    the type of the Map entry keys

  • V = any

    the type of the Map entry values

  • R = any

    the type of the final result

Hierarchy

Index

Constructors

constructor

Properties

Protected @class

@class: string

Server-side EntryAggregator implementation type identifier.

Protected aggregator

aggregator: EntryAggregator<K, V, R>

The wrapped EntryAggregator.

Protected Optional extractor

extractor: ValueExtractor

The extractor.ValueExtractor to apply when aggregating results.

Accessors

executionTimeoutInMillis

  • get executionTimeoutInMillis(): number
  • set executionTimeoutInMillis(timeout: number): void
  • Return the execution timeout in milliseconds.

    Returns number

    the execution timeout in milliseconds

  • Sets the execution timeout.

    Parameters

    • timeout: number

      the new execution timeout in milliseconds

    Returns void

    the execution timeout in milliseconds

requestTimeoutInMillis

  • get requestTimeoutInMillis(): number
  • set requestTimeoutInMillis(timeout: number): void
  • Return the request timeout in milliseconds.

    Returns number

    the request timeout in milliseconds

  • Sets the request timeout.

    Parameters

    • timeout: number

      the new request timeout in milliseconds

    Returns void

    the request timeout in milliseconds

schedulingPriority

  • get schedulingPriority(): Schedule
  • set schedulingPriority(schedulingPriority: Schedule): void
  • Return the scheduling priority or, if not explicitly set, the default is Schedule.STANDARD.

    Returns Schedule

    the scheduling priority, if not explicitly set, the default is Schedule.STANDARD

  • Set the scheduling priority.

    Parameters

    • schedulingPriority: Schedule

      the scheduling priority

    Returns void

    the scheduling priority, if not explicitly set, the default is Schedule.STANDARD

Methods

andThen