Class JobOrchestratorBase
Base class for job orchestrators.
Implements
Namespace: DNVGL.One.Compute.Scheduling.Scheduler
Assembly: DNVGL.One.Compute.Scheduling.dll
Syntax
public abstract class JobOrchestratorBase : object, IJobOrchestrator
Constructors
View SourceJobOrchestratorBase(IJobEventPublisher, ILogger, IWorkScheduler, IWorkItemStatusService, IJobStatusService, IFlowModelStorageService<WorkItem>)
Initializes a new instance of the JobOrchestratorBase class.
Declaration
protected JobOrchestratorBase(IJobEventPublisher eventPublisher, ILogger logger, IWorkScheduler scheduler, IWorkItemStatusService taskStatusService, IJobStatusService jobStatusService, IFlowModelStorageService<WorkItem> workItemStorageService)
Parameters
Type | Name | Description |
---|---|---|
IJobEventPublisher | eventPublisher | The monitor. |
ILogger | logger | The logger. |
IWorkScheduler | scheduler | The scheduler. |
IWorkItemStatusService | taskStatusService | The task status service. |
IJobStatusService | jobStatusService | The job status service. |
IFlowModelStorageService<WorkItem> | workItemStorageService | The work item storage service. |
Properties
View SourceCancellationToken
Gets the cancellation token.
Declaration
protected CancellationToken CancellationToken { get; }
Property Value
Type | Description |
---|---|
CancellationToken | The cancellation token. |
JobEventPublisher
Gets the job event publisher.
Declaration
protected IJobEventPublisher JobEventPublisher { get; }
Property Value
Type | Description |
---|---|
IJobEventPublisher | The job event publisher. |
JobStatusService
Gets the job status service.
Declaration
protected IJobStatusService JobStatusService { get; }
Property Value
Type | Description |
---|---|
IJobStatusService | The job status service. |
Logger
Gets the logger.
Declaration
protected ILogger Logger { get; }
Property Value
Type | Description |
---|---|
ILogger | The logger. |
TaskMonitoringInterval
Gets or sets the task status monitoring interval (in seconds).
Declaration
public int TaskMonitoringInterval { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The task status monitoring interval (in seconds). |
WorkItemStatusService
Gets the work item status service.
Declaration
protected IWorkItemStatusService WorkItemStatusService { get; }
Property Value
Type | Description |
---|---|
IWorkItemStatusService | The work item status service. |
WorkItemStorageService
Gets the work item storage service.
Declaration
protected IFlowModelStorageService<WorkItem> WorkItemStorageService { get; }
Property Value
Type | Description |
---|---|
IFlowModelStorageService<WorkItem> | The work item storage service. |
WorkScheduler
Gets the work scheduler.
Declaration
protected IWorkScheduler WorkScheduler { get; }
Property Value
Type | Description |
---|---|
IWorkScheduler | The work scheduler. |
Methods
View SourceCancelWork(String)
Cancels ongoing work for the specified job.
Declaration
public void CancelWork(string jobId)
Parameters
Type | Name | Description |
---|---|---|
System.String | jobId | The job identifier to cancel. |
FinalizeJob(Job, WorkStatus, String)
Finalizes the job.
Declaration
protected void FinalizeJob(Job job, WorkStatus state, string message)
Parameters
Type | Name | Description |
---|---|---|
Job | job | The job. |
WorkStatus | state | The state. |
System.String | message | The message. |
InitializeJob(Job)
Initializes the job.
Declaration
protected void InitializeJob(Job job)
Parameters
Type | Name | Description |
---|---|---|
Job | job | The job. |
IsCancelled()
Determines whether work is cancelled.
Declaration
protected bool IsCancelled()
Returns
Type | Description |
---|---|
System.Boolean |
|
LogActivity(String, String, String, String, String, String, DateTime, Boolean)
Logs the activity.
Declaration
protected void LogActivity(string sender, string eventName, string jobId, string groupId, string taskId, string nodeInfo, DateTime timestamp, bool isDetailed = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | sender | The sender. |
System.String | eventName | Name of the event. |
System.String | jobId | The job identifier. |
System.String | groupId | The group identifier. |
System.String | taskId | The task identifier. |
System.String | nodeInfo | The node information. |
DateTime | timestamp | The timestamp. |
System.Boolean | isDetailed | if set to |
Remarks
The isDetailed
flag allows a logger to filter out details from the log and only log the essential information.
Work(Job)
Orchestrate the job.
Declaration
public abstract void Work(Job job)
Parameters
Type | Name | Description |
---|---|---|
Job | job | The job. |
Events
View SourceJobTerminated
Occurs when a job has terminated.
Declaration
public event EventHandler<JobEventArgs> JobTerminated
Event Type
Type | Description |
---|---|
EventHandler<JobEventArgs> |