Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/08/11 14:54:17 (14 years ago)
Author:
cneumuel
Message:

#1233

  • updated jobstates documentation
  • enhanced ganttChart
  • fixed setting of jobstates
  • added option to force lifecycle-trigger (mainly for testing purposes)
Location:
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4/HeartbeatManager.cs

    r5511 r5636  
    5353
    5454    private void AssignJob(Slave slave, Job job) {
    55       job.SetState(JobState.Transferring, slave.Id, "");
    56       dao.UpdateJob(job);
     55      dao.UpdateJobState(job.Id, JobState.Transferring, slave.Id, null, null);
    5756      dao.UpdateSlave(slave);
    5857    }
     
    8887              // a request to abort the job has been set
    8988              actions.Add(new MessageContainer(MessageContainer.MessageType.AbortJob, curJob.Id));
    90             } else if (curJob.State != JobState.Calculating) {
    91               // jobstate was 'Transferring' before, now calculating
    92               curJob.SetState(JobState.Calculating, heartbeat.SlaveId, "");
    9389            }
    9490            dao.UpdateJob(curJob);
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4/HiveService.cs

    r5633 r5636  
    3636    public Guid AddJob(Job job, JobData jobData, IEnumerable<Guid> resourceIds) {
    3737      using (trans.OpenTransaction()) {
    38         job.SetState(JobState.Waiting, auth.UserId);
    3938        job.Id = dao.AddJob(job);
    4039        jobData.JobId = job.Id;
     
    4847        }
    4948        dao.AddJobData(jobData);
     49        dao.UpdateJobState(job.Id, JobState.Waiting, null, auth.UserId, null);
    5050        return jobData.JobId;
    5151      }
     
    135135    }
    136136
     137    // [PrincipalPermission(SecurityAction.Demand, Role = HiveRoles.Administrator)]
     138    // [PrincipalPermission(SecurityAction.Demand, Role = HiveRoles.Client)]
     139    // [PrincipalPermission(SecurityAction.Demand, Role = HiveRoles.Slave)]
     140    public Job UpdateJobState(Guid jobId, JobState jobState, Guid? slaveId, Guid? userId, string exception) {
     141      using (trans.OpenTransaction()) {
     142        return dao.UpdateJobState(jobId, jobState, slaveId, userId, exception);
     143      }
     144    }
    137145    #endregion
    138146
     
    235243    // [PrincipalPermission(SecurityAction.Demand, Role = HiveRoles.Slave)]
    236244    public List<MessageContainer> Heartbeat(Heartbeat heartbeat) {
    237       TriggerLifecycle();
     245      TriggerLifecycle(false);
    238246
    239247      using (trans.OpenTransaction()) {
     
    391399    }
    392400
    393     public void TriggerLifecycle() {
     401    public void TriggerLifecycle(bool force) {
    394402      using (trans.OpenTransaction()) {
    395403        DateTime lastCleanup = dao.GetLastCleanup();
    396         if (DateTime.Now - lastCleanup > TimeSpan.FromSeconds(59)) {
     404        if (force || DateTime.Now - lastCleanup > TimeSpan.FromSeconds(59)) {
    397405          dao.SetLastCleanup(DateTime.Now);
    398406          lifecycleManager.Cleanup();
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4/LifecycleManager.cs

    r5593 r5636  
    4848      var parentJobsToFinish = dao.GetParentJobs(dao.GetResources(x => true).Select(x => x.Id), 0, true);
    4949      foreach (var job in parentJobsToFinish) {
    50         job.SetState(JobState.Finished);
    51         dao.UpdateJob(job);
     50        dao.UpdateJobState(job.Id, JobState.Finished, null, null, string.Empty);
    5251      }
    5352    }
Note: See TracChangeset for help on using the changeset viewer.