- Timestamp:
- 09/08/11 16:38:28 (13 years ago)
- Location:
- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.3
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.3/Convert.cs
r6723 r6725 44 44 State = Convert.ToDto(source.State), 45 45 StateLog = (source.StateLogs == null ? new List<DT.StateLog>() : source.StateLogs.Select(x => Convert.ToDto(x)).OrderBy(x => x.DateTime).ToList()), 46 IsParent Job= source.IsParentTask,46 IsParentTask = source.IsParentTask, 47 47 FinishWhenChildJobsFinished = source.FinishWhenChildJobsFinished, 48 48 Command = Convert.ToDto(source.Command), … … 72 72 target.StateLogs.Add(Convert.ToEntity(sl)); 73 73 } 74 target.IsParentTask = source.IsParent Job;74 target.IsParentTask = source.IsParentTask; 75 75 target.FinishWhenChildJobsFinished = source.FinishWhenChildJobsFinished; 76 76 target.Command = Convert.ToEntity(source.Command); … … 82 82 #endregion 83 83 84 #region JobData84 #region TaskData 85 85 public static DT.TaskData ToDto(DB.TaskData source) { 86 86 if (source == null) return null; … … 133 133 #endregion 134 134 135 #region HiveExperiment135 #region Job 136 136 public static DT.Job ToDto(DB.Job source) { 137 137 if (source == null) return null; -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.3/DataTransfer/Task.cs
r6723 r6725 39 39 public DateTime? LastHeartbeat { get; set; } 40 40 [DataMember] 41 public bool IsParent Job{ get; set; }41 public bool IsParentTask { get; set; } 42 42 [DataMember] 43 43 public bool FinishWhenChildJobsFinished { get; set; } -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.3/HiveDao.cs
r6723 r6725 150 150 #endregion 151 151 152 #region JobData Methods152 #region TaskData Methods 153 153 public DT.TaskData GetJobData(Guid id) { 154 154 using (var db = CreateContext(true)) { … … 230 230 #endregion 231 231 232 #region HiveExperimentMethods232 #region Job Methods 233 233 public DT.Job GetHiveExperiment(Guid id) { 234 234 using (var db = CreateContext()) { -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.3/HiveService.cs
r6723 r6725 196 196 #endregion 197 197 198 #region JobControl Methods198 #region Task Control Methods 199 199 public void StopJob(Guid jobId) { 200 200 authen.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client, HiveRoles.Slave); … … 238 238 #endregion 239 239 240 #region HiveExperimentMethods240 #region Job Methods 241 241 public Job GetHiveExperiment(Guid id) { 242 242 authen.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client); -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.3/Interfaces/IHiveDao.cs
r6723 r6725 28 28 namespace HeuristicLab.Services.Hive { 29 29 public interface IHiveDao { 30 #region JobMethods30 #region Task Methods 31 31 DT.Task GetJob(Guid id); 32 32 IEnumerable<DT.Task> GetJobs(Expression<Func<Task, bool>> predicate); … … 39 39 #endregion 40 40 41 #region JobData Methods41 #region TaskData Methods 42 42 DT.TaskData GetJobData(Guid id); 43 43 IEnumerable<DT.TaskData> GetJobDatas(Expression<Func<TaskData, bool>> predicate); -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.3/Manager/HeartbeatManager.cs
r6721 r6725 63 63 var job = availableJobs.First(); 64 64 if (AssignJob(slave, job)) 65 actions.Add(new MessageContainer(MessageContainer.MessageType.Calculate Job, job.Id));65 actions.Add(new MessageContainer(MessageContainer.MessageType.CalculateTask, job.Id)); 66 66 } 67 67 } … … 101 101 if (curJob == null) { 102 102 // job does not exist in db 103 actions.Add(new MessageContainer(MessageContainer.MessageType.Abort Job, jobProgress.Key));103 actions.Add(new MessageContainer(MessageContainer.MessageType.AbortTask, jobProgress.Key)); 104 104 DA.LogFactory.GetLogger(this.GetType().Namespace).Log("Job does not exist in DB: " + jobProgress.Key); 105 105 } else { 106 106 if (curJob.CurrentStateLog.SlaveId == Guid.Empty || curJob.CurrentStateLog.SlaveId != heartbeat.SlaveId) { 107 107 // assigned slave does not match heartbeat 108 actions.Add(new MessageContainer(MessageContainer.MessageType.Abort Job, curJob.Id));108 actions.Add(new MessageContainer(MessageContainer.MessageType.AbortTask, curJob.Id)); 109 109 DA.LogFactory.GetLogger(this.GetType().Namespace).Log("The slave " + heartbeat.SlaveId + " is not supposed to calculate Job: " + curJob); 110 110 } else if (!JobIsAllowedToBeCalculatedBySlave(heartbeat.SlaveId, curJob)) { 111 111 // assigned resources ids of job do not match with slaveId (and parent resourceGroupIds); this might happen when slave is moved to different group 112 actions.Add(new MessageContainer(MessageContainer.MessageType.Pause Job, curJob.Id));112 actions.Add(new MessageContainer(MessageContainer.MessageType.PauseTask, curJob.Id)); 113 113 } else { 114 114 // save job execution time … … 118 118 switch (curJob.Command) { 119 119 case Command.Stop: 120 actions.Add(new MessageContainer(MessageContainer.MessageType.Stop Job, curJob.Id));120 actions.Add(new MessageContainer(MessageContainer.MessageType.StopTask, curJob.Id)); 121 121 break; 122 122 case Command.Pause: 123 actions.Add(new MessageContainer(MessageContainer.MessageType.Pause Job, curJob.Id));123 actions.Add(new MessageContainer(MessageContainer.MessageType.PauseTask, curJob.Id)); 124 124 break; 125 125 case Command.Abort: 126 actions.Add(new MessageContainer(MessageContainer.MessageType.Abort Job, curJob.Id));126 actions.Add(new MessageContainer(MessageContainer.MessageType.AbortTask, curJob.Id)); 127 127 break; 128 128 } -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.3/MessageContainer.cs
r6721 r6725 37 37 public enum MessageType { 38 38 // *** commands from hive server *** 39 Calculate Job, // slave should calculate a job. the job is already assigned to the slave40 Stop Job, // slave should stop the job and submit results39 CalculateTask, // slave should calculate a job. the job is already assigned to the slave 40 StopTask, // slave should stop the job and submit results 41 41 StopAll, // stop all and submit results 42 Abort Job, // slave should shut the job down immediately without submitting results42 AbortTask, // slave should shut the job down immediately without submitting results 43 43 AbortAll, // slave should abort all jobs immediately 44 Pause Job, // pause the job and submit the results44 PauseTask, // pause the job and submit the results 45 45 PauseAll, // pause all jobs and submit results 46 46 Restart, // restart operation after Sleep -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.3/ServiceContracts/IHiveService.cs
r6723 r6725 31 31 public interface IHiveService { 32 32 33 #region Task Methods 34 [OperationContract] 35 Guid AddJob(Task job, TaskData jobData, IEnumerable<Guid> resourceIds); 36 37 [OperationContract] 38 Guid AddChildJob(Guid parentJobId, Task job, TaskData jobData); 39 40 [OperationContract] 41 Task GetJob(Guid jobId); 42 43 [OperationContract] 44 IEnumerable<Task> GetJobs(); 45 46 [OperationContract] 47 IEnumerable<LightweightTask> GetLightweightJobs(IEnumerable<Guid> jobIds); 48 49 [OperationContract] 50 IEnumerable<LightweightTask> GetLightweightChildJobs(Guid? parentJobId, bool recursive, bool includeParent); 51 52 [OperationContract] 53 IEnumerable<LightweightTask> GetLightweightExperimentJobs(Guid experimentId); 54 55 [OperationContract] 56 TaskData GetJobData(Guid jobId); 57 58 [OperationContract] 59 void UpdateJob(Task jobDto); 60 61 [OperationContract] 62 void UpdateJobData(Task jobDto, TaskData jobDataDto); 63 64 [OperationContract] 65 void DeleteJob(Guid jobId); 66 67 [OperationContract] 68 void DeleteChildJobs(Guid parentJobId); 69 70 [OperationContract] 71 Task UpdateJobState(Guid jobId, TaskState jobState, Guid? slaveId, Guid? userId, string exception); 72 #endregion 73 74 #region Job Control Methods 75 [OperationContract] 76 void StopJob(Guid jobId); 77 78 [OperationContract] 79 void PauseJob(Guid jobId); 80 81 [OperationContract] 82 void RestartJob(Guid jobId); 83 #endregion 84 33 85 #region Job Methods 34 [OperationContract]35 Guid AddJob(Task job, TaskData jobData, IEnumerable<Guid> resourceIds);36 37 [OperationContract]38 Guid AddChildJob(Guid parentJobId, Task job, TaskData jobData);39 40 [OperationContract]41 Task GetJob(Guid jobId);42 43 [OperationContract]44 IEnumerable<Task> GetJobs();45 46 [OperationContract]47 IEnumerable<LightweightTask> GetLightweightJobs(IEnumerable<Guid> jobIds);48 49 [OperationContract]50 IEnumerable<LightweightTask> GetLightweightChildJobs(Guid? parentJobId, bool recursive, bool includeParent);51 52 [OperationContract]53 IEnumerable<LightweightTask> GetLightweightExperimentJobs(Guid experimentId);54 55 [OperationContract]56 TaskData GetJobData(Guid jobId);57 58 [OperationContract]59 void UpdateJob(Task jobDto);60 61 [OperationContract]62 void UpdateJobData(Task jobDto, TaskData jobDataDto);63 64 [OperationContract]65 void DeleteJob(Guid jobId);66 67 [OperationContract]68 void DeleteChildJobs(Guid parentJobId);69 70 [OperationContract]71 Task UpdateJobState(Guid jobId, TaskState jobState, Guid? slaveId, Guid? userId, string exception);72 #endregion73 74 #region Job Control Methods75 [OperationContract]76 void StopJob(Guid jobId);77 78 [OperationContract]79 void PauseJob(Guid jobId);80 81 [OperationContract]82 void RestartJob(Guid jobId);83 #endregion84 85 #region HiveExperiment Methods86 86 [OperationContract] 87 87 Job GetHiveExperiment(Guid id);
Note: See TracChangeset
for help on using the changeset viewer.