MatchingCoordinatorTInput, TCategory, TWorkStub, TWorkDescription, TWorkerDescription ClassNaiad Help

[This is preliminary documentation and is subject to change.]

A coordinator that assigns work items to zero or more matching workers. When a worker is free, it is assigned a matching item if there is one, otherwise it is assigned an item that matched to no workers if there is one, otherwise it is assigned an item from a worker that has the maximal number of remaining unassigned items.
Inheritance Hierarchy

SystemObject
  Microsoft.Research.Naiad.Frameworks.WorkGeneratorMatchingCoordinatorTInput, TCategory, TWorkStub, TWorkDescription, TWorkerDescription
    Microsoft.Research.Naiad.Frameworks.Storage.DfsDfsBaseCoordinatorTWorkDescription

Namespace: Microsoft.Research.Naiad.Frameworks.WorkGenerator
Assembly: Microsoft.Research.Naiad.WorkGenerator (in Microsoft.Research.Naiad.WorkGenerator.dll) Version: 0.5.0.0 (0.5.0.0)
Syntax

C#
public abstract class MatchingCoordinator<TInput, TCategory, TWorkStub, TWorkDescription, TWorkerDescription> : ICoordinator<TInput, TWorkDescription, TWorkerDescription>

Type Parameters

TInput
Type of an input record: each input expands to some number of work items
TCategory
Type of a work item category
TWorkStub
Type of a work item stub, expanded to a work item once the worker is chosen
TWorkDescription
Type of a work item description
TWorkerDescription
Type of a worker description: this is translated to a TQueueKey to find a match

The MatchingCoordinatorTInput, TCategory, TWorkStub, TWorkDescription, TWorkerDescription type exposes the following members.

Constructors

  NameDescription
Public methodMatchingCoordinatorTInput, TCategory, TWorkStub, TWorkDescription, TWorkerDescription
Create a new MatchingCoordinator
Top
Methods

  NameDescription
Public methodAddInput
Implements ICoordinator.AddInput. Takes an input record and calls the user-supplied function provided in the constructor, to translate the input into a set of work items, each of which is annotated with a list of zero or more categories. As workers become ready, their work will be assigned from these items.
Public methodAssignWork
Implements ICoordinator.AssignWork. Given a worker that is now free, assign it a work item if any remain. If there is an item matching the worker it will be returned; otherwise if there is an item that wasn't matched to any worker it will be returned; otherwise an item from another category's queue that has a maximal number of pending items will be returned. If there are no items remaining to be assigned, this returns false.
Protected methodEnumerateWork
Given an input item, return a list of work items, each with a list of categories
Protected methodExpandWorkItem
Convert a work item stub to a work item once it is known which category, if any, it was matched to
Protected methodMapWorkerToQueue
Given a worker, return a matching queue from this.waitingWork (and fill in its key to categoryKey) or null if there is no matching queue
Protected methodNotifyQueueAddition
called whenever a new worker queue is added
Protected methodNotifyQueueRemoval
called whenever an existing worker queue becomes empty and is deleted
Top
Fields

  NameDescription
Protected fieldwaitingWork
For each category with outstanding work, a queue of unused matches. There is an invariant that every value in this dictionary has Count greater than 0
Top
See Also

Reference