Class WorkUnit
Models atomic (not decomposable) work
Inherited Members
Namespace: DNVGL.One.Compute.Core.FlowModel
Assembly: DNVGL.One.Compute.Core.dll
Syntax
public class WorkUnit : WorkItem, IFlowModelItem, IWorkUnit
Constructors
View SourceWorkUnit()
Initializes a new instance of the WorkUnit class.
Declaration
public WorkUnit()
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 SourceCommand
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.
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. |
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.
InputFiles
Gets or sets the resources.
Declaration
public List<string> InputFiles { get; set; }
Property Value
| Type | Description |
|---|---|
| List<System.String> | The resources. |
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 |
|
OutputFiles
Gets or sets the output files.
Declaration
public List<DataTransferSpecification> OutputFiles { get; set; }
Property Value
| Type | Description |
|---|---|
| List<DataTransferSpecification> | The output files. |
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.
SchedulerId
Gets or sets the scheduler identifier.
Declaration
public string SchedulerId { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | The scheduler identifier. |
StatusUpdateFrequency
Gets or sets the status update frequency in seconds.
Declaration
public int StatusUpdateFrequency { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
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 SourceAddDependencies(WorkUnit[])
Adds dependencies to the specified work units.
Declaration
public void AddDependencies(params WorkUnit[] dependencies)
Parameters
| Type | Name | Description |
|---|---|---|
| WorkUnit[] | dependencies | The dependencies. |
AddDependency(WorkUnit)
Adds a dependency to the specified work unit.
Declaration
public void AddDependency(WorkUnit dependency)
Parameters
| Type | Name | Description |
|---|---|---|
| WorkUnit | dependency | The dependency. |
GetDescendants()
Gets the descendants.
Declaration
public override IEnumerable<WorkItem> GetDescendants()
Returns
| Type | Description |
|---|---|
| IEnumerable<WorkItem> | Descendant items |
Overrides
View SourceGetInput<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 |