1 | #region License Information
|
---|
2 | /* HeuristicLab
|
---|
3 | * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
|
---|
4 | *
|
---|
5 | * This file is part of HeuristicLab.
|
---|
6 | *
|
---|
7 | * HeuristicLab is free software: you can redistribute it and/or modify
|
---|
8 | * it under the terms of the GNU General Public License as published by
|
---|
9 | * the Free Software Foundation, either version 3 of the License, or
|
---|
10 | * (at your option) any later version.
|
---|
11 | *
|
---|
12 | * HeuristicLab is distributed in the hope that it will be useful,
|
---|
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
15 | * GNU General Public License for more details.
|
---|
16 | *
|
---|
17 | * You should have received a copy of the GNU General Public License
|
---|
18 | * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
|
---|
19 | */
|
---|
20 | #endregion
|
---|
21 |
|
---|
22 | using System;
|
---|
23 | using System.Collections.Generic;
|
---|
24 | using HeuristicLab.Core;
|
---|
25 | using HeuristicLab.Common;
|
---|
26 |
|
---|
27 | namespace HeuristicLab.Hive {
|
---|
28 | public interface IJob : INamedItem {
|
---|
29 | TimeSpan ExecutionTime { get; }
|
---|
30 |
|
---|
31 | ExecutionState ExecutionState { get; }
|
---|
32 |
|
---|
33 | /// <summary>
|
---|
34 | /// indicates wether it is possible to create childjobs from this job
|
---|
35 | /// </summary>
|
---|
36 | bool IsParallelizable { get; }
|
---|
37 |
|
---|
38 | /// <summary>
|
---|
39 | /// Configuration to indicate if this job should create child-jobs which will be executed in hive
|
---|
40 | /// Cannot be set true if IsParallelizable is false
|
---|
41 | /// </summary>
|
---|
42 | bool ComputeInParallel { get; set; }
|
---|
43 | event EventHandler ComputeInParallelChanged;
|
---|
44 |
|
---|
45 | void Run();
|
---|
46 | void Prepare();
|
---|
47 | void Start();
|
---|
48 | void Stop();
|
---|
49 | void Resume(IEnumerable<IJob> childJobs);
|
---|
50 |
|
---|
51 | event EventHandler JobStopped;
|
---|
52 | event EventHandler JobFailed;
|
---|
53 |
|
---|
54 | /// <summary>
|
---|
55 | /// When this event occurs the job wants to sleep until all his child jobs are finished
|
---|
56 | /// </summary>
|
---|
57 | event EventHandler WaitForChildJobs;
|
---|
58 |
|
---|
59 | /// <summary>
|
---|
60 | /// This event will be fired when the job wants to have a child-job to be computed
|
---|
61 | /// </summary>
|
---|
62 | event EventHandler<EventArgs<IJob>> NewChildJob;
|
---|
63 |
|
---|
64 | /// <summary>
|
---|
65 | /// Will be fired when job wants all child-jobs to be deleted from hive
|
---|
66 | /// </summary>
|
---|
67 | event EventHandler DeleteChildJobs;
|
---|
68 |
|
---|
69 | /// <summary>
|
---|
70 | /// If this is set to true, the job should be Resumed with the child-jobs attatched instead of Started
|
---|
71 | /// </summary>
|
---|
72 | bool CollectChildJobs { get; set; }
|
---|
73 | }
|
---|
74 | }
|
---|