Changeset 12962 for stable/HeuristicLab.Services.Hive
- Timestamp:
- 09/21/15 16:28:38 (7 years ago)
- Location:
- stable
- Files:
-
- 9 deleted
- 11 edited
- 8 copied
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Services.Hive
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Services.Hive/3.3/HeuristicLab.Services.Hive-3.3.csproj
r11920 r12962 118 118 </ItemGroup> 119 119 <ItemGroup> 120 <Compile Include="Convert .cs" />120 <Compile Include="Converter.cs" /> 121 121 <Compile Include="DataTransfer\Command.cs" /> 122 122 <Compile Include="DataTransfer\UserPriority.cs" /> … … 139 139 <Compile Include="DataTransfer\SlaveGroup.cs" /> 140 140 <Compile Include="DataTransfer\SlaveState.cs" /> 141 <Compile Include="DataTransfer\SlaveStatistics.cs" />142 141 <Compile Include="DataTransfer\StateLog.cs" /> 143 <Compile Include="DataTransfer\Statistics.cs" /> 144 <Compile Include="DataTransfer\UserStatistics.cs" /> 145 <Compile Include="OptimizedHiveDao.cs" /> 146 <Compile Include="HiveDao.cs" /> 142 <Compile Include="HiveStatisticsGenerator.cs" /> 143 <Compile Include="Interfaces\IStatisticsGenerator.cs" /> 147 144 <Compile Include="HiveJanitor.cs" /> 148 145 <Compile Include="HiveOperationContext.cs" /> 149 <Compile Include="Interfaces\IOptimizedHiveDao.cs" />150 <Compile Include="Interfaces\IHiveDao.cs" />151 146 <Compile Include="Interfaces\ITaskScheduler.cs" /> 147 <Compile Include="PerformanceLogger.cs" /> 152 148 <Compile Include="Scheduler\TaskInfoForScheduler.cs" /> 153 149 <Compile Include="Scheduler\JobInfoForScheduler.cs" /> 154 150 <Compile Include="Scheduler\RoundRobinTaskScheduler.cs" /> 155 <Compile Include="Settings.cs" />156 151 <None Include="app.config" /> 157 152 <None Include="Plugin.cs.frame" /> … … 182 177 </ItemGroup> 183 178 <ItemGroup> 179 <ProjectReference Include="..\..\HeuristicLab.Services.Access.DataAccess\3.3\HeuristicLab.Services.Access.DataAccess-3.3.csproj"> 180 <Project>{0F652437-998A-4EAB-8BF1-444B5FE8CE97}</Project> 181 <Name>HeuristicLab.Services.Access.DataAccess-3.3</Name> 182 </ProjectReference> 184 183 <ProjectReference Include="..\..\HeuristicLab.Services.Access\3.3\HeuristicLab.Services.Access-3.3.csproj"> 185 184 <Project>{9FAC0B23-2730-452A-9BA0-D7CA1746C541}</Project> -
stable/HeuristicLab.Services.Hive/3.3/HiveJanitor.cs
r12009 r12962 23 23 using System.Threading; 24 24 using HeuristicLab.Services.Hive.DataAccess; 25 using HeuristicLab.Services.Hive.DataAccess.Interfaces; 25 26 26 27 namespace HeuristicLab.Services.Hive { 27 28 public class HiveJanitor { 28 29 private bool stop; 29 private AutoResetEvent waitHandle; 30 private AutoResetEvent cleanupWaitHandle; 31 private AutoResetEvent generateStatisticsWaitHandle; 30 32 31 private DataAccess.ITransactionManager trans{32 get { return ServiceLocator.Instance. TransactionManager; }33 private IPersistenceManager PersistenceManager { 34 get { return ServiceLocator.Instance.PersistenceManager; } 33 35 } 34 35 private IEventManager eventManager { 36 private IEventManager EventManager { 36 37 get { return ServiceLocator.Instance.EventManager; } 37 38 } 38 39 39 private I HiveDao dao{40 get { return ServiceLocator.Instance. HiveDao; }40 private IStatisticsGenerator StatisticsGenerator { 41 get { return ServiceLocator.Instance.StatisticsGenerator; } 41 42 } 42 43 43 44 public HiveJanitor() { 44 45 stop = false; 45 waitHandle = new AutoResetEvent(true); 46 cleanupWaitHandle = new AutoResetEvent(false); 47 generateStatisticsWaitHandle = new AutoResetEvent(false); 46 48 } 47 49 48 50 public void StopJanitor() { 49 51 stop = true; 50 waitHandle.Set(); 52 cleanupWaitHandle.Set(); 53 generateStatisticsWaitHandle.Set(); 51 54 } 52 55 53 public void Run() { 56 public void RunCleanup() { 57 var pm = PersistenceManager; 54 58 while (!stop) { 55 59 try { 56 LogFactory.GetLogger(typeof(HiveJanitor).Namespace).Log("HiveJanitor: starting cleanup ");60 LogFactory.GetLogger(typeof(HiveJanitor).Namespace).Log("HiveJanitor: starting cleanup."); 57 61 bool cleanup = false; 58 trans.UseTransaction(() => { 59 DateTime lastCleanup = dao.GetLastCleanup(); 60 if (DateTime.Now - lastCleanup > HeuristicLab.Services.Hive.Properties.Settings.Default.CleanupInterval) { 61 dao.SetLastCleanup(DateTime.Now); 62 63 var lifecycleDao = pm.LifecycleDao; 64 pm.UseTransaction(() => { 65 var lifecycle = lifecycleDao.GetLastLifecycle(); 66 if (lifecycle == null 67 || DateTime.Now - lifecycle.LastCleanup > Properties.Settings.Default.CleanupInterval) { 68 lifecycleDao.UpdateLifecycle(); 62 69 cleanup = true; 63 70 } 71 pm.SubmitChanges(); 64 72 }, true); 65 73 66 74 if (cleanup) { 67 eventManager.Cleanup();75 EventManager.Cleanup(); 68 76 } 69 LogFactory.GetLogger(typeof(HiveJanitor).Namespace).Log("HiveJanitor: cleanup finished ");77 LogFactory.GetLogger(typeof(HiveJanitor).Namespace).Log("HiveJanitor: cleanup finished."); 70 78 } 71 79 catch (Exception e) { 72 80 LogFactory.GetLogger(typeof(HiveJanitor).Namespace).Log(string.Format("HiveJanitor: The following exception occured: {0}", e.ToString())); 73 81 } 74 waitHandle.WaitOne(HeuristicLab.Services.Hive.Properties.Settings.Default.CleanupInterval);82 cleanupWaitHandle.WaitOne(Properties.Settings.Default.CleanupInterval); 75 83 } 76 waitHandle.Close(); 84 cleanupWaitHandle.Close(); 85 } 86 87 public void RunGenerateStatistics() { 88 while (!stop) { 89 try { 90 LogFactory.GetLogger(typeof(HiveJanitor).Namespace).Log("HiveJanitor: starting generate statistics."); 91 StatisticsGenerator.GenerateStatistics(); 92 LogFactory.GetLogger(typeof(HiveJanitor).Namespace).Log("HiveJanitor: generate statistics finished."); 93 } 94 catch (Exception e) { 95 LogFactory.GetLogger(typeof(HiveJanitor).Namespace).Log(string.Format("HiveJanitor: The following exception occured: {0}", e)); 96 } 97 98 generateStatisticsWaitHandle.WaitOne(Properties.Settings.Default.GenerateStatisticsInterval); 99 } 100 101 generateStatisticsWaitHandle.Close(); 77 102 } 78 103 } -
stable/HeuristicLab.Services.Hive/3.3/HiveService.cs
r12879 r12962 311 311 job.FinishedCount = statistics.FinishedCount; 312 312 } 313 job.OwnerUsername = UserManager.GetUser ById(job.OwnerUserId).UserName;313 job.OwnerUsername = UserManager.GetUserNameById(job.OwnerUserId); 314 314 if (currentUserId == job.OwnerUserId) { 315 315 job.Permission = Permission.Full; … … 355 355 job.FinishedCount = statistic.FinishedCount; 356 356 } 357 job.OwnerUsername = UserManager.GetUser ById(job.OwnerUserId).UserName;357 job.OwnerUsername = UserManager.GetUserNameById(job.OwnerUserId); 358 358 if (currentUserId == job.OwnerUserId) { 359 359 job.Permission = Permission.Full; -
stable/HeuristicLab.Services.Hive/3.3/HiveStatisticsGenerator.cs
r12879 r12962 57 57 58 58 pm.UseTransaction(() => { 59 UpdateTaskFactsTable( time,pm);59 UpdateTaskFactsTable(pm); 60 60 try { 61 61 pm.SubmitChanges(); … … 261 261 } 262 262 263 private void UpdateTaskFactsTable( DimTime newTime,PersistenceManager pm) {263 private void UpdateTaskFactsTable(PersistenceManager pm) { 264 264 var factTaskDao = pm.FactTaskDao; 265 265 var taskDao = pm.TaskDao; … … 273 273 274 274 var newTasks = 275 from task in taskDao.GetAllChildTasks() 276 let stateLogs = task.StateLogs.OrderByDescending(x => x.DateTime) 277 let lastSlaveId = stateLogs.First(x => x.SlaveId != null).SlaveId 278 where (!factTaskIds.Contains(task.TaskId) 279 || notFinishedFactTasks.Select(x => x.TaskId).Contains(task.TaskId)) 280 join lastFactTask in notFinishedFactTasks on task.TaskId equals lastFactTask.TaskId into lastFactPerTask 281 from lastFact in lastFactPerTask.DefaultIfEmpty() 282 join client in dimClientDao.GetActiveClients() on lastSlaveId equals client.ResourceId into clientsPerSlaveId 283 from client in clientsPerSlaveId.DefaultIfEmpty() 284 select new { 285 TaskId = task.TaskId, 286 JobId = task.JobId, 287 Priority = task.Priority, 288 CoresRequired = task.CoresNeeded, 289 MemoryRequired = task.MemoryNeeded, 290 State = task.State, 291 StateLogs = stateLogs.OrderBy(x => x.DateTime), 292 LastClientId = client != null 293 ? client.Id : lastFact != null 294 ? lastFact.LastClientId : (Guid?)null 295 }; 275 (from task in taskDao.GetAllChildTasks() 276 let stateLogs = task.StateLogs.OrderByDescending(x => x.DateTime) 277 let lastSlaveId = stateLogs.First(x => x.SlaveId != null).SlaveId 278 where (!factTaskIds.Contains(task.TaskId) 279 || notFinishedFactTasks.Select(x => x.TaskId).Contains(task.TaskId)) 280 join lastFactTask in notFinishedFactTasks on task.TaskId equals lastFactTask.TaskId into lastFactPerTask 281 from lastFact in lastFactPerTask.DefaultIfEmpty() 282 join client in dimClientDao.GetActiveClients() on lastSlaveId equals client.ResourceId into clientsPerSlaveId 283 from client in clientsPerSlaveId.DefaultIfEmpty() 284 select new { 285 TaskId = task.TaskId, 286 JobId = task.JobId, 287 Priority = task.Priority, 288 CoresRequired = task.CoresNeeded, 289 MemoryRequired = task.MemoryNeeded, 290 State = task.State, 291 StateLogs = stateLogs.OrderBy(x => x.DateTime), 292 LastClientId = client != null 293 ? client.Id : lastFact != null 294 ? lastFact.LastClientId : (Guid?)null, 295 NotFinishedTask = notFinishedFactTasks.Any(y => y.TaskId == task.TaskId) 296 }).ToList(); 297 298 //insert facts for new tasks 296 299 factTaskDao.Save( 297 from x in newTasks.ToList() 300 from x in newTasks 301 where !x.NotFinishedTask 298 302 let taskData = CalculateFactTaskData(x.StateLogs) 299 303 select new FactTask { … … 315 319 InitialWaitingTime = taskData.InitialWaitingTime 316 320 }); 317 factTaskDao.Delete(notFinishedFactTasks.Select(x => x.TaskId)); 321 322 //update data of already existing facts 323 foreach (var notFinishedTask in factTaskDao.GetNotFinishedTasks()) { 324 var ntc = newTasks.Where(x => x.TaskId == notFinishedTask.TaskId); 325 if (ntc.Any()) { 326 var x = ntc.Single(); 327 var taskData = CalculateFactTaskData(x.StateLogs); 328 329 notFinishedTask.StartTime = taskData.StartTime; 330 notFinishedTask.EndTime = taskData.EndTime; 331 notFinishedTask.LastClientId = x.LastClientId; 332 notFinishedTask.Priority = x.Priority; 333 notFinishedTask.CoresRequired = x.CoresRequired; 334 notFinishedTask.MemoryRequired = x.MemoryRequired; 335 notFinishedTask.NumCalculationRuns = taskData.CalculationRuns; 336 notFinishedTask.NumRetries = taskData.Retries; 337 notFinishedTask.WaitingTime = taskData.WaitingTime; 338 notFinishedTask.CalculatingTime = taskData.CalculatingTime; 339 notFinishedTask.TransferTime = taskData.TransferTime; 340 notFinishedTask.TaskState = x.State; 341 notFinishedTask.Exception = taskData.Exception; 342 notFinishedTask.InitialWaitingTime = taskData.InitialWaitingTime; 343 } 344 } 318 345 } 319 346 -
stable/HeuristicLab.Services.Hive/3.3/Interfaces/IServiceLocator.cs
r12009 r12962 20 20 #endregion 21 21 22 using HeuristicLab.Services.Hive.DataAccess; 22 using HeuristicLab.Services.Hive.DataAccess.Interfaces; 23 using HeuristicLab.Services.Hive.Manager; 23 24 24 25 namespace HeuristicLab.Services.Hive { … … 26 27 Access.IRoleVerifier RoleVerifier { get; } 27 28 IAuthorizationManager AuthorizationManager { get; } 28 IHiveDao HiveDao { get; } 29 IOptimizedHiveDao OptimizedHiveDao { get; } 29 IPersistenceManager PersistenceManager { get; } 30 30 IEventManager EventManager { get; } 31 I TransactionManager TransactionManager { get; }31 IStatisticsGenerator StatisticsGenerator { get; } 32 32 Access.IUserManager UserManager { get; } 33 33 HeartbeatManager HeartbeatManager { get; } -
stable/HeuristicLab.Services.Hive/3.3/Manager/AuthorizationManager.cs
r12009 r12962 22 22 using System; 23 23 using System.Security; 24 using HeuristicLab.Services.Access; 24 25 using HeuristicLab.Services.Hive.DataAccess; 26 using HeuristicLab.Services.Hive.DataAccess.Interfaces; 27 using DA = HeuristicLab.Services.Hive.DataAccess; 25 28 using DT = HeuristicLab.Services.Hive.DataTransfer; 26 29 … … 28 31 namespace HeuristicLab.Services.Hive { 29 32 public class AuthorizationManager : IAuthorizationManager { 33 34 private const string NOT_AUTHORIZED = "Current user is not authorized to access the requested resource"; 35 private IPersistenceManager PersistenceManager { 36 get { return ServiceLocator.Instance.PersistenceManager; } 37 } 38 39 private IUserManager UserManager { 40 get { return ServiceLocator.Instance.UserManager; } 41 } 42 43 private IRoleVerifier RoleVerifier { 44 get { return ServiceLocator.Instance.RoleVerifier; } 45 } 46 30 47 public void Authorize(Guid userId) { 31 48 if (userId != ServiceLocator.Instance.UserManager.CurrentUserId) 32 throw new SecurityException( "Current user is not authorized to access object");49 throw new SecurityException(NOT_AUTHORIZED); 33 50 } 34 51 35 52 public void AuthorizeForTask(Guid taskId, DT.Permission requiredPermission) { 36 53 if (ServiceLocator.Instance.RoleVerifier.IsInRole(HiveRoles.Slave)) return; // slave-users can access all tasks 37 38 Permission permission = ServiceLocator.Instance.HiveDao.GetPermissionForTask(taskId, ServiceLocator.Instance.UserManager.CurrentUserId); 39 if (permission == Permission.NotAllowed || (permission != DT.Convert.ToEntity(requiredPermission) && DT.Convert.ToEntity(requiredPermission) == Permission.Full)) 40 throw new SecurityException("Current user is not authorized to access task"); 54 var pm = PersistenceManager; 55 var taskDao = pm.TaskDao; 56 pm.UseTransaction(() => { 57 var task = taskDao.GetById(taskId); 58 if (task == null) throw new SecurityException(NOT_AUTHORIZED); 59 AuthorizeJob(pm, task.JobId, requiredPermission); 60 }); 41 61 } 42 62 43 63 public void AuthorizeForJob(Guid jobId, DT.Permission requiredPermission) { 44 Permission permission = ServiceLocator.Instance.HiveDao.GetPermissionForJob(jobId, ServiceLocator.Instance.UserManager.CurrentUserId); 45 if (permission == Permission.NotAllowed || (permission != DT.Convert.ToEntity(requiredPermission) && DT.Convert.ToEntity(requiredPermission) == Permission.Full)) 46 throw new SecurityException("Current user is not authorized to access task"); 64 var pm = PersistenceManager; 65 pm.UseTransaction(() => { 66 AuthorizeJob(pm, jobId, requiredPermission); 67 }); 47 68 } 48 69 49 70 public void AuthorizeForResourceAdministration(Guid resourceId) { 50 Resource resource = DT.Convert.ToEntity(ServiceLocator.Instance.HiveDao.GetResource(resourceId)); 51 if (resource.OwnerUserId != ServiceLocator.Instance.UserManager.CurrentUserId && !ServiceLocator.Instance.RoleVerifier.IsInRole(HiveRoles.Administrator)) 52 throw new SecurityException("Current user is not authorized to access resource"); 71 var pm = PersistenceManager; 72 var resourceDao = pm.ResourceDao; 73 pm.UseTransaction(() => { 74 var resource = resourceDao.GetById(resourceId); 75 if (resource == null) throw new SecurityException(NOT_AUTHORIZED); 76 if (resource.OwnerUserId != UserManager.CurrentUserId 77 && !RoleVerifier.IsInRole(HiveRoles.Administrator)) { 78 throw new SecurityException(NOT_AUTHORIZED); 79 } 80 }); 81 } 82 83 private DA.Permission GetPermissionForJob(IPersistenceManager pm, Guid jobId, Guid userId) { 84 var jobDao = pm.JobDao; 85 var jobPermissionDao = pm.JobPermissionDao; 86 var job = jobDao.GetById(jobId); 87 if (job == null) return DA.Permission.NotAllowed; 88 if (job.OwnerUserId == userId) return DA.Permission.Full; 89 var jobPermission = jobPermissionDao.GetByJobAndUserId(jobId, userId); 90 if (jobPermission == null) return DA.Permission.NotAllowed; 91 return jobPermission.Permission; 92 } 93 94 private void AuthorizeJob(IPersistenceManager pm, Guid jobId, DT.Permission requiredPermission) { 95 var requiredPermissionEntity = requiredPermission.ToEntity(); 96 DA.Permission permission = GetPermissionForJob(pm, jobId, UserManager.CurrentUserId); 97 if (permission == Permission.NotAllowed 98 || ((permission != requiredPermissionEntity) && requiredPermissionEntity == Permission.Full)) { 99 throw new SecurityException(NOT_AUTHORIZED); 100 } 53 101 } 54 102 } -
stable/HeuristicLab.Services.Hive/3.3/Properties/Settings.Designer.cs
r11920 r12962 1 1 //------------------------------------------------------------------------------ 2 2 // <auto-generated> 3 // This code was generated by a tool.4 // Runtime Version:4.0.30319.340143 // Dieser Code wurde von einem Tool generiert. 4 // Laufzeitversion:4.0.30319.42000 5 5 // 6 // Changes to this file may cause incorrect behavior and will be lost if7 // the code is regenerated.6 // Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn 7 // der Code erneut generiert wird. 8 8 // </auto-generated> 9 9 //------------------------------------------------------------------------------ … … 13 13 14 14 [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "1 2.0.0.0")]15 [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")] 16 16 public sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 17 … … 86 86 } 87 87 } 88 89 [global::System.Configuration.ApplicationScopedSettingAttribute()] 90 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 91 [global::System.Configuration.DefaultSettingValueAttribute("False")] 92 public bool ProfileServicePerformance { 93 get { 94 return ((bool)(this["ProfileServicePerformance"])); 95 } 96 } 97 98 [global::System.Configuration.ApplicationScopedSettingAttribute()] 99 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 100 [global::System.Configuration.DefaultSettingValueAttribute("00:03:00")] 101 public global::System.TimeSpan GenerateStatisticsInterval { 102 get { 103 return ((global::System.TimeSpan)(this["GenerateStatisticsInterval"])); 104 } 105 } 88 106 } 89 107 } -
stable/HeuristicLab.Services.Hive/3.3/Properties/Settings.settings
r9123 r12962 24 24 <Value Profile="(Default)">00:00:20</Value> 25 25 </Setting> 26 <Setting Name="ProfileServicePerformance" Type="System.Boolean" Scope="Application"> 27 <Value Profile="(Default)">False</Value> 28 </Setting> 29 <Setting Name="GenerateStatisticsInterval" Type="System.TimeSpan" Scope="Application"> 30 <Value Profile="(Default)">00:03:00</Value> 31 </Setting> 26 32 </Settings> 27 33 </SettingsFile> -
stable/HeuristicLab.Services.Hive/3.3/ServiceContracts/IHiveService.cs
r12009 r12962 41 41 42 42 [OperationContract] 43 IEnumerable<Task> GetTasks();44 45 [OperationContract]46 IEnumerable<LightweightTask> GetLightweightTasks(IEnumerable<Guid> taskIds);47 48 [OperationContract]49 IEnumerable<LightweightTask> GetLightweightChildTasks(Guid? parentTaskId, bool recursive, bool includeParent);50 51 [OperationContract]52 43 IEnumerable<LightweightTask> GetLightweightJobTasks(Guid jobId); 53 44 … … 65 56 66 57 [OperationContract] 67 void DeleteTask(Guid taskId);68 69 [OperationContract]70 void DeleteChildTasks(Guid parentTaskId);71 72 [OperationContract]73 58 Task UpdateTaskState(Guid taskId, TaskState taskState, Guid? slaveId, Guid? userId, string exception); 74 59 #endregion … … 89 74 Job GetJob(Guid id); 90 75 91 /// <summary>92 /// Returns all task for the current user93 /// </summary>94 76 [OperationContract] 95 77 IEnumerable<Job> GetJobs(); 96 78 97 /// <summary>98 /// Returns all task in the hive (only for admins)99 /// </summary>100 /// <returns></returns>101 [OperationContract]102 IEnumerable<Job> GetAllJobs();103 104 79 [OperationContract] 105 80 Guid AddJob(Job jobDto); … … 142 117 [OperationContract] 143 118 Plugin GetPlugin(Guid pluginId); 144 145 [OperationContract]146 Plugin GetPluginByHash(byte[] hash);147 119 148 120 [OperationContract] … … 155 127 [OperationContract] 156 128 IEnumerable<PluginData> GetPluginDatas(List<Guid> pluginIds); 157 158 [OperationContract]159 void DeletePlugin(Guid pluginId);160 129 #endregion 161 130 … … 171 140 #endregion 172 141 173 #region Resource Methods174 [OperationContract]175 IEnumerable<Resource> GetChildResources(Guid resourceId);176 #endregion177 178 142 #region Slave Methods 179 143 [OperationContract] … … 187 151 188 152 [OperationContract] 189 SlaveGroup GetSlaveGroup(Guid slaveGroupId);190 191 [OperationContract]192 153 IEnumerable<Slave> GetSlaves(); 193 154 … … 217 178 218 179 [OperationContract] 219 IEnumerable<Task> GetTasksByResourceId(Guid resourceId);220 221 [OperationContract]222 180 void TriggerEventManager(bool force); 223 181 … … 234 192 235 193 [OperationContract] 236 void UpdateDowntime(Downtime downtime );194 void UpdateDowntime(Downtime downtimeDto); 237 195 238 196 [OperationContract] … … 251 209 [OperationContract] 252 210 IEnumerable<UserPriority> GetUserPriorities(); 253 #endregion254 255 #region Statistics Methods256 [OperationContract]257 IEnumerable<Statistics> GetStatistics();258 [OperationContract]259 IEnumerable<Statistics> GetStatisticsForTimePeriod(DateTime from, DateTime to);260 211 #endregion 261 212 } -
stable/HeuristicLab.Services.Hive/3.3/ServiceLocator.cs
r12009 r12962 21 21 22 22 using HeuristicLab.Services.Hive.DataAccess; 23 using HeuristicLab.Services.Hive.DataAccess.Interfaces; 24 using HeuristicLab.Services.Hive.DataAccess.Manager; 25 using HeuristicLab.Services.Hive.Manager; 23 26 24 27 namespace HeuristicLab.Services.Hive { 25 26 28 public class ServiceLocator : IServiceLocator { 27 29 private static IServiceLocator instance; … … 34 36 } 35 37 36 private IHiveDao hiveDao; 37 public IHiveDao HiveDao { 38 get { 39 if (hiveDao == null) hiveDao = new HiveDao(); 40 return hiveDao; 41 } 42 } 43 44 public IOptimizedHiveDao OptimizedHiveDao { 38 public IPersistenceManager PersistenceManager { 45 39 get { 46 40 var dataContext = HiveOperationContext.Current != null 47 41 ? HiveOperationContext.Current.DataContext 48 42 : new HiveDataContext(Settings.Default.HeuristicLab_Hive_LinqConnectionString); 49 return new OptimizedHiveDao(dataContext);43 return new PersistenceManager(dataContext); 50 44 } 51 45 } … … 75 69 } 76 70 77 private ITransactionManager transactionManager; 78 public ITransactionManager TransactionManager { 79 get { 80 if (transactionManager == null) transactionManager = new TransactionManager(); 81 return transactionManager; 82 } 71 private IStatisticsGenerator statisticsGenerator; 72 public IStatisticsGenerator StatisticsGenerator { 73 get { return statisticsGenerator ?? (statisticsGenerator = new HiveStatisticsGenerator()); } 83 74 } 84 75 -
stable/HeuristicLab.Services.Hive/3.3/app.config
r11920 r12962 29 29 <value>00:00:20</value> 30 30 </setting> 31 <setting name="ProfileServicePerformance" serializeAs="String"> 32 <value>False</value> 33 </setting> 34 <setting name="GenerateStatisticsInterval" serializeAs="String"> 35 <value>00:03:00</value> 36 </setting> 31 37 </HeuristicLab.Services.Hive.Properties.Settings> 32 38 </applicationSettings> 33 <startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/></startup></configuration> 39 <startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/></startup> 40 </configuration>
Note: See TracChangeset
for help on using the changeset viewer.