Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/05/11 22:35:40 (13 years ago)
Author:
cneumuel
Message:

#1233

  • refactoring of slave core
  • created JobManager, which is responsible for managing jobs without knowing anything about the service. this class is easier testable than slave core
  • lots of cleanup
  • created console test project for slave
Location:
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4
Files:
2 edited

Legend:

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

    r6267 r6357  
    103103                           where child.ParentJobId == ar.Job.JobId
    104104                           select child).Count() > 0
    105                     orderby ar.Job.Priority descending
     105                    orderby ar.Job.Priority, db.Random() descending
    106106                    select Convert.ToDto(ar.Job);
    107107        return count == 0 ? query.ToArray() : query.Take(count).ToArray();
     
    121121                       && ar.Job.CoresNeeded <= slave.FreeCores
    122122                       && ar.Job.MemoryNeeded <= slave.FreeMemory
    123                     orderby ar.Job.Priority descending
     123                    orderby ar.Job.Priority, db.Random() descending // take random job to avoid the race condition that occurs when this method is called concurrently (the same job would be returned)
    124124                    select Convert.ToDto(ar.Job);
    125125        var waitingJobs = (count == 0 ? query : query.Take(count)).ToArray();
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HiveDataContext.cs

    r6229 r6357  
     1using System;
     2using System.Data.Linq.Mapping;
    13namespace HeuristicLab.Services.Hive.DataAccess {
    24  partial class SlaveStatistics {
     
    46
    57  partial class HiveDataContext {
     8    // source: http://stackoverflow.com/questions/648196/random-row-from-linq-to-sql
     9    [Function(Name = "NEWID", IsComposable = true)]
     10    public Guid Random() {
     11      // to prove not used by our C# code...
     12      throw new NotImplementedException();
     13    }
    614  }
    715}
Note: See TracChangeset for help on using the changeset viewer.