Last change
on this file since 17120 was
15630,
checked in by jzenisek, 7 years ago
|
#2839
- updated Heartbeat processing (regarding: checking against AssignedJobResources and handling of the updated Job deletion routine)
- updated Job deletion routine(still in progress at GenerateStatistics)
|
File size:
1.4 KB
|
Line | |
---|
1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Linq;
|
---|
4 | using System.Text;
|
---|
5 | using System.Threading.Tasks;
|
---|
6 |
|
---|
7 | namespace HeuristicLab.Services.Hive.DataTransfer {
|
---|
8 | [Serializable]
|
---|
9 | public enum JobState {
|
---|
10 | /// <summary>
|
---|
11 | /// A job is online as long as he is no other state.
|
---|
12 | /// </summary>
|
---|
13 | Online,
|
---|
14 |
|
---|
15 | /// <summary>
|
---|
16 | /// A job is in StatisticsPending if its deletion has been requested,
|
---|
17 | /// but the final generation of statistics hasn't been performed yet.
|
---|
18 | /// </summary>
|
---|
19 | StatisticsPending,
|
---|
20 |
|
---|
21 | /// <summary>
|
---|
22 | /// A job is in DeletionPending if its deletion has been requested,
|
---|
23 | /// the final generation of statistics has already been performed,
|
---|
24 | /// but the eventual deletion of the job is still pending.
|
---|
25 | /// </summary>
|
---|
26 | DeletionPending
|
---|
27 | };
|
---|
28 |
|
---|
29 | public static class JobStateExtensions {
|
---|
30 | /// <summary>
|
---|
31 | /// This job is online
|
---|
32 | /// </summary>
|
---|
33 | public static bool IsOnline(this JobState jobState) {
|
---|
34 | return jobState == JobState.Online;
|
---|
35 | }
|
---|
36 |
|
---|
37 | /// <summary>
|
---|
38 | /// This job is still existent, but already flagged for deletion.
|
---|
39 | /// Usually the flag is set by a user, not a resource or the janitor or something else.
|
---|
40 | /// </summary>
|
---|
41 | public static bool IsFlaggedForDeletion(this JobState jobState) {
|
---|
42 | return jobState == JobState.StatisticsPending || jobState == JobState.DeletionPending;
|
---|
43 | }
|
---|
44 | }
|
---|
45 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.