- Timestamp:
- 04/16/13 13:13:41 (11 years ago)
- Location:
- branches/OaaS
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/OaaS
- Property svn:ignore
-
old new 21 21 protoc.exe 22 22 _ReSharper.HeuristicLab 3.3 Tests 23 Google.ProtocolBuffers-2.4.1.473.dll 23 24 packages
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/OaaS/HeuristicLab.Services.Hive
-
Property
svn:mergeinfo
set to
(toggle deleted branches)
/trunk/sources/HeuristicLab.Services.Hive merged eligible /branches/Algorithms.GradientDescent/HeuristicLab.Services.Hive 5516-5520 /branches/Benchmarking/sources/HeuristicLab.Services.Hive 6917-7005 /branches/CloningRefactoring/HeuristicLab.Services.Hive 4656-4721 /branches/DataAnalysis Refactoring/HeuristicLab.Services.Hive 5471-5808 /branches/DataAnalysis SolutionEnsembles/HeuristicLab.Services.Hive 5815-6180 /branches/DataAnalysis/HeuristicLab.Services.Hive 4458-4459,4462,4464 /branches/GP.Grammar.Editor/HeuristicLab.Services.Hive 6284-6795 /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Services.Hive 5060 /branches/HiveTaskScheduler/HeuristicLab.Services.Hive 8687-9106 /branches/NET40/sources/HeuristicLab.Services.Hive 5138-5162 /branches/ParallelEngine/HeuristicLab.Services.Hive 5175-5192 /branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Services.Hive 7568-7810 /branches/QAPAlgorithms/HeuristicLab.Services.Hive 6350-6627 /branches/Restructure trunk solution/HeuristicLab.Services.Hive 6828 /branches/RuntimeOptimizer/HeuristicLab.Services.Hive 8943-9078 /branches/ScatterSearch (trunk integration)/HeuristicLab.Services.Hive 7787-8333 /branches/SlaveShutdown/HeuristicLab.Services.Hive 8944-8956 /branches/SuccessProgressAnalysis/HeuristicLab.Services.Hive 5370-5682 /branches/Trunk/HeuristicLab.Services.Hive 6829-6865 /branches/UnloadJobs/HeuristicLab.Services.Hive 9168-9215 /branches/VNS/HeuristicLab.Services.Hive 5594-5752 /branches/histogram/HeuristicLab.Services.Hive 5959-6341
-
Property
svn:mergeinfo
set to
(toggle deleted branches)
-
branches/OaaS/HeuristicLab.Services.Hive/3.3/HiveService.cs
r8506 r9363 24 24 using System.Linq; 25 25 using System.ServiceModel; 26 using System.Transactions; 26 27 using HeuristicLab.Services.Hive.DataTransfer; 27 28 using HeuristicLab.Services.Hive.ServiceContracts; 28 29 using DA = HeuristicLab.Services.Hive.DataAccess; 29 30 using DT = HeuristicLab.Services.Hive.DataTransfer; 30 using System.Transactions;31 31 32 32 … … 69 69 taskData.TaskId = task.Id; 70 70 taskData.LastUpdate = DateTime.Now; 71 foreach (Guid slaveGroupId in resourceIds) { 72 dao.AssignJobToResource(task.Id, slaveGroupId); 73 } 71 dao.AssignJobToResource(task.Id, resourceIds); 74 72 dao.AddTaskData(taskData); 75 73 dao.UpdateTaskState(task.Id, DA.TaskState.Waiting, null, currentUserId, null); … … 82 80 var assignedResources = dao.GetAssignedResources(parentTaskId).Select(x => x.Id); 83 81 task.ParentTaskId = parentTaskId; 84 return AddTask(task, taskData, assignedResources); 82 return AddTask(task, taskData, assignedResources); 85 83 } 86 84 … … 132 130 133 131 return trans.UseTransaction(() => { 134 return dao.GetTasks(x => x.JobId == jobId).Select(x => new LightweightTask(x)).ToArray(); 132 return dao.GetLightweightTasks(task => task.JobId == jobId).ToArray(); 133 }, false, true); 134 } 135 136 public IEnumerable<LightweightTask> GetLightweightJobTasksWithoutStateLog(Guid jobId) { 137 authen.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client); 138 author.AuthorizeForJob(jobId, Permission.Read); 139 140 return trans.UseTransaction(() => { 141 return dao.GetLightweightTasksWithoutStateLog(task => task.JobId == jobId).ToArray(); 135 142 }, false, false); 136 143 } … … 145 152 authen.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client, HiveRoles.Slave); 146 153 author.AuthorizeForTask(taskDto.Id, Permission.Full); 147 trans.UseTransaction(() => { 148 dao.UpdateTask(taskDto); 154 155 trans.UseTransaction(() => { 156 dao.UpdateTaskAndPlugins(taskDto); 149 157 }); 150 158 } … … 153 161 authen.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client, HiveRoles.Slave); 154 162 author.AuthorizeForTask(task.Id, Permission.Full); 155 author.AuthorizeForTask(taskData.TaskId, Permission.Full); 156 //trans.UseTransaction(() => { // cneumuel: try without transaction 163 dao.UpdateTaskAndPlugins(task); 157 164 taskData.LastUpdate = DateTime.Now; 158 dao.UpdateTask(task);159 165 dao.UpdateTaskData(taskData); 160 //}, false, true);161 166 } 162 167 … … 200 205 } 201 206 202 dao.UpdateTask (task);207 dao.UpdateTaskAndPlugins(task); 203 208 return task; 204 209 }); … … 412 417 authen.AuthenticateForAnyRole(HiveRoles.Slave); 413 418 414 //TODO: enable transaction 415 //List<MessageContainer> result = trans.UseTransaction(() => heartbeatManager.ProcessHeartbeat(heartbeat)); 416 List<MessageContainer> result = heartbeatManager.ProcessHeartbeat(heartbeat); 419 List<MessageContainer> result = new List<MessageContainer>(); 420 try { 421 result = heartbeatManager.ProcessHeartbeat(heartbeat); 422 } 423 catch (Exception ex) { 424 DA.LogFactory.GetLogger(this.GetType().Namespace).Log("Exception processing Heartbeat: " + ex.ToString()); 425 } 417 426 418 427 if (HeuristicLab.Services.Hive.Properties.Settings.Default.TriggerEventManagerInHeartbeat) { … … 517 526 #endregion 518 527 528 #region Resource Methods 529 public IEnumerable<Resource> GetChildResources(Guid resourceId) { 530 return trans.UseTransaction(() => { return dao.GetChildResources(resourceId); }); 531 } 532 #endregion 533 519 534 #region Slave Methods 520 535 public int GetNewHeartbeatInterval(Guid slaveId) { 521 536 authen.AuthenticateForAnyRole(HiveRoles.Slave); 522 Slave s = dao.GetSlave(slaveId); 537 538 Slave s = trans.UseTransaction(() => { return dao.GetSlave(slaveId); }); 523 539 if (s != null) { 524 540 return s.HbInterval; … … 689 705 #endregion 690 706 707 #region UserPriority Methods 708 public IEnumerable<UserPriority> GetUserPriorities() { 709 return trans.UseTransaction(() => dao.GetUserPriorities(x => true)); 710 } 711 #endregion 712 691 713 #region Helper Methods 692 714 private IEnumerable<Task> GetChildTasks(Guid? parentTaskId, bool recursive, bool includeParent) { … … 705 727 } 706 728 #endregion 729 730 #region Statistics Methods 731 public IEnumerable<Statistics> GetStatistics() { 732 return trans.UseTransaction(() => { return dao.GetStatistics(x => true); }); 733 } 734 public IEnumerable<Statistics> GetStatisticsForTimePeriod(DateTime from, DateTime to) { 735 return trans.UseTransaction(() => { return dao.GetStatistics(x => x.Timestamp >= from && x.Timestamp <= to); }); 736 } 737 #endregion 707 738 } 708 739 }
Note: See TracChangeset
for help on using the changeset viewer.