Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/20/10 15:05:55 (14 years ago)
Author:
cneumuel
Message:
  • worked on new hive structure
  • created IIS hostable website for hive (old structure)

(#1233)

Location:
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3
Files:
5 added
5 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3

    • Property svn:ignore
      •  

        old new  
        11bin
        22obj
         3*.user
  • branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3/ContextFactory.cs

    r4598 r4629  
    7575          transactions.Add(threadId, transaction);
    7676        }
    77         return context;
     77        return disposableContext;
    7878      }
    7979    }
     
    9696      lock (locker) {
    9797        int threadId = Thread.CurrentThread.ManagedThreadId;
    98         contexts[threadId].Dispose();
     98        contexts[threadId].Obj.Dispose();
    9999        contexts.Remove(threadId);
    100100        // context gets disposed implicitly, when it is used as IDisposable
  • branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3/HeuristicLab.Services.Hive.DataAccess-3.3.csproj

    r4615 r4629  
    3030    <ErrorReport>prompt</ErrorReport>
    3131    <WarningLevel>4</WarningLevel>
     32  </PropertyGroup>
     33  <PropertyGroup>
     34    <SignAssembly>true</SignAssembly>
     35  </PropertyGroup>
     36  <PropertyGroup>
     37    <AssemblyOriginatorKeyFile>HeuristicLab.snk</AssemblyOriginatorKeyFile>
    3238  </PropertyGroup>
    3339  <ItemGroup>
     
    7581      <DependentUpon>Settings.settings</DependentUpon>
    7682    </Compile>
     83    <Compile Include="Tools\CreateHiveDatabaseApplication.cs" />
    7784  </ItemGroup>
    7885  <ItemGroup>
     
    8390      <SubType>Designer</SubType>
    8491    </None>
     92    <None Include="HeuristicLab.snk" />
    8593    <None Include="HiveDataContext.dbml">
    8694      <Generator>MSLinqToSQLGenerator</Generator>
     
    104112    </ProjectReference>
    105113  </ItemGroup>
     114  <ItemGroup>
     115    <Content Include="Tools\cleanHiveDatabase.sql" />
     116    <Content Include="Tools\prepareHiveDatabase.sql" />
     117  </ItemGroup>
    106118  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
    107119  <PropertyGroup>
  • branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDao.cs

    r4615 r4629  
    5858                  orderby ar.Job.Priority descending
    5959                  select Convert.ToDto(ar.Job);
    60       return query.ToArray();
     60      return query;
     61    }
     62
     63    public IEnumerable<DT.Job> GetAvailableJobs(DT.Slave slave) {
     64      var query = from j in db.Jobs
     65                  where j.JobState == JobState.Waiting && j.CoresNeeded <= slave.FreeCores && j.MemoryNeeded <= slave.FreeMemory
     66                  orderby j.Priority descending
     67                  select Convert.ToDto(j);
     68      return query.Union(GetAvailableParentJobs(slave.Id)).OrderByDescending(x => x.Priority).ToArray();
    6169    }
    6270    #endregion
     
    217225    public bool IsUserAuthorizedForJobs(Guid userId, params Guid[] jobIds) {
    218226      var userIds = from job in db.Jobs // this needs to be fast!
    219                  where jobIds.Contains(job.JobId)
    220                  select job.UserId;
     227                    where jobIds.Contains(job.JobId)
     228                    select job.UserId;
    221229      return userIds.All(x => x == userId);
    222230    }
  • branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3/Interfaces/IHiveDao.cs

    r4615 r4629  
    1515    void UpdateJob(DT.Job dto);
    1616    void DeleteJob(Guid id);
    17     IEnumerable<DT.Job> GetAvailableParentJobs(Guid slaveId);
     17    IEnumerable<DT.Job> GetAvailableJobs(DT.Slave slave);
    1818    #endregion
    1919
Note: See TracChangeset for help on using the changeset viewer.