Show / Hide Table of Contents

Class WorkUnit

Models atomic (not decomposable) work

Inheritance
System.Object
FlowModelObject
WorkItem
WorkUnit
Implements
IFlowModelItem
IWorkUnit
Inherited Members
WorkItem.Tag
WorkItem.JobId
WorkItem.ParentId
WorkItem.Id
WorkItem.GetParent()
WorkItem.Select<T>(Func<WorkItem, T>)
WorkItem.Traverse(Action<WorkItem, WorkItem>, WorkItem)
WorkItem.FindItems(Func<WorkItem, Boolean>, Boolean)
WorkItem.OnInitialize(Job)
WorkItem.ToString()
FlowModelObject.BatchNumber
FlowModelObject.Properties
FlowModelObject.PropertiesContent
FlowModelObject.Item[String]
FlowModelObject.UpdateProperties(String)
Namespace: DNVGL.One.Compute.Core.FlowModel
Assembly: DNVGL.One.Compute.Core.dll
Syntax
public class WorkUnit : WorkItem, IFlowModelItem, IWorkUnit

Constructors

View Source

WorkUnit()

Initializes a new instance of the WorkUnit class.

Declaration
public WorkUnit()
View Source

WorkUnit(Object)

Initializes a new instance of the WorkUnit class.

Declaration
public WorkUnit(object input)
Parameters
Type Name Description
System.Object input

The input to the work unit.

Properties

View Source

Command

Gets or sets the command.

Declaration
public string Command { get; set; }
Property Value
Type Description
System.String

The command.

Remarks

This may be used by the application to control the work scheduling code.

View Source

Data

Gets or sets the container of input data.

Declaration
public DataContainer Data { get; set; }
Property Value
Type Description
DataContainer

The data container of the input data.

View Source

Dependencies

Gets or sets the dependencies.

Declaration
public List<string> Dependencies { get; set; }
Property Value
Type Description
List<System.String>

The dependencies.

Remarks

List of ids of WorkUnits that this work unit depends on.

View Source

InputFiles

Gets or sets the resources.

Declaration
public List<string> InputFiles { get; set; }
Property Value
Type Description
List<System.String>

The resources.

View Source

IsReductionTask

Gets or sets a value indicating whether this work unit is a reduction task for the parent.

Declaration
public bool IsReductionTask { get; set; }
Property Value
Type Description
System.Boolean

true if this work unit is reduction task for the parent; otherwise, false.

View Source

OutputFiles

Gets or sets the output files.

Declaration
public List<DataTransferSpecification> OutputFiles { get; set; }
Property Value
Type Description
List<DataTransferSpecification>

The output files.

View Source

Request

Gets or sets the application request.

Declaration
public string Request { get; set; }
Property Value
Type Description
System.String

The application request.

Remarks

This property can be used by the client application to communicate an application specific request to the application worker. It is not used by One Compute.

View Source

SchedulerId

Gets or sets the scheduler identifier.

Declaration
public string SchedulerId { get; set; }
Property Value
Type Description
System.String

The scheduler identifier.

View Source

StatusUpdateFrequency

Gets or sets the status update frequency in seconds.

Declaration
public int StatusUpdateFrequency { get; set; }
Property Value
Type Description
System.Int32
View Source

WorkerContractName

Gets or sets the name of the IWorker export contract.

Declaration
public string WorkerContractName { get; set; }
Property Value
Type Description
System.String

The name of the IWorker export contract or null as default

Remarks

Optionally, a discriminator that constrains the selection of the IWorker export for executing this work unit. The standard empty string will just expect a single worker to be located within the working directory. It is valid to leave this field as null. This is only required if you want to support multiple named MEF IWorker's through a single Worker Host.

Methods

View Source

AddDependencies(WorkUnit[])

Adds dependencies to the specified work units.

Declaration
public void AddDependencies(params WorkUnit[] dependencies)
Parameters
Type Name Description
WorkUnit[] dependencies

The dependencies.

View Source

AddDependency(WorkUnit)

Adds a dependency to the specified work unit.

Declaration
public void AddDependency(WorkUnit dependency)
Parameters
Type Name Description
WorkUnit dependency

The dependency.

View Source

GetDescendants()

Gets the descendants.

Declaration
public override IEnumerable<WorkItem> GetDescendants()
Returns
Type Description
IEnumerable<WorkItem>

Descendant items

Overrides
WorkItem.GetDescendants()
View Source

GetInput<T>()

Gets the input for the work unit.

Declaration
public T GetInput<T>()
    where T : class
Returns
Type Description
T

The work unit input

Type Parameters
Name Description
T

Input type

Implements

IFlowModelItem
IWorkUnit

Extension Methods

WorkItemExtensions.GetRelativeWeight(WorkItem, WorkItem)
WorkItemExtensions.GetAncestors(WorkItem, WorkItem)
WorkItemExtensions.GetDependencies(WorkUnit)
  • View Source
Back to top Copyright © DNV GL AS. All rights reserved.