Exemplo n.º 1
0
 /// <summary>
 /// Cancel a job in the benchmarksystem
 /// </summary>
 /// <param name="job">The job to cancel</param>
 public void Cancel(Job job)
 {
     //Notify subscribers
     if (JobCancelled != null)
     {
         JobCancelled(job);
     }
     scheduler.RemoveJob(job);
 }
Exemplo n.º 2
0
        //Adds a specific job to the correct queue
        public void AddJob(Job job)
        {
            job.State = JobState.Queued;
            job.TimeStamp = DateTime.Now;

            if(job.ExpectedRuntime < 30) {
                shortQueue.Enqueue(job);
            }
            else if(30 <= job.ExpectedRuntime && job.ExpectedRuntime <= 120){
                longQueue.Enqueue(job);
            }
            else{
                veryLongQueue.Enqueue(job);
            }
        }
Exemplo n.º 3
0
 //Remove a job from a specified queue
 public void RemoveJob(Job job)
 {
     job.State = JobState.Cancelled;
 }
Exemplo n.º 4
0
 public void OnJobTerminated(Job job)
 {
     Console.WriteLine(string.Format("Job terminated: {0}", job));
 }
Exemplo n.º 5
0
 public void OnJobSubmitted(Job job)
 {
     Console.WriteLine(string.Format("Job submitted: {0}", job));
 }
Exemplo n.º 6
0
 public void OnJobRunning(Job job)
 {
     Console.WriteLine(string.Format("Job running: {0}", job));
 }
Exemplo n.º 7
0
 public void OnJobFailed(Job job)
 {
     Console.WriteLine(string.Format("Job failed: {0}", job));
 }
Exemplo n.º 8
0
 public void OnJobCancelled(Job job)
 {
     Console.WriteLine(string.Format("Job cancelled: {0}", job));
 }
Exemplo n.º 9
0
 /// <summary>
 /// Submit a job to the benchmarksystem
 /// </summary>
 /// <param name="job">The job to submit</param>
 public void Submit(Job job)
 {
     //Notify subscribers
     if (JobSubmitted != null)
     {
         JobSubmitted(job);
     }
     scheduler.AddJob(job);
 }