Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/17/11 14:47:56 (14 years ago)
Author:
cneumuel
Message:

#1233

  • added StateLog to log state transitions of hive jobs
  • added permissions to hive experiments (in data access layer, no UI for that yet)
  • extended unit tests
Location:
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/Core.cs

    r5472 r5511  
    185185        engines[job.Id].Pause();
    186186        JobData sJob = engines[job.Id].GetFinishedJob();
    187         job.Exception = engines[job.Id].CurrentException;
     187        // job.Exception = engines[job.Id].CurrentException; // can there be an exception if a job is paused
    188188        job.ExecutionTime = engines[job.Id].ExecutionTime;
    189189
    190190        try {
    191191          ClientCom.LogMessage("Sending the paused job with id: " + job.Id);
    192           wcfService.UpdateJob(job, sJob);
     192          wcfService.UpdateJobData(job, sJob, ConfigManager.Instance.GetClientInfo().Id);
    193193          SlaveStatusInfo.JobsProcessed++;    //TODO: count or not count, thats the question
    194194        }
     
    208208        engines[job.Id].Stop();
    209209        JobData sJob = engines[job.Id].GetFinishedJob();
    210         job.Exception = engines[job.Id].CurrentException;
     210        // job.Exception = engines[job.Id].CurrentException; // can there be an exception if a job is stopped regularly
    211211        job.ExecutionTime = engines[job.Id].ExecutionTime;
    212212
    213213        try {
    214214          ClientCom.LogMessage("Sending the stoppped job with id: " + job.Id);
    215           wcfService.UpdateJob(job, sJob);
     215          wcfService.UpdateJobData(job, sJob, ConfigManager.Instance.GetClientInfo().Id);
    216216          SlaveStatusInfo.JobsProcessed++;    //TODO: count or not count, thats the question
    217217        }
     
    345345      } else {
    346346        Job job = Jobs[data.JobId];
    347         job.JobState = JobState.WaitingForChildJobs;
    348         wcfService.UpdateJob(job, data);
     347        job.SetState(JobState.Transferring);
     348        wcfService.UpdateJobData(job, data, ConfigManager.Instance.GetClientInfo().Id);
     349        job.SetState(JobState.Waiting); // todo: what if it was a ResumeOnChildJobsFinished job before? maybe look into StateLog
     350        wcfService.UpdateJob(job);
    349351      }
    350352      KillAppDomain(data.JobId);
     
    372374        cJob.ExecutionTime = engines[jobId].ExecutionTime;
    373375
    374         JobData sJob = engines[jobId].GetFinishedJob();
    375         cJob.Exception = engines[jobId].CurrentException;
    376         cJob.ExecutionTime = engines[jobId].ExecutionTime;
     376        JobData sJob = engines[jId].GetFinishedJob();
     377        // cJob.Exception = engines[jId].CurrentException; // can there be an exception if the job is sent normally. the exception should be entered in the statelog with the corresponding state (Failed)
     378        cJob.ExecutionTime = engines[jId].ExecutionTime;
    377379
    378380        try {
    379381          ClientCom.LogMessage("Sending the finished job with id: " + jobId);
    380           wcfService.UpdateJob(cJob, sJob);
     382          wcfService.UpdateJobData(cJob, sJob, ConfigManager.Instance.GetClientInfo().Id);
    381383          SlaveStatusInfo.JobsProcessed++;
    382384        }
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/Executor.cs

    r5469 r5511  
    128128
    129129      Job childJob = new Job();
    130       childJob.JobState = JobState.Offline;
     130      childJob.SetState(JobState.Offline);
    131131      childJob.CoresNeeded = 1;
    132132      childJob.MemoryNeeded = 0;
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/WcfService.cs

    r5458 r5511  
    2323using System.Collections.Generic;
    2424using HeuristicLab.Clients.Common;
    25 using HeuristicLab.Clients.Hive.Slave.Properties;
    2625using HeuristicLab.Common;
    2726using HeuristicLab.Services.Hive.Common;
     
    141140    }
    142141
     142    public void UpdateJob(Job job) {
     143      using (Disposable<IHiveService> service = GetSlaveService()) {
     144        try {
     145          service.Obj.UpdateJob(job);
     146        }
     147        catch (Exception ex) {
     148          HandleNetworkError(ex);
     149        }
     150      }
     151    }
     152
    143153    /// <summary>
    144154    /// used on pause or if job finished to upload the job results
     
    146156    /// <param name="job"></param>
    147157    /// <param name="jobData"></param>   
    148     public void UpdateJob(Job job, JobData jobData) {
    149       using (Disposable<IHiveService> service = GetSlaveService()) {
    150         try {
    151           service.Obj.UpdateJob(job, jobData);
    152         }
    153         catch (Exception ex) {
    154           HandleNetworkError(ex);
    155         }
    156       }
    157     }
    158 
     158    public void UpdateJobData(Job job, JobData jobData, Guid slaveId) {
     159      using (Disposable<IHiveService> service = GetSlaveService()) {
     160        try {
     161          JobState before = job.State;
     162          job.SetState(JobState.Transferring, slaveId, "");
     163          service.Obj.UpdateJob(job);
     164
     165          service.Obj.UpdateJobData(job, jobData);
     166
     167          job.SetState(before, slaveId, "");
     168          service.Obj.UpdateJob(job);
     169        }
     170        catch (Exception ex) {
     171          HandleNetworkError(ex);
     172        }
     173      }
     174    }
     175   
    159176    public List<MessageContainer> SendHeartbeat(Heartbeat heartbeat) {
    160177      using (Disposable<IHiveService> service = GetSlaveService()) {
Note: See TracChangeset for help on using the changeset viewer.