Free cookie consent management tool by TermsFeed Policy Generator

Changeset 3018


Ignore:
Timestamp:
03/14/10 12:07:47 (15 years ago)
Author:
kgrading
Message:

added Priority and resource restricted scheduling (#907)

Location:
trunk/sources
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Hive.Contracts/3.2/BusinessObjects/JobDto.cs

    r3011 r3018  
    4848    public DateTime? DateCalculated { get; set; }
    4949    [DataMember]
    50     public int? Priority { get; set; }
     50    public int Priority { get; set; }
    5151    [DataMember]
    5252    public int CoresNeeded { get; set; }
  • trunk/sources/HeuristicLab.Hive.Engine/3.2/HiveEngine.cs

    r3011 r3018  
    5252    public string HiveServerUrl { get; set; }
    5353    public string MultiSubmitCount { get; set; }
     54    public string RessourceIds { get; set; }
    5455
    5556    public HiveEngine() {
     
    9495      IExecutionEngineFacade executionEngineFacade = ServiceLocator.CreateExecutionEngineFacade(HiveServerUrl);
    9596     
     97      if(!String.Empty.Equals(RessourceIds)) {
     98        String[] ids = RessourceIds.Split(';');
     99        foreach (string sid in ids) {       
     100          try {
     101            System.Guid gid = new Guid(sid);
     102            jobObj.JobInfo.AssignedResourceIds.Add(gid);
     103          } catch(Exception ex) {
     104           
     105          }   
     106        }
     107      }     
     108
    96109      int loops = 1;
    97110     
  • trunk/sources/HeuristicLab.Hive.Engine/3.2/HiveEngineEditor.Designer.cs

    r2846 r3018  
    4545    /// </summary>
    4646    private void InitializeComponent() {
    47       this.urlTextBox = new System.Windows.Forms.TextBox();
    4847      this.urlLabel = new System.Windows.Forms.Label();
    4948      this.snapshotButton = new System.Windows.Forms.Button();
    5049      this.multiSubmitTextbox = new System.Windows.Forms.TextBox();
     50      this.urlTextBox = new System.Windows.Forms.TextBox();
     51      this.assignedRessourceTextBox = new System.Windows.Forms.TextBox();
     52      this.label1 = new System.Windows.Forms.Label();
    5153      this.splitContainer1.Panel1.SuspendLayout();
    5254      this.splitContainer1.Panel2.SuspendLayout();
     
    8587      this.scopeView.Size = new System.Drawing.Size(178, 422);
    8688      //
    87       // urlTextBox
    88       //
    89       this.urlTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
    90       this.urlTextBox.Location = new System.Drawing.Point(526, 459);
    91       this.urlTextBox.Name = "urlTextBox";
    92       this.urlTextBox.Size = new System.Drawing.Size(154, 20);
    93       this.urlTextBox.TabIndex = 7;
    94       //
    9589      // urlLabel
    9690      //
     
    124118      this.multiSubmitTextbox.Text = "1";
    125119      //
     120      // urlTextBox
     121      //
     122      this.urlTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
     123      this.urlTextBox.Location = new System.Drawing.Point(526, 459);
     124      this.urlTextBox.Name = "urlTextBox";
     125      this.urlTextBox.Size = new System.Drawing.Size(154, 20);
     126      this.urlTextBox.TabIndex = 7;
     127      //
     128      // assignedRessourceTextBox
     129      //
     130      this.assignedRessourceTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
     131      this.assignedRessourceTextBox.Location = new System.Drawing.Point(412, 457);
     132      this.assignedRessourceTextBox.Name = "assignedRessourceTextBox";
     133      this.assignedRessourceTextBox.Size = new System.Drawing.Size(100, 20);
     134      this.assignedRessourceTextBox.TabIndex = 11;
     135      //
     136      // label1
     137      //
     138      this.label1.AutoSize = true;
     139      this.label1.Location = new System.Drawing.Point(409, 444);
     140      this.label1.Name = "label1";
     141      this.label1.Size = new System.Drawing.Size(85, 13);
     142      this.label1.TabIndex = 12;
     143      this.label1.Text = "Ressource GIDs";
     144      //
    126145      // HiveEngineEditor
    127146      //
     
    132151      this.Controls.Add(this.urlTextBox);
    133152      this.Controls.Add(this.urlLabel);
     153      this.Controls.Add(this.assignedRessourceTextBox);
     154      this.Controls.Add(this.label1);
    134155      this.Name = "HiveEngineEditor";
    135156      this.Size = new System.Drawing.Size(827, 480);
     157      this.Controls.SetChildIndex(this.label1, 0);
     158      this.Controls.SetChildIndex(this.assignedRessourceTextBox, 0);
     159      this.Controls.SetChildIndex(this.urlLabel, 0);
     160      this.Controls.SetChildIndex(this.urlTextBox, 0);
     161      this.Controls.SetChildIndex(this.snapshotButton, 0);
     162      this.Controls.SetChildIndex(this.multiSubmitTextbox, 0);
    136163      this.Controls.SetChildIndex(this.executeButton, 0);
    137164      this.Controls.SetChildIndex(this.abortButton, 0);
     
    140167      this.Controls.SetChildIndex(this.executionTimeLabel, 0);
    141168      this.Controls.SetChildIndex(this.executionTimeTextBox, 0);
    142       this.Controls.SetChildIndex(this.urlLabel, 0);
    143       this.Controls.SetChildIndex(this.urlTextBox, 0);
    144       this.Controls.SetChildIndex(this.snapshotButton, 0);
    145       this.Controls.SetChildIndex(this.multiSubmitTextbox, 0);
    146169      this.splitContainer1.Panel1.ResumeLayout(false);
    147170      this.splitContainer1.Panel2.ResumeLayout(false);
     
    156179    #endregion
    157180
    158     private System.Windows.Forms.TextBox urlTextBox;
    159181    private System.Windows.Forms.Label urlLabel;
    160182    private System.Windows.Forms.Button snapshotButton;
    161183    private System.Windows.Forms.TextBox multiSubmitTextbox;
     184    private System.Windows.Forms.TextBox urlTextBox;
     185    private System.Windows.Forms.TextBox assignedRessourceTextBox;
     186    private System.Windows.Forms.Label label1;
    162187  }
    163188}
  • trunk/sources/HeuristicLab.Hive.Engine/3.2/HiveEngineEditor.cs

    r2846 r3018  
    8080      urlTextBox.DataBindings.Add("Text", HiveEngine, "HiveServerUrl");
    8181      multiSubmitTextbox.DataBindings.Add("Text", HiveEngine, "MultiSubmitCount");
    82      
     82      assignedRessourceTextBox.DataBindings.Add("Text", HiveEngine, "RessourceIds");         
    8383    }
    8484
  • trunk/sources/HeuristicLab.Hive.Server.Core/3.2/ClientCommunicator.cs

    r3013 r3018  
    103103                              " wasn't offline but hasn't sent heartbeats - setting offline");
    104104              client.State = State.offline;
    105               DaoLocator.ClientDao.Update(client);             
     105              DaoLocator.ClientDao.Update(client);
    106106              HiveLogger.Info(this.ToString() + ": Client " + client.Id +
    107107                              " wasn't offline but hasn't sent heartbeats - Resetting all his jobs");
     
    236236    /// <returns></returns>
    237237    public ResponseHB ProcessHeartBeat(HeartBeatData hbData) {
    238      
    239      /* ISession session = factory.GetSessionForCurrentThread();
    240       ITransaction tx = null;*/
    241 
    242       HiveLogger.Info(this.ToString() + ": BEGIN Processing Heartbeat for Client " + hbData.ClientId);
    243 
    244       //try {
    245         HiveLogger.Info(this.ToString() + ": BEGIN Fetching Adapters");
    246       /*  IClientAdapter clientAdapter =
    247           session.GetDataAdapter<ClientDto, IClientAdapter>();
    248 
    249         IJobAdapter jobAdapter =       
    250           session.GetDataAdapter<JobDto, IJobAdapter>(); */
    251         HiveLogger.Info(this.ToString() + ": END Fetched Adapters");
    252         HiveLogger.Info(this.ToString() + ": BEGIN Starting Transaction");
    253         //tx = session.BeginTransaction();
    254         HiveLogger.Info(this.ToString() + ": END Started Transaction");
     238      HiveLogger.Debug(this.ToString() + ": BEGIN Processing Heartbeat for Client " + hbData.ClientId);
     239      HiveLogger.Debug(this.ToString() + ": BEGIN Fetching Adapters");
     240      HiveLogger.Debug(this.ToString() + ": END Fetched Adapters");
     241      HiveLogger.Debug(this.ToString() + ": BEGIN Starting Transaction");
     242
     243      HiveLogger.Debug(this.ToString() + ": END Started Transaction");
    255244
    256245        ResponseHB response = new ResponseHB();
    257246        response.ActionRequest = new List<MessageContainer>();
    258247
    259         HiveLogger.Info(this.ToString() + ": BEGIN Started Client Fetching");
     248        HiveLogger.Debug(this.ToString() + ": BEGIN Started Client Fetching");
    260249        ClientDto client = DaoLocator.ClientDao.FindById(hbData.ClientId);
    261         HiveLogger.Info(this.ToString() + ": END Finished Client Fetching");
     250        HiveLogger.Debug(this.ToString() + ": END Finished Client Fetching");
    262251        // check if the client is logged in
    263252        if (client.State == State.offline || client.State == State.nullState) {
     
    275264
    276265        // save timestamp of this heartbeat
    277         HiveLogger.Info(this.ToString() + ": BEGIN Locking for Heartbeats");
     266        HiveLogger.Debug(this.ToString() + ": BEGIN Locking for Heartbeats");
    278267        heartbeatLock.EnterWriteLock();
    279         HiveLogger.Info(this.ToString() + ": END Locked for Heartbeats");
     268        HiveLogger.Debug(this.ToString() + ": END Locked for Heartbeats");
    280269        if (lastHeartbeats.ContainsKey(hbData.ClientId)) {
    281270          lastHeartbeats[hbData.ClientId] = DateTime.Now;
     
    287276        // check if client has a free core for a new job
    288277        // if true, ask scheduler for a new job for this client
    289         HiveLogger.Info(this.ToString() + ": BEGIN Looking for Client Jobs");
     278        HiveLogger.Debug(this.ToString() + ": BEGIN Looking for Client Jobs");
    290279        if (hbData.FreeCores > 0 && scheduler.ExistsJobForClient(hbData)) {
    291280          response.ActionRequest.Add(new MessageContainer(MessageContainer.MessageType.FetchJob));
     
    293282          response.ActionRequest.Add(new MessageContainer(MessageContainer.MessageType.NoMessage));
    294283        }
    295         HiveLogger.Info(this.ToString() + ": END Looked for Client Jobs");
     284        HiveLogger.Debug(this.ToString() + ": END Looked for Client Jobs");
    296285        response.Success = true;
    297286        response.StatusMessage = ApplicationConstants.RESPONSE_COMMUNICATOR_HEARTBEAT_RECEIVED;
    298287
    299         HiveLogger.Info(this.ToString() + ": BEGIN Processing Heartbeat Jobs");
     288        HiveLogger.Debug(this.ToString() + ": BEGIN Processing Heartbeat Jobs");
    300289        processJobProcess(hbData, response);
    301         HiveLogger.Info(this.ToString() + ": END Processed Heartbeat Jobs");
     290        HiveLogger.Debug(this.ToString() + ": END Processed Heartbeat Jobs");
    302291       
    303292        DaoLocator.ClientDao.Update(client);
    304293
    305294        //tx.Commit();
    306         HiveLogger.Info(this.ToString() + ": END Processed Heartbeat for Client " + hbData.ClientId);
     295        HiveLogger.Debug(this.ToString() + ": END Processed Heartbeat for Client " + hbData.ClientId);
    307296        return response;
    308       } /*
    309       catch (Exception ex) {
    310         if (tx != null)
    311           tx.Rollback();
    312         throw ex;
    313       }
    314       finally {
    315         if (session != null)
    316           session.EndSession();
    317       }   
    318     }     */
     297      }
    319298
    320299    /// <summary>
  • trunk/sources/HeuristicLab.Hive.Server.Core/3.2/DefaultScheduler.cs

    r3011 r3018  
    1010
    1111namespace HeuristicLab.Hive.Server.Core {
    12   class DefaultScheduler: IScheduler {
    13 
     12  internal class DefaultScheduler : IScheduler {
    1413    //private ISessionFactory factory;
    1514
     
    2423
    2524    public bool ExistsJobForClient(HeuristicLab.Hive.Contracts.BusinessObjects.HeartBeatData hbData) {
    26       //ISession session = factory.GetSessionForCurrentThread();
    27 
    28       //try {
    29         /*IJobAdapter jobAdapter =
    30           session.GetDataAdapter<JobDto, IJobAdapter>();*/
    31 
    32         List<JobDto> allOfflineJobsForClient = new List<JobDto>(DaoLocator.JobDao.FindFittingJobsForClient(State.offline, hbData.FreeCores, hbData.FreeMemory));
    33           /*jobAdapter.FindJobs(State.offline,
    34           hbData.FreeCores,
    35           hbData.FreeMemory,
    36           hbData.ClientId));*/
    37         return (allOfflineJobsForClient != null && allOfflineJobsForClient.Count > 0);
    38       //}
    39       /*finally {
    40         if (session != null)
    41           session.EndSession();
    42       } */
    43     }   
     25      List<JobDto> allOfflineJobsForClient =
     26        new List<JobDto>(DaoLocator.JobDao.FindFittingJobsForClient(State.offline, hbData.FreeCores, hbData.FreeMemory,
     27                                                                    hbData.ClientId));
     28      return (allOfflineJobsForClient != null && allOfflineJobsForClient.Count > 0);
     29    }
    4430
    4531    public HeuristicLab.Hive.Contracts.BusinessObjects.JobDto GetNextJobForClient(Guid clientId) {
    46       /*ISession session = factory.GetSessionForCurrentThread();
     32      /// Critical section ///
     33      jobLock.WaitOne();
    4734
    48       try {
    49         IJobAdapter jobAdapter =
    50           session.GetDataAdapter<JobDto, IJobAdapter>();
    51 
    52         IClientAdapter clientAdapter =
    53           session.GetDataAdapter<ClientDto, IClientAdapter>();*/
    54 
    55         /// Critical section ///
    56         jobLock.WaitOne();
    57 
    58         ClientDto client = DaoLocator.ClientDao.FindById(clientId);
     35      ClientDto client = DaoLocator.ClientDao.FindById(clientId);
    5936      LinkedList<JobDto> allOfflineJobsForClient =
    6037        new LinkedList<JobDto>(DaoLocator.JobDao.FindFittingJobsForClient(State.offline, client.NrOfFreeCores,
    61                                                                           client.FreeMemory));
     38                                                                          client.FreeMemory, client.Id));
    6239
    63         JobDto jobToCalculate = null;
    64         if (allOfflineJobsForClient != null && allOfflineJobsForClient.Count > 0) {
    65           jobToCalculate = allOfflineJobsForClient.First.Value;
    66           jobToCalculate.State = State.calculating;
    67           jobToCalculate.Client = client;
    68           jobToCalculate.Client.State = State.calculating;         
    69           jobToCalculate.DateCalculated = DateTime.Now;
    70           DaoLocator.JobDao.AssignClientToJob(client.Id, jobToCalculate.Id);
    71           DaoLocator.JobDao.Update(jobToCalculate);
    72           DaoLocator.ClientDao.Update(jobToCalculate.Client);
    73         }
    74         jobLock.ReleaseMutex();
    75         /// End Critical section ///
     40      JobDto jobToCalculate = null;
     41      if (allOfflineJobsForClient != null && allOfflineJobsForClient.Count > 0) {
     42        jobToCalculate = allOfflineJobsForClient.First.Value;
     43        jobToCalculate.State = State.calculating;
     44        jobToCalculate.Client = client;
     45        jobToCalculate.Client.State = State.calculating;
     46        jobToCalculate.DateCalculated = DateTime.Now;
     47        DaoLocator.JobDao.AssignClientToJob(client.Id, jobToCalculate.Id);
     48        DaoLocator.JobDao.Update(jobToCalculate);
     49        DaoLocator.ClientDao.Update(jobToCalculate.Client);
     50      }
     51      jobLock.ReleaseMutex();
     52      /// End Critical section ///
    7653
    77         return jobToCalculate;
    78       }
    79       /*finally {
    80         if (session != null)
    81           session.EndSession();
    82       }
    83     }   */
     54      return jobToCalculate;
     55    }
    8456
    8557    #endregion
  • trunk/sources/HeuristicLab.Hive.Server.Core/3.2/JobManager.cs

    r3011 r3018  
    184184          DaoLocator.JobDao.InsertWithAttachedJob(job);
    185185          DaoLocator.PluginInfoDao.InsertPluginDependenciesForJob(job.JobInfo);
    186           //jobAdapter.UpdateSerializedJob(job);
     186         
    187187          response.Success = true;
    188188          response.Obj = job.JobInfo;
  • trunk/sources/HeuristicLab.Hive.Server.DataAccess/3.2/IClientGroupDao.cs

    r3011 r3018  
    1212
    1313    IEnumerable<ClientGroupDto> FindAllWithSubGroupsAndClients();
     14    IEnumerable<Guid> FindAllGroupAndParentGroupIdsForClient(Guid clientId);
    1415  }
    1516}
  • trunk/sources/HeuristicLab.Hive.Server.DataAccess/3.2/IJobDao.cs

    r3011 r3018  
    1919    byte[] GetBinaryJobFile(Guid jobId);
    2020
    21     IEnumerable<JobDto> FindFittingJobsForClient(State state, int freeCores, int freeMemory);
     21    IEnumerable<JobDto> FindFittingJobsForClient(State state, int freeCores, int freeMemory, Guid clientGuid);
    2222    Stream GetSerializedJobStream(Guid jobId);
    2323  }
  • trunk/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/ClientGroupDao.cs

    r3011 r3018  
    109109      foreach (Client client in qClients) {
    110110        parentClientGroup.Resources.Add(cd.EntityToDto(client, null));                       
     111      }     
     112    }
     113
     114    public IEnumerable<Guid> FindAllGroupAndParentGroupIdsForClient(Guid clientId) {
     115      List<Guid> guids = new List<Guid>();
     116      Client c = Context.Clients.SingleOrDefault(client => client.ResourceId.Equals(clientId));
     117      FindAllGroupAndParentGroupIdsForClientRecursive(c.Resource, guids);
     118      return guids;
     119    }
     120
     121    private void FindAllGroupAndParentGroupIdsForClientRecursive(Resource resource, List<Guid> guids) {
     122      foreach (ClientGroup_Resource cgr in resource.ClientGroup_Resources) {
     123        guids.Add(cgr.ClientGroupId);
     124        FindAllGroupAndParentGroupIdsForClientRecursive(cgr.ClientGroup.Resource, guids);       
    111125      }
    112      
    113126    }
    114127
  • trunk/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/Hive.dbml

    r3011 r3018  
    77      <Column Name="JobId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" CanBeNull="false" />
    88      <Column Name="AssignedRessourcesId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" />
     9      <Association Name="Resource_AssignedResource" Member="Resource" ThisKey="ResourceId" OtherKey="ResourceId" Type="Resource" IsForeignKey="true" DeleteRule="CASCADE" DeleteOnNull="true" />
    910      <Association Name="Job_AssignedResource" Member="Job" ThisKey="JobId" OtherKey="JobId" Type="Job" IsForeignKey="true" DeleteRule="CASCADE" DeleteOnNull="true" />
    10       <Association Name="Resource_AssignedResource" Member="Resource" ThisKey="ResourceId" OtherKey="ResourceId" Type="Resource" IsForeignKey="true" DeleteRule="CASCADE" DeleteOnNull="true" />
    1111    </Type>
    1212  </Table>
     
    4444    </Type>
    4545  </Table>
    46   <Table Name="dbo.Job" Member="Jobs">
    47     <Type Name="Job">
    48       <Column Name="JobId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" />
    49       <Column Name="ParentJobId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="true" />
    50       <Column Name="JobState" Type="System.String" DbType="VarChar(MAX)" CanBeNull="true" />
    51       <Column Name="ResourceId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="true" />
    52       <Column Name="Percentage" Type="System.Double" DbType="Float" CanBeNull="true" />
    53       <Column Name="SerializedJob" Type="System.Data.Linq.Binary" DbType="VarBinary(MAX)" CanBeNull="true" UpdateCheck="Never" IsDelayLoaded="true" />
    54       <Column Name="DateCreated" Type="System.DateTime" DbType="DateTime" CanBeNull="true" />
    55       <Column Name="DateCalculated" Type="System.DateTime" DbType="DateTime" CanBeNull="true" />
    56       <Column Name="DateFinished" Type="System.DateTime" DbType="DateTime" CanBeNull="true" />
    57       <Column Name="Priority" Type="System.Int32" DbType="Int" CanBeNull="true" />
    58       <Column Name="ProjectId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="true" />
    59       <Column Name="UserId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="true" />
    60       <Column Name="CoresNeeded" Type="System.Int32" DbType="Int" CanBeNull="false" />
    61       <Column Name="MemoryNeeded" Type="System.Int32" DbType="Int" CanBeNull="false" />
    62       <Association Name="Job_AssignedResource" Member="AssignedResources" ThisKey="JobId" OtherKey="JobId" Type="AssignedResource" />
    63       <Association Name="Job_Job" Member="Jobs" ThisKey="JobId" OtherKey="ParentJobId" Type="Job" />
    64       <Association Name="Job_RequiredPlugin" Member="RequiredPlugins" ThisKey="JobId" OtherKey="JobId" Type="RequiredPlugin" />
    65       <Association Name="Job_Job" Member="Job1" ThisKey="ParentJobId" OtherKey="JobId" Type="Job" IsForeignKey="true" />
    66       <Association Name="Project_Job" Member="Project" ThisKey="ProjectId" OtherKey="ProjectId" Type="Project" IsForeignKey="true" DeleteRule="SET NULL" />
    67       <Association Name="Client_Job" Member="Client" ThisKey="ResourceId" OtherKey="ResourceId" Type="Client" IsForeignKey="true" DeleteRule="SET NULL" />
    68     </Type>
    69   </Table>
    7046  <Table Name="dbo.PluginInfo" Member="PluginInfos">
    7147    <Type Name="PluginInfo">
     
    8965      <Column Name="PluginId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" CanBeNull="false" />
    9066      <Column Name="RequiredPluginId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" UpdateCheck="Never" />
     67      <Association Name="PluginInfo_RequiredPlugin" Member="PluginInfo" ThisKey="PluginId" OtherKey="PluginId" Type="PluginInfo" IsForeignKey="true" DeleteRule="CASCADE" DeleteOnNull="true" />
    9168      <Association Name="Job_RequiredPlugin" Member="Job" ThisKey="JobId" OtherKey="JobId" Type="Job" IsForeignKey="true" />
    92       <Association Name="PluginInfo_RequiredPlugin" Member="PluginInfo" ThisKey="PluginId" OtherKey="PluginId" Type="PluginInfo" IsForeignKey="true" DeleteRule="CASCADE" DeleteOnNull="true" />
    9369    </Type>
    9470  </Table>
     
    12096    </Type>
    12197  </Table>
     98  <Table Name="dbo.Job" Member="Jobs">
     99    <Type Name="Job">
     100      <Column Name="JobId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" />
     101      <Column Name="ParentJobId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="true" />
     102      <Column Name="JobState" Type="System.String" DbType="VarChar(MAX)" CanBeNull="true" />
     103      <Column Name="ResourceId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="true" />
     104      <Column Name="Percentage" Type="System.Double" DbType="Float" CanBeNull="true" />
     105      <Column Name="SerializedJob" Type="System.Data.Linq.Binary" DbType="VarBinary(MAX)" CanBeNull="true" UpdateCheck="Never" />
     106      <Column Name="DateCreated" Type="System.DateTime" DbType="DateTime" CanBeNull="true" />
     107      <Column Name="DateCalculated" Type="System.DateTime" DbType="DateTime" CanBeNull="true" />
     108      <Column Name="DateFinished" Type="System.DateTime" DbType="DateTime" CanBeNull="true" />
     109      <Column Name="Priority" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" />
     110      <Column Name="ProjectId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="true" />
     111      <Column Name="UserId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="true" />
     112      <Column Name="CoresNeeded" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" />
     113      <Column Name="MemoryNeeded" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" />
     114      <Association Name="Job_AssignedResource" Member="AssignedResources" ThisKey="JobId" OtherKey="JobId" Type="AssignedResource" />
     115      <Association Name="Job_RequiredPlugin" Member="RequiredPlugins" ThisKey="JobId" OtherKey="JobId" Type="RequiredPlugin" />
     116      <Association Name="Job_Job" Member="Jobs" ThisKey="JobId" OtherKey="ParentJobId" Type="Job" />
     117      <Association Name="Client_Job" Member="Client" ThisKey="ResourceId" OtherKey="ResourceId" Type="Client" IsForeignKey="true" DeleteRule="SET NULL" />
     118      <Association Name="Job_Job" Member="Job1" ThisKey="ParentJobId" OtherKey="JobId" Type="Job" IsForeignKey="true" />
     119      <Association Name="Project_Job" Member="Project" ThisKey="ProjectId" OtherKey="ProjectId" Type="Project" IsForeignKey="true" DeleteRule="SET NULL" />
     120    </Type>
     121  </Table>
    122122</Database>
  • trunk/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/Hive.dbml.layout

    r3011 r3018  
    3333      </nestedChildShapes>
    3434    </classShape>
    35     <classShape Id="63840838-dba2-4615-b10b-b812f68ec9a1" absoluteBounds="9, 6.25, 2, 3.5016097005208318">
    36       <DataClassMoniker Name="/HiveDataContext/Job" />
    37       <nestedChildShapes>
    38         <elementListCompartment Id="3758a5b7-d1ea-4673-b0e6-db5da665526e" absoluteBounds="9.015, 6.7100000000000009, 1.9700000000000002, 2.941609700520833" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
    39       </nestedChildShapes>
    40     </classShape>
    4135    <classShape Id="a054f27a-f931-4019-b8a0-500bbd926986" absoluteBounds="12, 6.375, 2, 1.5785953776041666">
    4236      <DataClassMoniker Name="/HiveDataContext/PluginInfo" />
     
    6862        <classShapeMoniker Id="fdda4acc-8a1b-47c8-95ae-5e366f019c84" />
    6963        <classShapeMoniker Id="0535d2ec-d743-4b65-a1d6-70f7af1eead3" />
    70       </nodes>
    71     </associationConnector>
    72     <associationConnector edgePoints="[(10 : 6.25); (10 : 4.34375); (5.5 : 4.34375)]" fixedFrom="NotFixed" fixedTo="NotFixed">
    73       <AssociationMoniker Name="/HiveDataContext/Job/Job_AssignedResource" />
    74       <nodes>
    75         <classShapeMoniker Id="63840838-dba2-4615-b10b-b812f68ec9a1" />
    76         <classShapeMoniker Id="3bbfffd4-3ad8-4ff9-b0ff-bdddca70b322" />
    77       </nodes>
    78     </associationConnector>
    79     <associationConnector edgePoints="[(9.70923076923077 : 9.75160970052083); (9.70923076923077 : 10.0016097005208); (10.3046153846154 : 10.0016097005208); (10.3046153846154 : 9.75160970052083)]" fixedFrom="NotFixed" fixedTo="NotFixed">
    80       <AssociationMoniker Name="/HiveDataContext/Job/Job_Job" />
    81       <nodes>
    82         <classShapeMoniker Id="63840838-dba2-4615-b10b-b812f68ec9a1" />
    83         <classShapeMoniker Id="63840838-dba2-4615-b10b-b812f68ec9a1" />
    84       </nodes>
    85     </associationConnector>
    86     <associationConnector edgePoints="[(8.25 : 11.0969962565104); (9.32336288461538 : 11.0969962565104); (9.32336288461538 : 9.75160970052083)]" fixedFrom="NotFixed" fixedTo="NotFixed">
    87       <AssociationMoniker Name="/HiveDataContext/Project/Project_Job" />
    88       <nodes>
    89         <classShapeMoniker Id="401c6a1e-69dc-43e4-a4c6-bfc7c2130170" />
    90         <classShapeMoniker Id="63840838-dba2-4615-b10b-b812f68ec9a1" />
    91       </nodes>
    92     </associationConnector>
    93     <associationConnector edgePoints="[(11 : 9.25080485026042); (12 : 9.25080485026042)]" fixedFrom="NotFixed" fixedTo="NotFixed">
    94       <AssociationMoniker Name="/HiveDataContext/Job/Job_RequiredPlugin" />
    95       <nodes>
    96         <classShapeMoniker Id="63840838-dba2-4615-b10b-b812f68ec9a1" />
    97         <classShapeMoniker Id="59a84aec-bc57-49b5-a709-71cdf7612b31" />
    9864      </nodes>
    9965    </associationConnector>
     
    139105      </nodes>
    140106    </associationConnector>
    141     <associationConnector edgePoints="[(5.625 : 8.78770182291667); (9 : 8.78770182291667)]" fixedFrom="NotFixed" fixedTo="NotFixed">
    142       <AssociationMoniker Name="/HiveDataContext/Client/Client_Job" />
    143       <nodes>
    144         <classShapeMoniker Id="a2f0b500-6e5f-4de0-b608-64e4b55a73c4" />
    145         <classShapeMoniker Id="63840838-dba2-4615-b10b-b812f68ec9a1" />
    146       </nodes>
    147     </associationConnector>
    148107    <associationConnector edgePoints="[(4.5 : 6.94399251302083); (4.5 : 7.625)]" fixedFrom="NotFixed" fixedTo="NotFixed">
    149108      <AssociationMoniker Name="/HiveDataContext/Resource/Resource_Client" />
     
    160119      </nodes>
    161120    </associationConnector>
     121    <classShape Id="9af04358-a545-4e37-bb13-d249fecfa769" absoluteBounds="9, 6.5, 2, 3.5016097005208326">
     122      <DataClassMoniker Name="/HiveDataContext/Job" />
     123      <nestedChildShapes>
     124        <elementListCompartment Id="b55e771e-4639-44c8-9d16-727b309f657d" absoluteBounds="9.015, 6.96, 1.9700000000000002, 2.941609700520833" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
     125      </nestedChildShapes>
     126    </classShape>
     127    <associationConnector edgePoints="[(10 : 6.5); (10 : 4.34375); (5.5 : 4.34375)]" fixedFrom="Algorithm" fixedTo="Algorithm">
     128      <AssociationMoniker Name="/HiveDataContext/Job/Job_AssignedResource" />
     129      <nodes>
     130        <classShapeMoniker Id="9af04358-a545-4e37-bb13-d249fecfa769" />
     131        <classShapeMoniker Id="3bbfffd4-3ad8-4ff9-b0ff-bdddca70b322" />
     132      </nodes>
     133    </associationConnector>
     134    <associationConnector edgePoints="[(11 : 9.37580485026042); (12 : 9.37580485026042)]" fixedFrom="Algorithm" fixedTo="Algorithm">
     135      <AssociationMoniker Name="/HiveDataContext/Job/Job_RequiredPlugin" />
     136      <nodes>
     137        <classShapeMoniker Id="9af04358-a545-4e37-bb13-d249fecfa769" />
     138        <classShapeMoniker Id="59a84aec-bc57-49b5-a709-71cdf7612b31" />
     139      </nodes>
     140    </associationConnector>
     141    <associationConnector edgePoints="[(5.625 : 8.91270182291667); (9 : 8.91270182291667)]" fixedFrom="Algorithm" fixedTo="Algorithm">
     142      <AssociationMoniker Name="/HiveDataContext/Client/Client_Job" />
     143      <nodes>
     144        <classShapeMoniker Id="a2f0b500-6e5f-4de0-b608-64e4b55a73c4" />
     145        <classShapeMoniker Id="9af04358-a545-4e37-bb13-d249fecfa769" />
     146      </nodes>
     147    </associationConnector>
     148    <associationConnector edgePoints="[(9.70923076923077 : 10.0016097005208); (9.70923076923077 : 10.2516097005208); (10.3046153846154 : 10.2516097005208); (10.3046153846154 : 10.0016097005208)]" fixedFrom="NotFixed" fixedTo="NotFixed">
     149      <AssociationMoniker Name="/HiveDataContext/Job/Job_Job" />
     150      <nodes>
     151        <classShapeMoniker Id="9af04358-a545-4e37-bb13-d249fecfa769" />
     152        <classShapeMoniker Id="9af04358-a545-4e37-bb13-d249fecfa769" />
     153      </nodes>
     154    </associationConnector>
     155    <associationConnector edgePoints="[(8.25 : 11.0969962565104); (9.32336288461538 : 11.0969962565104); (9.32336288461538 : 10.0016097005208)]" fixedFrom="Algorithm" fixedTo="Algorithm">
     156      <AssociationMoniker Name="/HiveDataContext/Project/Project_Job" />
     157      <nodes>
     158        <classShapeMoniker Id="401c6a1e-69dc-43e4-a4c6-bfc7c2130170" />
     159        <classShapeMoniker Id="9af04358-a545-4e37-bb13-d249fecfa769" />
     160      </nodes>
     161    </associationConnector>
    162162  </nestedChildShapes>
    163163</ordesignerObjectsDiagram>
  • trunk/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/Hive.designer.cs

    r3011 r3018  
    4646    partial void UpdateClientGroup_Resource(ClientGroup_Resource instance);
    4747    partial void DeleteClientGroup_Resource(ClientGroup_Resource instance);
    48     partial void InsertJob(Job instance);
    49     partial void UpdateJob(Job instance);
    50     partial void DeleteJob(Job instance);
    5148    partial void InsertPluginInfo(PluginInfo instance);
    5249    partial void UpdatePluginInfo(PluginInfo instance);
     
    6461    partial void UpdateClient(Client instance);
    6562    partial void DeleteClient(Client instance);
     63    partial void InsertJob(Job instance);
     64    partial void UpdateJob(Job instance);
     65    partial void DeleteJob(Job instance);
    6666    #endregion
    6767   
     
    136136    }
    137137   
     138    public System.Data.Linq.Table<PluginInfo> PluginInfos
     139    {
     140      get
     141      {
     142        return this.GetTable<PluginInfo>();
     143      }
     144    }
     145   
     146    public System.Data.Linq.Table<Project> Projects
     147    {
     148      get
     149      {
     150        return this.GetTable<Project>();
     151      }
     152    }
     153   
     154    public System.Data.Linq.Table<RequiredPlugin> RequiredPlugins
     155    {
     156      get
     157      {
     158        return this.GetTable<RequiredPlugin>();
     159      }
     160    }
     161   
     162    public System.Data.Linq.Table<Resource> Resources
     163    {
     164      get
     165      {
     166        return this.GetTable<Resource>();
     167      }
     168    }
     169   
     170    public System.Data.Linq.Table<Client> Clients
     171    {
     172      get
     173      {
     174        return this.GetTable<Client>();
     175      }
     176    }
     177   
    138178    public System.Data.Linq.Table<Job> Jobs
    139179    {
     
    141181      {
    142182        return this.GetTable<Job>();
    143       }
    144     }
    145    
    146     public System.Data.Linq.Table<PluginInfo> PluginInfos
    147     {
    148       get
    149       {
    150         return this.GetTable<PluginInfo>();
    151       }
    152     }
    153    
    154     public System.Data.Linq.Table<Project> Projects
    155     {
    156       get
    157       {
    158         return this.GetTable<Project>();
    159       }
    160     }
    161    
    162     public System.Data.Linq.Table<RequiredPlugin> RequiredPlugins
    163     {
    164       get
    165       {
    166         return this.GetTable<RequiredPlugin>();
    167       }
    168     }
    169    
    170     public System.Data.Linq.Table<Resource> Resources
    171     {
    172       get
    173       {
    174         return this.GetTable<Resource>();
    175       }
    176     }
    177    
    178     public System.Data.Linq.Table<Client> Clients
    179     {
    180       get
    181       {
    182         return this.GetTable<Client>();
    183183      }
    184184    }
     
    197197    private System.Guid _AssignedRessourcesId;
    198198   
     199    private EntityRef<Resource> _Resource;
     200   
    199201    private EntityRef<Job> _Job;
    200    
    201     private EntityRef<Resource> _Resource;
    202202   
    203203    #region Extensibility Method Definitions
     
    215215    public AssignedResource()
    216216    {
     217      this._Resource = default(EntityRef<Resource>);
    217218      this._Job = default(EntityRef<Job>);
    218       this._Resource = default(EntityRef<Resource>);
    219219      OnCreated();
    220220    }
     
    288288    }
    289289   
     290    [Association(Name="Resource_AssignedResource", Storage="_Resource", ThisKey="ResourceId", OtherKey="ResourceId", IsForeignKey=true, DeleteOnNull=true, DeleteRule="CASCADE")]
     291    public Resource Resource
     292    {
     293      get
     294      {
     295        return this._Resource.Entity;
     296      }
     297      set
     298      {
     299        Resource previousValue = this._Resource.Entity;
     300        if (((previousValue != value)
     301              || (this._Resource.HasLoadedOrAssignedValue == false)))
     302        {
     303          this.SendPropertyChanging();
     304          if ((previousValue != null))
     305          {
     306            this._Resource.Entity = null;
     307            previousValue.AssignedResources.Remove(this);
     308          }
     309          this._Resource.Entity = value;
     310          if ((value != null))
     311          {
     312            value.AssignedResources.Add(this);
     313            this._ResourceId = value.ResourceId;
     314          }
     315          else
     316          {
     317            this._ResourceId = default(System.Guid);
     318          }
     319          this.SendPropertyChanged("Resource");
     320        }
     321      }
     322    }
     323   
    290324    [Association(Name="Job_AssignedResource", Storage="_Job", ThisKey="JobId", OtherKey="JobId", IsForeignKey=true, DeleteOnNull=true, DeleteRule="CASCADE")]
    291325    public Job Job
     
    318352          }
    319353          this.SendPropertyChanged("Job");
    320         }
    321       }
    322     }
    323    
    324     [Association(Name="Resource_AssignedResource", Storage="_Resource", ThisKey="ResourceId", OtherKey="ResourceId", IsForeignKey=true, DeleteOnNull=true, DeleteRule="CASCADE")]
    325     public Resource Resource
    326     {
    327       get
    328       {
    329         return this._Resource.Entity;
    330       }
    331       set
    332       {
    333         Resource previousValue = this._Resource.Entity;
    334         if (((previousValue != value)
    335               || (this._Resource.HasLoadedOrAssignedValue == false)))
    336         {
    337           this.SendPropertyChanging();
    338           if ((previousValue != null))
    339           {
    340             this._Resource.Entity = null;
    341             previousValue.AssignedResources.Remove(this);
    342           }
    343           this._Resource.Entity = value;
    344           if ((value != null))
    345           {
    346             value.AssignedResources.Add(this);
    347             this._ResourceId = value.ResourceId;
    348           }
    349           else
    350           {
    351             this._ResourceId = default(System.Guid);
    352           }
    353           this.SendPropertyChanged("Resource");
    354354        }
    355355      }
     
    10131013  }
    10141014 
    1015   [Table(Name="dbo.Job")]
    1016   public partial class Job : INotifyPropertyChanging, INotifyPropertyChanged
    1017   {
    1018    
    1019     private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
    1020    
    1021     private System.Guid _JobId;
    1022    
    1023     private System.Nullable<System.Guid> _ParentJobId;
    1024    
    1025     private string _JobState;
    1026    
    1027     private System.Nullable<System.Guid> _ResourceId;
    1028    
    1029     private System.Nullable<double> _Percentage;
    1030    
    1031     private System.Data.Linq.Link<System.Data.Linq.Binary> _SerializedJob;
    1032    
    1033     private System.Nullable<System.DateTime> _DateCreated;
    1034    
    1035     private System.Nullable<System.DateTime> _DateCalculated;
    1036    
    1037     private System.Nullable<System.DateTime> _DateFinished;
    1038    
    1039     private System.Nullable<int> _Priority;
    1040    
    1041     private System.Nullable<System.Guid> _ProjectId;
    1042    
    1043     private System.Nullable<System.Guid> _UserId;
    1044    
    1045     private int _CoresNeeded;
    1046    
    1047     private int _MemoryNeeded;
    1048    
    1049     private EntitySet<AssignedResource> _AssignedResources;
    1050    
    1051     private EntitySet<Job> _Jobs;
    1052    
    1053     private EntitySet<RequiredPlugin> _RequiredPlugins;
    1054    
    1055     private EntityRef<Job> _Job1;
    1056    
    1057     private EntityRef<Project> _Project;
    1058    
    1059     private EntityRef<Client> _Client;
    1060    
    1061     #region Extensibility Method Definitions
    1062     partial void OnLoaded();
    1063     partial void OnValidate(System.Data.Linq.ChangeAction action);
    1064     partial void OnCreated();
    1065     partial void OnJobIdChanging(System.Guid value);
    1066     partial void OnJobIdChanged();
    1067     partial void OnParentJobIdChanging(System.Nullable<System.Guid> value);
    1068     partial void OnParentJobIdChanged();
    1069     partial void OnJobStateChanging(string value);
    1070     partial void OnJobStateChanged();
    1071     partial void OnResourceIdChanging(System.Nullable<System.Guid> value);
    1072     partial void OnResourceIdChanged();
    1073     partial void OnPercentageChanging(System.Nullable<double> value);
    1074     partial void OnPercentageChanged();
    1075     partial void OnSerializedJobChanging(System.Data.Linq.Binary value);
    1076     partial void OnSerializedJobChanged();
    1077     partial void OnDateCreatedChanging(System.Nullable<System.DateTime> value);
    1078     partial void OnDateCreatedChanged();
    1079     partial void OnDateCalculatedChanging(System.Nullable<System.DateTime> value);
    1080     partial void OnDateCalculatedChanged();
    1081     partial void OnDateFinishedChanging(System.Nullable<System.DateTime> value);
    1082     partial void OnDateFinishedChanged();
    1083     partial void OnPriorityChanging(System.Nullable<int> value);
    1084     partial void OnPriorityChanged();
    1085     partial void OnProjectIdChanging(System.Nullable<System.Guid> value);
    1086     partial void OnProjectIdChanged();
    1087     partial void OnUserIdChanging(System.Nullable<System.Guid> value);
    1088     partial void OnUserIdChanged();
    1089     partial void OnCoresNeededChanging(int value);
    1090     partial void OnCoresNeededChanged();
    1091     partial void OnMemoryNeededChanging(int value);
    1092     partial void OnMemoryNeededChanged();
    1093     #endregion
    1094    
    1095     public Job()
    1096     {
    1097       this._AssignedResources = new EntitySet<AssignedResource>(new Action<AssignedResource>(this.attach_AssignedResources), new Action<AssignedResource>(this.detach_AssignedResources));
    1098       this._Jobs = new EntitySet<Job>(new Action<Job>(this.attach_Jobs), new Action<Job>(this.detach_Jobs));
    1099       this._RequiredPlugins = new EntitySet<RequiredPlugin>(new Action<RequiredPlugin>(this.attach_RequiredPlugins), new Action<RequiredPlugin>(this.detach_RequiredPlugins));
    1100       this._Job1 = default(EntityRef<Job>);
    1101       this._Project = default(EntityRef<Project>);
    1102       this._Client = default(EntityRef<Client>);
    1103       OnCreated();
    1104     }
    1105    
    1106     [Column(Storage="_JobId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true)]
    1107     public System.Guid JobId
    1108     {
    1109       get
    1110       {
    1111         return this._JobId;
    1112       }
    1113       set
    1114       {
    1115         if ((this._JobId != value))
    1116         {
    1117           this.OnJobIdChanging(value);
    1118           this.SendPropertyChanging();
    1119           this._JobId = value;
    1120           this.SendPropertyChanged("JobId");
    1121           this.OnJobIdChanged();
    1122         }
    1123       }
    1124     }
    1125    
    1126     [Column(Storage="_ParentJobId", DbType="UniqueIdentifier")]
    1127     public System.Nullable<System.Guid> ParentJobId
    1128     {
    1129       get
    1130       {
    1131         return this._ParentJobId;
    1132       }
    1133       set
    1134       {
    1135         if ((this._ParentJobId != value))
    1136         {
    1137           if (this._Job1.HasLoadedOrAssignedValue)
    1138           {
    1139             throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
    1140           }
    1141           this.OnParentJobIdChanging(value);
    1142           this.SendPropertyChanging();
    1143           this._ParentJobId = value;
    1144           this.SendPropertyChanged("ParentJobId");
    1145           this.OnParentJobIdChanged();
    1146         }
    1147       }
    1148     }
    1149    
    1150     [Column(Storage="_JobState", DbType="VarChar(MAX)")]
    1151     public string JobState
    1152     {
    1153       get
    1154       {
    1155         return this._JobState;
    1156       }
    1157       set
    1158       {
    1159         if ((this._JobState != value))
    1160         {
    1161           this.OnJobStateChanging(value);
    1162           this.SendPropertyChanging();
    1163           this._JobState = value;
    1164           this.SendPropertyChanged("JobState");
    1165           this.OnJobStateChanged();
    1166         }
    1167       }
    1168     }
    1169    
    1170     [Column(Storage="_ResourceId", DbType="UniqueIdentifier")]
    1171     public System.Nullable<System.Guid> ResourceId
    1172     {
    1173       get
    1174       {
    1175         return this._ResourceId;
    1176       }
    1177       set
    1178       {
    1179         if ((this._ResourceId != value))
    1180         {
    1181           if (this._Client.HasLoadedOrAssignedValue)
    1182           {
    1183             throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
    1184           }
    1185           this.OnResourceIdChanging(value);
    1186           this.SendPropertyChanging();
    1187           this._ResourceId = value;
    1188           this.SendPropertyChanged("ResourceId");
    1189           this.OnResourceIdChanged();
    1190         }
    1191       }
    1192     }
    1193    
    1194     [Column(Storage="_Percentage", DbType="Float")]
    1195     public System.Nullable<double> Percentage
    1196     {
    1197       get
    1198       {
    1199         return this._Percentage;
    1200       }
    1201       set
    1202       {
    1203         if ((this._Percentage != value))
    1204         {
    1205           this.OnPercentageChanging(value);
    1206           this.SendPropertyChanging();
    1207           this._Percentage = value;
    1208           this.SendPropertyChanged("Percentage");
    1209           this.OnPercentageChanged();
    1210         }
    1211       }
    1212     }
    1213    
    1214     [Column(Storage="_SerializedJob", DbType="VarBinary(MAX)", CanBeNull=true, UpdateCheck=UpdateCheck.Never)]
    1215     public System.Data.Linq.Binary SerializedJob
    1216     {
    1217       get
    1218       {
    1219         return this._SerializedJob.Value;
    1220       }
    1221       set
    1222       {
    1223         if ((this._SerializedJob.Value != value))
    1224         {
    1225           this.OnSerializedJobChanging(value);
    1226           this.SendPropertyChanging();
    1227           this._SerializedJob.Value = value;
    1228           this.SendPropertyChanged("SerializedJob");
    1229           this.OnSerializedJobChanged();
    1230         }
    1231       }
    1232     }
    1233    
    1234     [Column(Storage="_DateCreated", DbType="DateTime")]
    1235     public System.Nullable<System.DateTime> DateCreated
    1236     {
    1237       get
    1238       {
    1239         return this._DateCreated;
    1240       }
    1241       set
    1242       {
    1243         if ((this._DateCreated != value))
    1244         {
    1245           this.OnDateCreatedChanging(value);
    1246           this.SendPropertyChanging();
    1247           this._DateCreated = value;
    1248           this.SendPropertyChanged("DateCreated");
    1249           this.OnDateCreatedChanged();
    1250         }
    1251       }
    1252     }
    1253    
    1254     [Column(Storage="_DateCalculated", DbType="DateTime")]
    1255     public System.Nullable<System.DateTime> DateCalculated
    1256     {
    1257       get
    1258       {
    1259         return this._DateCalculated;
    1260       }
    1261       set
    1262       {
    1263         if ((this._DateCalculated != value))
    1264         {
    1265           this.OnDateCalculatedChanging(value);
    1266           this.SendPropertyChanging();
    1267           this._DateCalculated = value;
    1268           this.SendPropertyChanged("DateCalculated");
    1269           this.OnDateCalculatedChanged();
    1270         }
    1271       }
    1272     }
    1273    
    1274     [Column(Storage="_DateFinished", DbType="DateTime")]
    1275     public System.Nullable<System.DateTime> DateFinished
    1276     {
    1277       get
    1278       {
    1279         return this._DateFinished;
    1280       }
    1281       set
    1282       {
    1283         if ((this._DateFinished != value))
    1284         {
    1285           this.OnDateFinishedChanging(value);
    1286           this.SendPropertyChanging();
    1287           this._DateFinished = value;
    1288           this.SendPropertyChanged("DateFinished");
    1289           this.OnDateFinishedChanged();
    1290         }
    1291       }
    1292     }
    1293    
    1294     [Column(Storage="_Priority", DbType="Int")]
    1295     public System.Nullable<int> Priority
    1296     {
    1297       get
    1298       {
    1299         return this._Priority;
    1300       }
    1301       set
    1302       {
    1303         if ((this._Priority != value))
    1304         {
    1305           this.OnPriorityChanging(value);
    1306           this.SendPropertyChanging();
    1307           this._Priority = value;
    1308           this.SendPropertyChanged("Priority");
    1309           this.OnPriorityChanged();
    1310         }
    1311       }
    1312     }
    1313    
    1314     [Column(Storage="_ProjectId", DbType="UniqueIdentifier")]
    1315     public System.Nullable<System.Guid> ProjectId
    1316     {
    1317       get
    1318       {
    1319         return this._ProjectId;
    1320       }
    1321       set
    1322       {
    1323         if ((this._ProjectId != value))
    1324         {
    1325           if (this._Project.HasLoadedOrAssignedValue)
    1326           {
    1327             throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
    1328           }
    1329           this.OnProjectIdChanging(value);
    1330           this.SendPropertyChanging();
    1331           this._ProjectId = value;
    1332           this.SendPropertyChanged("ProjectId");
    1333           this.OnProjectIdChanged();
    1334         }
    1335       }
    1336     }
    1337    
    1338     [Column(Storage="_UserId", DbType="UniqueIdentifier")]
    1339     public System.Nullable<System.Guid> UserId
    1340     {
    1341       get
    1342       {
    1343         return this._UserId;
    1344       }
    1345       set
    1346       {
    1347         if ((this._UserId != value))
    1348         {
    1349           this.OnUserIdChanging(value);
    1350           this.SendPropertyChanging();
    1351           this._UserId = value;
    1352           this.SendPropertyChanged("UserId");
    1353           this.OnUserIdChanged();
    1354         }
    1355       }
    1356     }
    1357    
    1358     [Column(Storage="_CoresNeeded", DbType="Int")]
    1359     public int CoresNeeded
    1360     {
    1361       get
    1362       {
    1363         return this._CoresNeeded;
    1364       }
    1365       set
    1366       {
    1367         if ((this._CoresNeeded != value))
    1368         {
    1369           this.OnCoresNeededChanging(value);
    1370           this.SendPropertyChanging();
    1371           this._CoresNeeded = value;
    1372           this.SendPropertyChanged("CoresNeeded");
    1373           this.OnCoresNeededChanged();
    1374         }
    1375       }
    1376     }
    1377    
    1378     [Column(Storage="_MemoryNeeded", DbType="Int")]
    1379     public int MemoryNeeded
    1380     {
    1381       get
    1382       {
    1383         return this._MemoryNeeded;
    1384       }
    1385       set
    1386       {
    1387         if ((this._MemoryNeeded != value))
    1388         {
    1389           this.OnMemoryNeededChanging(value);
    1390           this.SendPropertyChanging();
    1391           this._MemoryNeeded = value;
    1392           this.SendPropertyChanged("MemoryNeeded");
    1393           this.OnMemoryNeededChanged();
    1394         }
    1395       }
    1396     }
    1397    
    1398     [Association(Name="Job_AssignedResource", Storage="_AssignedResources", ThisKey="JobId", OtherKey="JobId")]
    1399     public EntitySet<AssignedResource> AssignedResources
    1400     {
    1401       get
    1402       {
    1403         return this._AssignedResources;
    1404       }
    1405       set
    1406       {
    1407         this._AssignedResources.Assign(value);
    1408       }
    1409     }
    1410    
    1411     [Association(Name="Job_Job", Storage="_Jobs", ThisKey="JobId", OtherKey="ParentJobId")]
    1412     public EntitySet<Job> Jobs
    1413     {
    1414       get
    1415       {
    1416         return this._Jobs;
    1417       }
    1418       set
    1419       {
    1420         this._Jobs.Assign(value);
    1421       }
    1422     }
    1423    
    1424     [Association(Name="Job_RequiredPlugin", Storage="_RequiredPlugins", ThisKey="JobId", OtherKey="JobId")]
    1425     public EntitySet<RequiredPlugin> RequiredPlugins
    1426     {
    1427       get
    1428       {
    1429         return this._RequiredPlugins;
    1430       }
    1431       set
    1432       {
    1433         this._RequiredPlugins.Assign(value);
    1434       }
    1435     }
    1436    
    1437     [Association(Name="Job_Job", Storage="_Job1", ThisKey="ParentJobId", OtherKey="JobId", IsForeignKey=true)]
    1438     public Job Job1
    1439     {
    1440       get
    1441       {
    1442         return this._Job1.Entity;
    1443       }
    1444       set
    1445       {
    1446         Job previousValue = this._Job1.Entity;
    1447         if (((previousValue != value)
    1448               || (this._Job1.HasLoadedOrAssignedValue == false)))
    1449         {
    1450           this.SendPropertyChanging();
    1451           if ((previousValue != null))
    1452           {
    1453             this._Job1.Entity = null;
    1454             previousValue.Jobs.Remove(this);
    1455           }
    1456           this._Job1.Entity = value;
    1457           if ((value != null))
    1458           {
    1459             value.Jobs.Add(this);
    1460             this._ParentJobId = value.JobId;
    1461           }
    1462           else
    1463           {
    1464             this._ParentJobId = default(Nullable<System.Guid>);
    1465           }
    1466           this.SendPropertyChanged("Job1");
    1467         }
    1468       }
    1469     }
    1470    
    1471     [Association(Name="Project_Job", Storage="_Project", ThisKey="ProjectId", OtherKey="ProjectId", IsForeignKey=true, DeleteRule="SET NULL")]
    1472     public Project Project
    1473     {
    1474       get
    1475       {
    1476         return this._Project.Entity;
    1477       }
    1478       set
    1479       {
    1480         Project previousValue = this._Project.Entity;
    1481         if (((previousValue != value)
    1482               || (this._Project.HasLoadedOrAssignedValue == false)))
    1483         {
    1484           this.SendPropertyChanging();
    1485           if ((previousValue != null))
    1486           {
    1487             this._Project.Entity = null;
    1488             previousValue.Jobs.Remove(this);
    1489           }
    1490           this._Project.Entity = value;
    1491           if ((value != null))
    1492           {
    1493             value.Jobs.Add(this);
    1494             this._ProjectId = value.ProjectId;
    1495           }
    1496           else
    1497           {
    1498             this._ProjectId = default(Nullable<System.Guid>);
    1499           }
    1500           this.SendPropertyChanged("Project");
    1501         }
    1502       }
    1503     }
    1504    
    1505     [Association(Name="Client_Job", Storage="_Client", ThisKey="ResourceId", OtherKey="ResourceId", IsForeignKey=true, DeleteRule="SET NULL")]
    1506     public Client Client
    1507     {
    1508       get
    1509       {
    1510         return this._Client.Entity;
    1511       }
    1512       set
    1513       {
    1514         Client previousValue = this._Client.Entity;
    1515         if (((previousValue != value)
    1516               || (this._Client.HasLoadedOrAssignedValue == false)))
    1517         {
    1518           this.SendPropertyChanging();
    1519           if ((previousValue != null))
    1520           {
    1521             this._Client.Entity = null;
    1522             previousValue.Jobs.Remove(this);
    1523           }
    1524           this._Client.Entity = value;
    1525           if ((value != null))
    1526           {
    1527             value.Jobs.Add(this);
    1528             this._ResourceId = value.ResourceId;
    1529           }
    1530           else
    1531           {
    1532             this._ResourceId = default(Nullable<System.Guid>);
    1533           }
    1534           this.SendPropertyChanged("Client");
    1535         }
    1536       }
    1537     }
    1538    
    1539     public event PropertyChangingEventHandler PropertyChanging;
    1540    
    1541     public event PropertyChangedEventHandler PropertyChanged;
    1542    
    1543     protected virtual void SendPropertyChanging()
    1544     {
    1545       if ((this.PropertyChanging != null))
    1546       {
    1547         this.PropertyChanging(this, emptyChangingEventArgs);
    1548       }
    1549     }
    1550    
    1551     protected virtual void SendPropertyChanged(String propertyName)
    1552     {
    1553       if ((this.PropertyChanged != null))
    1554       {
    1555         this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
    1556       }
    1557     }
    1558    
    1559     private void attach_AssignedResources(AssignedResource entity)
    1560     {
    1561       this.SendPropertyChanging();
    1562       entity.Job = this;
    1563     }
    1564    
    1565     private void detach_AssignedResources(AssignedResource entity)
    1566     {
    1567       this.SendPropertyChanging();
    1568       entity.Job = null;
    1569     }
    1570    
    1571     private void attach_Jobs(Job entity)
    1572     {
    1573       this.SendPropertyChanging();
    1574       entity.Job1 = this;
    1575     }
    1576    
    1577     private void detach_Jobs(Job entity)
    1578     {
    1579       this.SendPropertyChanging();
    1580       entity.Job1 = null;
    1581     }
    1582    
    1583     private void attach_RequiredPlugins(RequiredPlugin entity)
    1584     {
    1585       this.SendPropertyChanging();
    1586       entity.Job = this;
    1587     }
    1588    
    1589     private void detach_RequiredPlugins(RequiredPlugin entity)
    1590     {
    1591       this.SendPropertyChanging();
    1592       entity.Job = null;
    1593     }
    1594   }
    1595  
    15961015  [Table(Name="dbo.PluginInfo")]
    15971016  public partial class PluginInfo : INotifyPropertyChanging, INotifyPropertyChanged
     
    18821301    private System.Guid _RequiredPluginId;
    18831302   
     1303    private EntityRef<PluginInfo> _PluginInfo;
     1304   
    18841305    private EntityRef<Job> _Job;
    1885    
    1886     private EntityRef<PluginInfo> _PluginInfo;
    18871306   
    18881307    #region Extensibility Method Definitions
     
    19001319    public RequiredPlugin()
    19011320    {
     1321      this._PluginInfo = default(EntityRef<PluginInfo>);
    19021322      this._Job = default(EntityRef<Job>);
    1903       this._PluginInfo = default(EntityRef<PluginInfo>);
    19041323      OnCreated();
    19051324    }
     
    19731392    }
    19741393   
     1394    [Association(Name="PluginInfo_RequiredPlugin", Storage="_PluginInfo", ThisKey="PluginId", OtherKey="PluginId", IsForeignKey=true, DeleteOnNull=true, DeleteRule="CASCADE")]
     1395    public PluginInfo PluginInfo
     1396    {
     1397      get
     1398      {
     1399        return this._PluginInfo.Entity;
     1400      }
     1401      set
     1402      {
     1403        PluginInfo previousValue = this._PluginInfo.Entity;
     1404        if (((previousValue != value)
     1405              || (this._PluginInfo.HasLoadedOrAssignedValue == false)))
     1406        {
     1407          this.SendPropertyChanging();
     1408          if ((previousValue != null))
     1409          {
     1410            this._PluginInfo.Entity = null;
     1411            previousValue.RequiredPlugins.Remove(this);
     1412          }
     1413          this._PluginInfo.Entity = value;
     1414          if ((value != null))
     1415          {
     1416            value.RequiredPlugins.Add(this);
     1417            this._PluginId = value.PluginId;
     1418          }
     1419          else
     1420          {
     1421            this._PluginId = default(System.Guid);
     1422          }
     1423          this.SendPropertyChanged("PluginInfo");
     1424        }
     1425      }
     1426    }
     1427   
    19751428    [Association(Name="Job_RequiredPlugin", Storage="_Job", ThisKey="JobId", OtherKey="JobId", IsForeignKey=true)]
    19761429    public Job Job
     
    20031456          }
    20041457          this.SendPropertyChanged("Job");
    2005         }
    2006       }
    2007     }
    2008    
    2009     [Association(Name="PluginInfo_RequiredPlugin", Storage="_PluginInfo", ThisKey="PluginId", OtherKey="PluginId", IsForeignKey=true, DeleteOnNull=true, DeleteRule="CASCADE")]
    2010     public PluginInfo PluginInfo
    2011     {
    2012       get
    2013       {
    2014         return this._PluginInfo.Entity;
    2015       }
    2016       set
    2017       {
    2018         PluginInfo previousValue = this._PluginInfo.Entity;
    2019         if (((previousValue != value)
    2020               || (this._PluginInfo.HasLoadedOrAssignedValue == false)))
    2021         {
    2022           this.SendPropertyChanging();
    2023           if ((previousValue != null))
    2024           {
    2025             this._PluginInfo.Entity = null;
    2026             previousValue.RequiredPlugins.Remove(this);
    2027           }
    2028           this._PluginInfo.Entity = value;
    2029           if ((value != null))
    2030           {
    2031             value.RequiredPlugins.Add(this);
    2032             this._PluginId = value.PluginId;
    2033           }
    2034           else
    2035           {
    2036             this._PluginId = default(System.Guid);
    2037           }
    2038           this.SendPropertyChanged("PluginInfo");
    20391458        }
    20401459      }
     
    26592078    }
    26602079  }
     2080 
     2081  [Table(Name="dbo.Job")]
     2082  public partial class Job : INotifyPropertyChanging, INotifyPropertyChanged
     2083  {
     2084   
     2085    private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
     2086   
     2087    private System.Guid _JobId;
     2088   
     2089    private System.Nullable<System.Guid> _ParentJobId;
     2090   
     2091    private string _JobState;
     2092   
     2093    private System.Nullable<System.Guid> _ResourceId;
     2094   
     2095    private System.Nullable<double> _Percentage;
     2096   
     2097    private System.Data.Linq.Binary _SerializedJob;
     2098   
     2099    private System.Nullable<System.DateTime> _DateCreated;
     2100   
     2101    private System.Nullable<System.DateTime> _DateCalculated;
     2102   
     2103    private System.Nullable<System.DateTime> _DateFinished;
     2104   
     2105    private int _Priority;
     2106   
     2107    private System.Nullable<System.Guid> _ProjectId;
     2108   
     2109    private System.Nullable<System.Guid> _UserId;
     2110   
     2111    private int _CoresNeeded;
     2112   
     2113    private int _MemoryNeeded;
     2114   
     2115    private EntitySet<AssignedResource> _AssignedResources;
     2116   
     2117    private EntitySet<RequiredPlugin> _RequiredPlugins;
     2118   
     2119    private EntitySet<Job> _Jobs;
     2120   
     2121    private EntityRef<Client> _Client;
     2122   
     2123    private EntityRef<Job> _Job1;
     2124   
     2125    private EntityRef<Project> _Project;
     2126   
     2127    #region Extensibility Method Definitions
     2128    partial void OnLoaded();
     2129    partial void OnValidate(System.Data.Linq.ChangeAction action);
     2130    partial void OnCreated();
     2131    partial void OnJobIdChanging(System.Guid value);
     2132    partial void OnJobIdChanged();
     2133    partial void OnParentJobIdChanging(System.Nullable<System.Guid> value);
     2134    partial void OnParentJobIdChanged();
     2135    partial void OnJobStateChanging(string value);
     2136    partial void OnJobStateChanged();
     2137    partial void OnResourceIdChanging(System.Nullable<System.Guid> value);
     2138    partial void OnResourceIdChanged();
     2139    partial void OnPercentageChanging(System.Nullable<double> value);
     2140    partial void OnPercentageChanged();
     2141    partial void OnSerializedJobChanging(System.Data.Linq.Binary value);
     2142    partial void OnSerializedJobChanged();
     2143    partial void OnDateCreatedChanging(System.Nullable<System.DateTime> value);
     2144    partial void OnDateCreatedChanged();
     2145    partial void OnDateCalculatedChanging(System.Nullable<System.DateTime> value);
     2146    partial void OnDateCalculatedChanged();
     2147    partial void OnDateFinishedChanging(System.Nullable<System.DateTime> value);
     2148    partial void OnDateFinishedChanged();
     2149    partial void OnPriorityChanging(int value);
     2150    partial void OnPriorityChanged();
     2151    partial void OnProjectIdChanging(System.Nullable<System.Guid> value);
     2152    partial void OnProjectIdChanged();
     2153    partial void OnUserIdChanging(System.Nullable<System.Guid> value);
     2154    partial void OnUserIdChanged();
     2155    partial void OnCoresNeededChanging(int value);
     2156    partial void OnCoresNeededChanged();
     2157    partial void OnMemoryNeededChanging(int value);
     2158    partial void OnMemoryNeededChanged();
     2159    #endregion
     2160   
     2161    public Job()
     2162    {
     2163      this._AssignedResources = new EntitySet<AssignedResource>(new Action<AssignedResource>(this.attach_AssignedResources), new Action<AssignedResource>(this.detach_AssignedResources));
     2164      this._RequiredPlugins = new EntitySet<RequiredPlugin>(new Action<RequiredPlugin>(this.attach_RequiredPlugins), new Action<RequiredPlugin>(this.detach_RequiredPlugins));
     2165      this._Jobs = new EntitySet<Job>(new Action<Job>(this.attach_Jobs), new Action<Job>(this.detach_Jobs));
     2166      this._Client = default(EntityRef<Client>);
     2167      this._Job1 = default(EntityRef<Job>);
     2168      this._Project = default(EntityRef<Project>);
     2169      OnCreated();
     2170    }
     2171   
     2172    [Column(Storage="_JobId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true)]
     2173    public System.Guid JobId
     2174    {
     2175      get
     2176      {
     2177        return this._JobId;
     2178      }
     2179      set
     2180      {
     2181        if ((this._JobId != value))
     2182        {
     2183          this.OnJobIdChanging(value);
     2184          this.SendPropertyChanging();
     2185          this._JobId = value;
     2186          this.SendPropertyChanged("JobId");
     2187          this.OnJobIdChanged();
     2188        }
     2189      }
     2190    }
     2191   
     2192    [Column(Storage="_ParentJobId", DbType="UniqueIdentifier")]
     2193    public System.Nullable<System.Guid> ParentJobId
     2194    {
     2195      get
     2196      {
     2197        return this._ParentJobId;
     2198      }
     2199      set
     2200      {
     2201        if ((this._ParentJobId != value))
     2202        {
     2203          if (this._Job1.HasLoadedOrAssignedValue)
     2204          {
     2205            throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
     2206          }
     2207          this.OnParentJobIdChanging(value);
     2208          this.SendPropertyChanging();
     2209          this._ParentJobId = value;
     2210          this.SendPropertyChanged("ParentJobId");
     2211          this.OnParentJobIdChanged();
     2212        }
     2213      }
     2214    }
     2215   
     2216    [Column(Storage="_JobState", DbType="VarChar(MAX)")]
     2217    public string JobState
     2218    {
     2219      get
     2220      {
     2221        return this._JobState;
     2222      }
     2223      set
     2224      {
     2225        if ((this._JobState != value))
     2226        {
     2227          this.OnJobStateChanging(value);
     2228          this.SendPropertyChanging();
     2229          this._JobState = value;
     2230          this.SendPropertyChanged("JobState");
     2231          this.OnJobStateChanged();
     2232        }
     2233      }
     2234    }
     2235   
     2236    [Column(Storage="_ResourceId", DbType="UniqueIdentifier")]
     2237    public System.Nullable<System.Guid> ResourceId
     2238    {
     2239      get
     2240      {
     2241        return this._ResourceId;
     2242      }
     2243      set
     2244      {
     2245        if ((this._ResourceId != value))
     2246        {
     2247          if (this._Client.HasLoadedOrAssignedValue)
     2248          {
     2249            throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
     2250          }
     2251          this.OnResourceIdChanging(value);
     2252          this.SendPropertyChanging();
     2253          this._ResourceId = value;
     2254          this.SendPropertyChanged("ResourceId");
     2255          this.OnResourceIdChanged();
     2256        }
     2257      }
     2258    }
     2259   
     2260    [Column(Storage="_Percentage", DbType="Float")]
     2261    public System.Nullable<double> Percentage
     2262    {
     2263      get
     2264      {
     2265        return this._Percentage;
     2266      }
     2267      set
     2268      {
     2269        if ((this._Percentage != value))
     2270        {
     2271          this.OnPercentageChanging(value);
     2272          this.SendPropertyChanging();
     2273          this._Percentage = value;
     2274          this.SendPropertyChanged("Percentage");
     2275          this.OnPercentageChanged();
     2276        }
     2277      }
     2278    }
     2279   
     2280    [Column(Storage="_SerializedJob", DbType="VarBinary(MAX)", CanBeNull=true, UpdateCheck=UpdateCheck.Never)]
     2281    public System.Data.Linq.Binary SerializedJob
     2282    {
     2283      get
     2284      {
     2285        return this._SerializedJob;
     2286      }
     2287      set
     2288      {
     2289        if ((this._SerializedJob != value))
     2290        {
     2291          this.OnSerializedJobChanging(value);
     2292          this.SendPropertyChanging();
     2293          this._SerializedJob = value;
     2294          this.SendPropertyChanged("SerializedJob");
     2295          this.OnSerializedJobChanged();
     2296        }
     2297      }
     2298    }
     2299   
     2300    [Column(Storage="_DateCreated", DbType="DateTime")]
     2301    public System.Nullable<System.DateTime> DateCreated
     2302    {
     2303      get
     2304      {
     2305        return this._DateCreated;
     2306      }
     2307      set
     2308      {
     2309        if ((this._DateCreated != value))
     2310        {
     2311          this.OnDateCreatedChanging(value);
     2312          this.SendPropertyChanging();
     2313          this._DateCreated = value;
     2314          this.SendPropertyChanged("DateCreated");
     2315          this.OnDateCreatedChanged();
     2316        }
     2317      }
     2318    }
     2319   
     2320    [Column(Storage="_DateCalculated", DbType="DateTime")]
     2321    public System.Nullable<System.DateTime> DateCalculated
     2322    {
     2323      get
     2324      {
     2325        return this._DateCalculated;
     2326      }
     2327      set
     2328      {
     2329        if ((this._DateCalculated != value))
     2330        {
     2331          this.OnDateCalculatedChanging(value);
     2332          this.SendPropertyChanging();
     2333          this._DateCalculated = value;
     2334          this.SendPropertyChanged("DateCalculated");
     2335          this.OnDateCalculatedChanged();
     2336        }
     2337      }
     2338    }
     2339   
     2340    [Column(Storage="_DateFinished", DbType="DateTime")]
     2341    public System.Nullable<System.DateTime> DateFinished
     2342    {
     2343      get
     2344      {
     2345        return this._DateFinished;
     2346      }
     2347      set
     2348      {
     2349        if ((this._DateFinished != value))
     2350        {
     2351          this.OnDateFinishedChanging(value);
     2352          this.SendPropertyChanging();
     2353          this._DateFinished = value;
     2354          this.SendPropertyChanged("DateFinished");
     2355          this.OnDateFinishedChanged();
     2356        }
     2357      }
     2358    }
     2359   
     2360    [Column(Storage="_Priority", DbType="Int NOT NULL")]
     2361    public int Priority
     2362    {
     2363      get
     2364      {
     2365        return this._Priority;
     2366      }
     2367      set
     2368      {
     2369        if ((this._Priority != value))
     2370        {
     2371          this.OnPriorityChanging(value);
     2372          this.SendPropertyChanging();
     2373          this._Priority = value;
     2374          this.SendPropertyChanged("Priority");
     2375          this.OnPriorityChanged();
     2376        }
     2377      }
     2378    }
     2379   
     2380    [Column(Storage="_ProjectId", DbType="UniqueIdentifier")]
     2381    public System.Nullable<System.Guid> ProjectId
     2382    {
     2383      get
     2384      {
     2385        return this._ProjectId;
     2386      }
     2387      set
     2388      {
     2389        if ((this._ProjectId != value))
     2390        {
     2391          if (this._Project.HasLoadedOrAssignedValue)
     2392          {
     2393            throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
     2394          }
     2395          this.OnProjectIdChanging(value);
     2396          this.SendPropertyChanging();
     2397          this._ProjectId = value;
     2398          this.SendPropertyChanged("ProjectId");
     2399          this.OnProjectIdChanged();
     2400        }
     2401      }
     2402    }
     2403   
     2404    [Column(Storage="_UserId", DbType="UniqueIdentifier")]
     2405    public System.Nullable<System.Guid> UserId
     2406    {
     2407      get
     2408      {
     2409        return this._UserId;
     2410      }
     2411      set
     2412      {
     2413        if ((this._UserId != value))
     2414        {
     2415          this.OnUserIdChanging(value);
     2416          this.SendPropertyChanging();
     2417          this._UserId = value;
     2418          this.SendPropertyChanged("UserId");
     2419          this.OnUserIdChanged();
     2420        }
     2421      }
     2422    }
     2423   
     2424    [Column(Storage="_CoresNeeded", DbType="Int NOT NULL")]
     2425    public int CoresNeeded
     2426    {
     2427      get
     2428      {
     2429        return this._CoresNeeded;
     2430      }
     2431      set
     2432      {
     2433        if ((this._CoresNeeded != value))
     2434        {
     2435          this.OnCoresNeededChanging(value);
     2436          this.SendPropertyChanging();
     2437          this._CoresNeeded = value;
     2438          this.SendPropertyChanged("CoresNeeded");
     2439          this.OnCoresNeededChanged();
     2440        }
     2441      }
     2442    }
     2443   
     2444    [Column(Storage="_MemoryNeeded", DbType="Int NOT NULL")]
     2445    public int MemoryNeeded
     2446    {
     2447      get
     2448      {
     2449        return this._MemoryNeeded;
     2450      }
     2451      set
     2452      {
     2453        if ((this._MemoryNeeded != value))
     2454        {
     2455          this.OnMemoryNeededChanging(value);
     2456          this.SendPropertyChanging();
     2457          this._MemoryNeeded = value;
     2458          this.SendPropertyChanged("MemoryNeeded");
     2459          this.OnMemoryNeededChanged();
     2460        }
     2461      }
     2462    }
     2463   
     2464    [Association(Name="Job_AssignedResource", Storage="_AssignedResources", ThisKey="JobId", OtherKey="JobId")]
     2465    public EntitySet<AssignedResource> AssignedResources
     2466    {
     2467      get
     2468      {
     2469        return this._AssignedResources;
     2470      }
     2471      set
     2472      {
     2473        this._AssignedResources.Assign(value);
     2474      }
     2475    }
     2476   
     2477    [Association(Name="Job_RequiredPlugin", Storage="_RequiredPlugins", ThisKey="JobId", OtherKey="JobId")]
     2478    public EntitySet<RequiredPlugin> RequiredPlugins
     2479    {
     2480      get
     2481      {
     2482        return this._RequiredPlugins;
     2483      }
     2484      set
     2485      {
     2486        this._RequiredPlugins.Assign(value);
     2487      }
     2488    }
     2489   
     2490    [Association(Name="Job_Job", Storage="_Jobs", ThisKey="JobId", OtherKey="ParentJobId")]
     2491    public EntitySet<Job> Jobs
     2492    {
     2493      get
     2494      {
     2495        return this._Jobs;
     2496      }
     2497      set
     2498      {
     2499        this._Jobs.Assign(value);
     2500      }
     2501    }
     2502   
     2503    [Association(Name="Client_Job", Storage="_Client", ThisKey="ResourceId", OtherKey="ResourceId", IsForeignKey=true, DeleteRule="SET NULL")]
     2504    public Client Client
     2505    {
     2506      get
     2507      {
     2508        return this._Client.Entity;
     2509      }
     2510      set
     2511      {
     2512        Client previousValue = this._Client.Entity;
     2513        if (((previousValue != value)
     2514              || (this._Client.HasLoadedOrAssignedValue == false)))
     2515        {
     2516          this.SendPropertyChanging();
     2517          if ((previousValue != null))
     2518          {
     2519            this._Client.Entity = null;
     2520            previousValue.Jobs.Remove(this);
     2521          }
     2522          this._Client.Entity = value;
     2523          if ((value != null))
     2524          {
     2525            value.Jobs.Add(this);
     2526            this._ResourceId = value.ResourceId;
     2527          }
     2528          else
     2529          {
     2530            this._ResourceId = default(Nullable<System.Guid>);
     2531          }
     2532          this.SendPropertyChanged("Client");
     2533        }
     2534      }
     2535    }
     2536   
     2537    [Association(Name="Job_Job", Storage="_Job1", ThisKey="ParentJobId", OtherKey="JobId", IsForeignKey=true)]
     2538    public Job Job1
     2539    {
     2540      get
     2541      {
     2542        return this._Job1.Entity;
     2543      }
     2544      set
     2545      {
     2546        Job previousValue = this._Job1.Entity;
     2547        if (((previousValue != value)
     2548              || (this._Job1.HasLoadedOrAssignedValue == false)))
     2549        {
     2550          this.SendPropertyChanging();
     2551          if ((previousValue != null))
     2552          {
     2553            this._Job1.Entity = null;
     2554            previousValue.Jobs.Remove(this);
     2555          }
     2556          this._Job1.Entity = value;
     2557          if ((value != null))
     2558          {
     2559            value.Jobs.Add(this);
     2560            this._ParentJobId = value.JobId;
     2561          }
     2562          else
     2563          {
     2564            this._ParentJobId = default(Nullable<System.Guid>);
     2565          }
     2566          this.SendPropertyChanged("Job1");
     2567        }
     2568      }
     2569    }
     2570   
     2571    [Association(Name="Project_Job", Storage="_Project", ThisKey="ProjectId", OtherKey="ProjectId", IsForeignKey=true, DeleteRule="SET NULL")]
     2572    public Project Project
     2573    {
     2574      get
     2575      {
     2576        return this._Project.Entity;
     2577      }
     2578      set
     2579      {
     2580        Project previousValue = this._Project.Entity;
     2581        if (((previousValue != value)
     2582              || (this._Project.HasLoadedOrAssignedValue == false)))
     2583        {
     2584          this.SendPropertyChanging();
     2585          if ((previousValue != null))
     2586          {
     2587            this._Project.Entity = null;
     2588            previousValue.Jobs.Remove(this);
     2589          }
     2590          this._Project.Entity = value;
     2591          if ((value != null))
     2592          {
     2593            value.Jobs.Add(this);
     2594            this._ProjectId = value.ProjectId;
     2595          }
     2596          else
     2597          {
     2598            this._ProjectId = default(Nullable<System.Guid>);
     2599          }
     2600          this.SendPropertyChanged("Project");
     2601        }
     2602      }
     2603    }
     2604   
     2605    public event PropertyChangingEventHandler PropertyChanging;
     2606   
     2607    public event PropertyChangedEventHandler PropertyChanged;
     2608   
     2609    protected virtual void SendPropertyChanging()
     2610    {
     2611      if ((this.PropertyChanging != null))
     2612      {
     2613        this.PropertyChanging(this, emptyChangingEventArgs);
     2614      }
     2615    }
     2616   
     2617    protected virtual void SendPropertyChanged(String propertyName)
     2618    {
     2619      if ((this.PropertyChanged != null))
     2620      {
     2621        this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
     2622      }
     2623    }
     2624   
     2625    private void attach_AssignedResources(AssignedResource entity)
     2626    {
     2627      this.SendPropertyChanging();
     2628      entity.Job = this;
     2629    }
     2630   
     2631    private void detach_AssignedResources(AssignedResource entity)
     2632    {
     2633      this.SendPropertyChanging();
     2634      entity.Job = null;
     2635    }
     2636   
     2637    private void attach_RequiredPlugins(RequiredPlugin entity)
     2638    {
     2639      this.SendPropertyChanging();
     2640      entity.Job = this;
     2641    }
     2642   
     2643    private void detach_RequiredPlugins(RequiredPlugin entity)
     2644    {
     2645      this.SendPropertyChanging();
     2646      entity.Job = null;
     2647    }
     2648   
     2649    private void attach_Jobs(Job entity)
     2650    {
     2651      this.SendPropertyChanging();
     2652      entity.Job1 = this;
     2653    }
     2654   
     2655    private void detach_Jobs(Job entity)
     2656    {
     2657      this.SendPropertyChanging();
     2658      entity.Job1 = null;
     2659    }
     2660  }
    26612661}
    26622662#pragma warning restore 1591
  • trunk/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/JobDao.cs

    r3013 r3018  
    4242      Job j = DtoToEntity(job.JobInfo, null);
    4343      j.SerializedJob = job.SerializedJobData;
     44      foreach (Guid assignRessourceId in job.JobInfo.AssignedResourceIds)
     45        j.AssignedResources.Add(new AssignedResource { ResourceId = assignRessourceId});
    4446      Context.Jobs.InsertOnSubmit(j);
    4547      Context.SubmitChanges();
     
    7072              select EntityToDto(j, null)).ToList();
    7173    }
    72     public IEnumerable<JobDto> FindFittingJobsForClient(State state, int freeCores, int freeMemory) {
    73       return (from j in Context.Jobs
    74               where j.JobState == Enum.GetName(typeof (State), State.offline) &&
    75                     j.CoresNeeded <= freeCores &&
    76                     j.MemoryNeeded <= freeMemory
    77               select EntityToDto(j, null)).ToList();
     74    public IEnumerable<JobDto> FindFittingJobsForClient(State state, int freeCores, int freeMemory, Guid clientId) {
     75      ClientGroupDao cgd = new ClientGroupDao();
     76     
     77      List<Guid> idList = new List<Guid>(cgd.FindAllGroupAndParentGroupIdsForClient(clientId));
     78      //Add myself too - enables jobs for one specific host!
     79      idList.Add(clientId);
     80     
     81      var q = (from ar in Context.AssignedResources               
     82               where ar.Job.JobState == Enum.GetName(typeof (State), State.offline) &&
     83                     ar.Job.CoresNeeded <= freeCores &&
     84                     ar.Job.MemoryNeeded <= freeMemory &&
     85                     idList.Contains(ar.ResourceId)
     86               orderby ar.Job.Priority descending                 
     87               select EntityToDto(ar.Job, null));
     88      return q.ToList();
    7889     
    7990    }
Note: See TracChangeset for help on using the changeset viewer.