Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/Interfaces/IHiveDao.cs @ 6362

Last change on this file since 6362 was 6267, checked in by cneumuel, 14 years ago

#1233

  • extended statistics recording:
    • execution times of users are captured
    • execution times and start-to-finish time of finished jobs is captured (to computer hive overhead)
    • data of deleted jobs is automatically captured in DeletedJobStatistics
  • changed ExecutionTime type in database from string to float (milliseconds are stored instead of TimeSpan.ToString())
  • added IsPrivileged field to job to indicate if it should be executed in a privileged sandbox
  • added CpuUtilization field to slave to be able to report cpu utilization
  • added GetJobsByResourceId to retrieve all jobs which are currently beeing calculated in a slave(-group)
  • TransactionManager now allows to use serializable tranactions (used for lifecycle trigger)
File size: 4.9 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq.Expressions;
4
5namespace HeuristicLab.Services.Hive.DataAccess {
6  using HeuristicLab.Services.Hive.Common.DataTransfer;
7  using DT = HeuristicLab.Services.Hive.Common.DataTransfer;
8
9  public interface IHiveDao {
10    #region Job Methods
11    DT.Job GetJob(Guid id);
12    IEnumerable<DT.Job> GetJobs(Expression<Func<Job, bool>> predicate);
13    Guid AddJob(DT.Job dto);
14    void UpdateJob(DT.Job dto);
15    void DeleteJob(Guid id);
16    IEnumerable<DT.Job> GetWaitingJobs(DT.Slave slave, int count);
17    IEnumerable<DT.Job> GetParentJobs(IEnumerable<Guid> resourceIds, int count, bool finished);
18    DT.Job UpdateJobState(Guid jobId, JobState jobState, Guid? slaveId, Guid? userId, string exception);
19    #endregion
20
21    #region JobData Methods
22    DT.JobData GetJobData(Guid id);
23    IEnumerable<DT.JobData> GetJobDatas(Expression<Func<JobData, bool>> predicate);
24    Guid AddJobData(DT.JobData dto);
25    void UpdateJobData(DT.JobData dto);
26    void DeleteJobData(Guid id);
27    #endregion
28
29    #region StateLog Methods
30    DT.StateLog GetStateLog(Guid id);
31    IEnumerable<DT.StateLog> GetStateLogs(Expression<Func<StateLog, bool>> predicate);
32    Guid AddStateLog(DT.StateLog dto);
33    void UpdateStateLog(DT.StateLog dto);
34    void DeleteStateLog(Guid id);
35    #endregion
36
37    #region HiveExperiment Methods
38    DT.HiveExperiment GetHiveExperiment(Guid id);
39    IEnumerable<DT.HiveExperiment> GetHiveExperiments(Expression<Func<HiveExperiment, bool>> predicate);
40    Guid AddHiveExperiment(DT.HiveExperiment dto);
41    void UpdateHiveExperiment(DT.HiveExperiment dto);
42    void DeleteHiveExperiment(Guid id);
43    #endregion
44
45    #region HiveExperimentPermission Methods
46    DT.HiveExperimentPermission GetHiveExperimentPermission(Guid hiveExperimentId, Guid grantedUserId);
47    IEnumerable<DT.HiveExperimentPermission> GetHiveExperimentPermissions(Expression<Func<HiveExperimentPermission, bool>> predicate);
48    void AddHiveExperimentPermission(DT.HiveExperimentPermission dto);
49    void UpdateHiveExperimentPermission(DT.HiveExperimentPermission dto);
50    void DeleteHiveExperimentPermission(Guid hiveExperimentId, Guid grantedUserId);
51    #endregion
52
53    #region Plugin Methods
54    DT.Plugin GetPlugin(Guid id);
55    IEnumerable<DT.Plugin> GetPlugins(Expression<Func<Plugin, bool>> predicate);
56    Guid AddPlugin(DT.Plugin dto);
57    void UpdatePlugin(DT.Plugin dto);
58    void DeletePlugin(Guid id);
59    #endregion
60
61    #region PluginData Methods
62    DT.PluginData GetPluginData(Guid id);
63    IEnumerable<DT.PluginData> GetPluginDatas(Expression<Func<PluginData, bool>> predicate);
64    Guid AddPluginData(DT.PluginData dto);
65    void UpdatePluginData(DT.PluginData dto);
66    void DeletePluginData(Guid id);
67    #endregion
68
69    #region Calendar Methods
70    #endregion
71
72    #region Slave Methods
73    DT.Slave GetSlave(Guid id);
74    IEnumerable<DT.Slave> GetSlaves(Expression<Func<Slave, bool>> predicate);
75    Guid AddSlave(DT.Slave dto);
76    void UpdateSlave(DT.Slave dto);
77    void DeleteSlave(Guid id);
78    #endregion
79
80    #region SlaveGroup Methods
81    DT.SlaveGroup GetSlaveGroup(Guid id);
82    IEnumerable<DT.SlaveGroup> GetSlaveGroups(Expression<Func<SlaveGroup, bool>> predicate);
83    Guid AddSlaveGroup(DT.SlaveGroup dto);
84    void UpdateSlaveGroup(DT.SlaveGroup dto);
85    void DeleteSlaveGroup(Guid id);
86    #endregion
87
88    #region Resource Methods
89    DT.Resource GetResource(Guid id);
90    IEnumerable<DT.Resource> GetResources(Expression<Func<Resource, bool>> predicate);
91    Guid AddResource(DT.Resource dto);
92    void UpdateResource(DT.Resource dto);
93    void DeleteResource(Guid id);
94    void AssignJobToResource(Guid jobId, Guid resourceId);
95    IEnumerable<DT.Resource> GetAssignedResources(Guid jobId);
96    IEnumerable<DT.Resource> GetParentResources(Guid resourceId);
97    IEnumerable<DT.Job> GetJobsByResourceId(Guid resourceId);
98    #endregion
99
100    #region Authorization Methods
101    Permission GetPermissionForJob(Guid jobId, Guid userId);
102    Permission GetPermissionForExperiment(Guid experimentId, Guid userId);
103    Guid GetExperimentForJob(Guid jobId);
104    #endregion
105
106    #region Lifecycle Methods
107    DateTime GetLastCleanup();
108    void SetLastCleanup(DateTime datetime);
109    #endregion
110
111    #region Appointment Methods
112    DT.Appointment GetAppointment(Guid id);
113    IEnumerable<DT.Appointment> GetAppointments(Expression<Func<UptimeCalendar, bool>> predicate);
114    Guid AddAppointment(DT.Appointment dto);
115    void UpdateAppointment(DT.Appointment dto);
116    void DeleteAppointment(Guid id);
117    #endregion
118
119    #region Statistics Methods
120    DT.Statistics GetStatistic(Guid id);
121    IEnumerable<DT.Statistics> GetStatistics(Expression<Func<Statistics, bool>> predicate);
122    Guid AddStatistics(DT.Statistics dto);
123    void DeleteStatistics(Guid id);
124    List<DT.UserStatistics> GetUserStatistics();
125    #endregion
126  }
127}
Note: See TracBrowser for help on using the repository browser.