Changeset 6110 for branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4/HeartbeatManager.cs
- Timestamp:
- 05/03/11 17:08:54 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4/HeartbeatManager.cs
r5786 r6110 82 82 actions.Add(new MessageContainer(MessageContainer.MessageType.AbortJob, curJob.Id)); 83 83 LogFactory.GetLogger(this.GetType().Namespace).Log("The slave " + heartbeat.SlaveId + " is not supposed to calculate Job: " + curJob); 84 } else if (!JobIsAllowedToBeCalculatedBySlave(heartbeat.SlaveId, curJob)) { 85 // assigned resources ids of job do not match with slaveId (and parent resourceGroupIds); this might happen when slave is moved to different group 86 actions.Add(new MessageContainer(MessageContainer.MessageType.PauseJob, curJob.Id)); 84 87 } else { 85 88 // save job execution time … … 104 107 return actions; 105 108 } 109 110 private bool JobIsAllowedToBeCalculatedBySlave(Guid slaveId, Job curJob) { 111 var assignedResourceIds = dao.GetAssignedResources(curJob.Id).Select(x => x.Id); 112 var slaveResourceIds = dao.GetParentResources(slaveId).Select(x => x.Id); 113 return assignedResourceIds.Any(x => slaveResourceIds.Contains(x)); 114 } 106 115 } 107 116 }
Note: See TracChangeset
for help on using the changeset viewer.