WorkflowExecutionEvent.h
1 
11 #ifndef WRENCH_WORKFLOWEXECUTIONEVENT_H
12 #define WRENCH_WORKFLOWEXECUTIONEVENT_H
13 
14 #include <string>
15 #include "FailureCause.h"
16 
17 /***********************/
19 /***********************/
20 
21 namespace wrench {
22 
23  class WorkflowTask;
24 
25  class WorkflowFile;
26 
27  class StandardJob;
28 
29  class PilotJob;
30 
31  class ComputeService;
32 
33  class StorageService;
34 
35  class FileRegistryService;
36 
37  class FileRegistryService;
38 
44 
45  public:
46 
48  enum EventType {
63  };
64 
67 
68 
69  /***********************/
71  /***********************/
72  static std::unique_ptr<WorkflowExecutionEvent> waitForNextExecutionEvent(std::string);
73  virtual ~WorkflowExecutionEvent() = default;
74 
75  protected:
76 
82  WorkflowExecutionEvent(EventType type) : type(type) {}
83  /***********************/
85  /***********************/
86 
87  };
88 
89 
94 
95 
96  private:
97 
98  friend class WorkflowExecutionEvent;
105  ComputeService *compute_service)
107  standard_job(standard_job), compute_service(compute_service) {}
108  public:
109 
114  };
115 
120 
121  private:
122 
123  friend class WorkflowExecutionEvent;
124 
131  StandardJobFailedEvent(StandardJob *standard_job,
132  ComputeService *compute_service,
133  std::shared_ptr<FailureCause> failure_cause)
135  standard_job(standard_job),
136  compute_service(compute_service),
137  failure_cause(failure_cause) {}
138 
139  public:
140 
146  std::shared_ptr<FailureCause> failure_cause;
147  };
148 
149 
154 
155  private:
156 
157  friend class WorkflowExecutionEvent;
158 
164  PilotJobStartedEvent(PilotJob *pilot_job,
165  ComputeService *compute_service)
167  pilot_job(pilot_job), compute_service(compute_service) {}
168 
169  public:
174  };
175 
180 
181  private:
182 
183  friend class WorkflowExecutionEvent;
189  PilotJobExpiredEvent(PilotJob *pilot_job,
190  ComputeService *compute_service)
192  pilot_job(pilot_job), compute_service(compute_service) {}
193 
194  public:
195 
200  };
201 
206 
207  private:
208 
209  friend class WorkflowExecutionEvent;
218  StorageService *storage_service,
219  FileRegistryService *file_registry_service,
220  bool file_registry_service_updated)
222  file(file), storage_service(storage_service),
223  file_registry_service(file_registry_service),
224  file_registry_service_updated(file_registry_service_updated) {}
225 
226  public:
235  };
236 
237 
242 
243  private:
244 
245  friend class WorkflowExecutionEvent;
253  StorageService *storage_service,
254  std::shared_ptr<FailureCause> failure_cause
255  )
257  file(file), storage_service(storage_service),
258  failure_cause(failure_cause) {}
259 
260  public:
261 
267  std::shared_ptr<FailureCause> failure_cause;
268 
269  };
270 
271 };
272 
273 /***********************/
275 /***********************/
276 
277 
278 
279 #endif //WRENCH_WORKFLOWEXECUTIONEVENT_H
A class to represent the various execution events that are relevant to the execution of a workflow...
Definition: WorkflowExecutionEvent.h:43
WorkflowExecutionEvent::EventType type
The event type.
Definition: WorkflowExecutionEvent.h:66
A "standard job has completed" WorkflowExecutionEvent.
Definition: WorkflowExecutionEvent.h:93
A "file copy has completed" WorkflowExecutionEvent.
Definition: WorkflowExecutionEvent.h:205
WorkflowFile * file
The workflow file that has successfully been copied.
Definition: WorkflowExecutionEvent.h:228
std::shared_ptr< FailureCause > failure_cause
The cause of the failure.
Definition: WorkflowExecutionEvent.h:267
A "standard job has failed" WorkflowExecutionEvent.
Definition: WorkflowExecutionEvent.h:119
A "file copy has failed" WorkflowExecutionEvent.
Definition: WorkflowExecutionEvent.h:241
StorageService * storage_service
The storage service on which it was supposed to be copied.
Definition: WorkflowExecutionEvent.h:265
ComputeService * compute_service
The compute service on which the job has failed.
Definition: WorkflowExecutionEvent.h:144
ComputeService * compute_service
The compute service on which the pilot job has expired.
Definition: WorkflowExecutionEvent.h:199
A "pilot job has started" WorkflowExecutionEvent.
Definition: WorkflowExecutionEvent.h:153
A data file used/produced by a WorkflowTask in a Workflow.
Definition: WorkflowFile.h:26
std::shared_ptr< FailureCause > failure_cause
The cause of the failure.
Definition: WorkflowExecutionEvent.h:146
ComputeService * compute_service
The compute service on which the pilot job has started.
Definition: WorkflowExecutionEvent.h:173
static std::unique_ptr< WorkflowExecutionEvent > waitForNextExecutionEvent(std::string)
Block the calling process until a WorkflowExecutionEvent is generated based on messages received on a...
Definition: WorkflowExecutionEvent.cpp:36
A file copy operation completed.
Definition: WorkflowExecutionEvent.h:60
A pilot (i.e., non-standard) workflow job that can be submitted to a ComputeService by a WMS (via a J...
Definition: PilotJob.h:29
A standard (i.e., non-pilot) workflow job that can be submitted to a ComputeService by a WMS (via a J...
Definition: StandardJob.h:38
StandardJob * standard_job
The standard job that has failed.
Definition: WorkflowExecutionEvent.h:142
PilotJob * pilot_job
The pilot job that has expired.
Definition: WorkflowExecutionEvent.h:197
The compute service base class.
Definition: ComputeService.h:35
StorageService * storage_service
The storage service to which the file has been copied.
Definition: WorkflowExecutionEvent.h:230
A standard job failed.
Definition: WorkflowExecutionEvent.h:54
StandardJob * standard_job
The standard job that has completed.
Definition: WorkflowExecutionEvent.h:111
A standard job successfully completed.
Definition: WorkflowExecutionEvent.h:52
A file registry service (a.k.a. replica catalog) that holds a database of which files are available a...
Definition: FileRegistryService.h:33
ComputeService * compute_service
The compute service on which the standard job has completed.
Definition: WorkflowExecutionEvent.h:113
A file copy operation failed.
Definition: WorkflowExecutionEvent.h:62
EventType
Workflow execution event types.
Definition: WorkflowExecutionEvent.h:48
A pilot job expired.
Definition: WorkflowExecutionEvent.h:58
A pilot job started.
Definition: WorkflowExecutionEvent.h:56
An error type.
Definition: WorkflowExecutionEvent.h:50
bool file_registry_service_updated
Whether the file registry service (if any) has been successfully updated.
Definition: WorkflowExecutionEvent.h:234
The storage service base class.
Definition: StorageService.h:35
WorkflowFile * file
The workflow file that has failed to be copied.
Definition: WorkflowExecutionEvent.h:263
Definition: TerminalOutput.cpp:15
A "pilot job has expired" WorkflowExecutionEvent.
Definition: WorkflowExecutionEvent.h:179
WorkflowExecutionEvent(EventType type)
Constructor.
Definition: WorkflowExecutionEvent.h:82
FileRegistryService * file_registry_service
The file registry service that was supposed to be updated (or nullptr if none)
Definition: WorkflowExecutionEvent.h:232
PilotJob * pilot_job
The pilot job that has started.
Definition: WorkflowExecutionEvent.h:171