Changeset 5155 for branches/HeuristicLab.Hive-3.4/sources
- Timestamp:
- 12/21/10 18:18:54 (14 years ago)
- Location:
- branches/HeuristicLab.Hive-3.4/sources
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Tests/Mocks/MockHiveService.cs
r5137 r5155 85 85 86 86 #region Job Methods 87 public Guid AddJob(Job job, JobData jobData ) {87 public Guid AddJob(Job job, JobData jobData, IEnumerable<Guid> slaveGroupIds) { 88 88 job.Id = Guid.NewGuid(); 89 89 jobData.JobId = job.Id; … … 93 93 } 94 94 95 public Guid AddChildJob(Guid parentJobId, Job job, JobData jobData ) {95 public Guid AddChildJob(Guid parentJobId, Job job, JobData jobData, IEnumerable<Guid> slaveGroupIds) { 96 96 job.Id = Guid.NewGuid(); 97 97 job.ParentJobId = parentJobId; -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ExperimentManager/HiveExperimentClient.cs
r5106 r5155 282 282 } else { 283 283 // response = service.AddJobWithGroupStrings(serializedJob, groups); 284 hiveJob.Job.Id = service.AddJob(hiveJob.Job, jobData );284 hiveJob.Job.Id = service.AddJob(hiveJob.Job, jobData, null); // todo: use ResourceIds 285 285 } 286 286 -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/ServiceContracts/IHiveService.cs
r5106 r5155 15 15 #region Job Methods 16 16 [OperationContract] 17 Guid AddJob(Job job, JobData jobData );17 Guid AddJob(Job job, JobData jobData, IEnumerable<Guid> slaveGroupIds); 18 18 19 19 [OperationContract] -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HiveDao.cs
r5106 r5155 57 57 } 58 58 59 public IEnumerable<DT.Job> Get AvailableParentJobs(Guid slaveId) {59 public IEnumerable<DT.Job> GetWaitingParentJobs(Guid slaveId) { 60 60 using (var db = CreateContext()) { 61 61 // todo: slaveId is unused! … … 80 80 orderby j.Priority descending 81 81 select Convert.ToDto(j); 82 return query.Union(Get AvailableParentJobs(slave.Id)).OrderByDescending(x => x.Priority).ToArray();82 return query.Union(GetWaitingParentJobs(slave.Id)).OrderByDescending(x => x.Priority).ToArray(); 83 83 } 84 84 } … … 363 363 if (entity != null) db.Resources.DeleteOnSubmit(entity); 364 364 db.SubmitChanges(); 365 } 366 } 367 368 public void AssignJobToResource(Guid jobId, Guid resourceId) { 369 using (var db = CreateContext()) { 370 var job = db.Jobs.Where(x => x.JobId == jobId).Single(); 371 job.AssignedResources.Add(new AssignedResource() { JobId = jobId, ResourceId = resourceId }); 372 db.SubmitChanges(); 373 } 374 } 375 376 public IEnumerable<DT.Resource> GetAssignedResources(Guid jobId) { 377 using (var db = CreateContext()) { 378 var job = db.Jobs.Where(x => x.JobId == jobId).Single(); 379 return job.AssignedResources.Select(x => Convert.ToDto(x.Resource)).ToArray(); 365 380 } 366 381 } -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HiveDataContext.dbml.layout
r5106 r5155 1 1 <?xml version="1.0" encoding="utf-8"?> 2 <ordesignerObjectsDiagram dslVersion="1.0.0.0" absoluteBounds="0, 0, 1 6.25, 12.25" name="HiveDataContext">2 <ordesignerObjectsDiagram dslVersion="1.0.0.0" absoluteBounds="0, 0, 15.75, 8.5" name="HiveDataContext"> 3 3 <DataContextMoniker Name="/HiveDataContext" /> 4 4 <nestedChildShapes> 5 <classShape Id="a929c9dc-69f4-4488-ba1c-a2342bf81d89" absoluteBounds=" 12.75, 2.875, 2, 1.3862939453124987">5 <classShape Id="a929c9dc-69f4-4488-ba1c-a2342bf81d89" absoluteBounds="8.875, 3.75, 2, 1.3862939453124987"> 6 6 <DataClassMoniker Name="/HiveDataContext/AssignedResource" /> 7 7 <nestedChildShapes> 8 <elementListCompartment Id="8b005775-f0ee-41b0-ae10-6d1151003708" absoluteBounds=" 12.765, 3.3350000000000009, 1.9700000000000002, 0.8262939453125" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />8 <elementListCompartment Id="8b005775-f0ee-41b0-ae10-6d1151003708" absoluteBounds="8.89, 4.2100000000000009, 1.9700000000000002, 0.8262939453125" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" /> 9 9 </nestedChildShapes> 10 10 </classShape> 11 <classShape Id="7d998e56-4fba-41ca-a1a8-1dcdb9068edf" absoluteBounds="9, 10.625, 2, 1.3862939453125005">11 <classShape Id="7d998e56-4fba-41ca-a1a8-1dcdb9068edf" absoluteBounds="9, 5.5, 2, 1.3862939453125005"> 12 12 <DataClassMoniker Name="/HiveDataContext/Plugin" /> 13 13 <nestedChildShapes> 14 <elementListCompartment Id="ec4ba325-6dff-4418-baad-59af81ae2024" absoluteBounds="9.015, 11.085, 1.9700000000000002, 0.8262939453125" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />14 <elementListCompartment Id="ec4ba325-6dff-4418-baad-59af81ae2024" absoluteBounds="9.015, 5.9600000000000009, 1.9700000000000002, 0.8262939453125" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" /> 15 15 </nestedChildShapes> 16 16 </classShape> 17 <classShape Id="97b00810-fa30-457e-b484-b4e80b22f91b" absoluteBounds=" 9.25, 8.875, 2, 1.3862939453124987">17 <classShape Id="97b00810-fa30-457e-b484-b4e80b22f91b" absoluteBounds="6.5, 5.5, 2, 1.3862939453124987"> 18 18 <DataClassMoniker Name="/HiveDataContext/RequiredPlugin" /> 19 19 <nestedChildShapes> 20 <elementListCompartment Id="df6451e5-069e-4ca0-a909-61b8213b5047" absoluteBounds=" 9.265, 9.335, 1.9700000000000002, 0.8262939453125" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />20 <elementListCompartment Id="df6451e5-069e-4ca0-a909-61b8213b5047" absoluteBounds="6.5150000000000006, 5.9600000000000009, 1.9700000000000002, 0.8262939453125" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" /> 21 21 </nestedChildShapes> 22 22 </classShape> 23 <classShape Id="706a4581-6daf-4e71-ae2a-87d50b27a051" absoluteBounds="11. 75, 0.75, 2, 1.5785953776041666">23 <classShape Id="706a4581-6daf-4e71-ae2a-87d50b27a051" absoluteBounds="11.25, 1, 2, 1.5785953776041666"> 24 24 <DataClassMoniker Name="/HiveDataContext/Resource" /> 25 25 <nestedChildShapes> 26 <elementListCompartment Id="8c24f5bf-2164-4d0f-832e-1730eb0066df" absoluteBounds="11. 765, 1.21, 1.9700000000000002, 1.0185953776041665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />26 <elementListCompartment Id="8c24f5bf-2164-4d0f-832e-1730eb0066df" absoluteBounds="11.265, 1.46, 1.9700000000000002, 1.0185953776041665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" /> 27 27 </nestedChildShapes> 28 28 </classShape> 29 <classShape Id="695bfc39-59f3-4e60-8644-f847964bf62c" absoluteBounds=" 9.25, 4.375, 2, 3.5016097005208326">29 <classShape Id="695bfc39-59f3-4e60-8644-f847964bf62c" absoluteBounds="6.5, 1, 2, 3.5016097005208326"> 30 30 <DataClassMoniker Name="/HiveDataContext/Job" /> 31 31 <nestedChildShapes> 32 <elementListCompartment Id="a6a30e11-03d1-4869-82e6-b733f4ef9974" absoluteBounds=" 9.265, 4.835, 1.9700000000000002, 2.941609700520833" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />32 <elementListCompartment Id="a6a30e11-03d1-4869-82e6-b733f4ef9974" absoluteBounds="6.5150000000000006, 1.46, 1.9700000000000002, 2.941609700520833" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" /> 33 33 </nestedChildShapes> 34 34 </classShape> 35 <classShape Id="8d5712f7-7a1a-4a89-bd4d-fd60200d3306" absoluteBounds="1 1.75, 4.625, 2, 2.1554996744791666">35 <classShape Id="8d5712f7-7a1a-4a89-bd4d-fd60200d3306" absoluteBounds="13.5, 2.5, 2, 2.1554996744791666"> 36 36 <DataClassMoniker Name="/HiveDataContext/UptimeCalendar" /> 37 37 <nestedChildShapes> 38 <elementListCompartment Id="7d8f121b-35bb-4753-a25f-3fac1562e68e" absoluteBounds="1 1.765, 5.0850000000000009, 1.9700000000000002, 1.5954996744791665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />38 <elementListCompartment Id="7d8f121b-35bb-4753-a25f-3fac1562e68e" absoluteBounds="13.515, 2.9600000000000009, 1.9700000000000002, 1.5954996744791665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" /> 39 39 </nestedChildShapes> 40 40 </classShape> 41 <classShape Id="e6f840cc-2968-4be1-b234-eef624ccacbb" absoluteBounds="4. 875, 6, 2, 2.1554996744791666">41 <classShape Id="e6f840cc-2968-4be1-b234-eef624ccacbb" absoluteBounds="4.125, 2.625, 2, 2.1554996744791666"> 42 42 <DataClassMoniker Name="/HiveDataContext/HiveExperiment" /> 43 43 <nestedChildShapes> 44 <elementListCompartment Id="0c65d4e1-256a-4a91-9a57-392f25e4de7f" absoluteBounds="4. 8900000000000006, 6.4600000000000009, 1.9700000000000002, 1.5954996744791665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />44 <elementListCompartment Id="0c65d4e1-256a-4a91-9a57-392f25e4de7f" absoluteBounds="4.1400000000000006, 3.0850000000000009, 1.9700000000000002, 1.5954996744791665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" /> 45 45 </nestedChildShapes> 46 46 </classShape> 47 <classShape Id="26f4edfa-91dd-4941-a058-359f89e567a8" absoluteBounds=" 9.375, 0.75, 2, 2.3478011067708335">47 <classShape Id="26f4edfa-91dd-4941-a058-359f89e567a8" absoluteBounds="8.875, 1, 2, 2.3478011067708335"> 48 48 <DataClassMoniker Name="/HiveDataContext/Slave" /> 49 49 <nestedChildShapes> 50 <elementListCompartment Id="1e61f36b-08dc-4df7-8594-c9dcd95c0791" absoluteBounds=" 9.39, 1.21, 1.9700000000000002, 1.7878011067708333" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />50 <elementListCompartment Id="1e61f36b-08dc-4df7-8594-c9dcd95c0791" absoluteBounds="8.89, 1.46, 1.9700000000000002, 1.7878011067708333" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" /> 51 51 </nestedChildShapes> 52 52 </classShape> 53 <classShape Id="bbd91675-92f2-4a69-8429-0950008fc8a4" absoluteBounds="1 4, 0.75, 2, 0.8093896484375">53 <classShape Id="bbd91675-92f2-4a69-8429-0950008fc8a4" absoluteBounds="13.5, 1, 2, 0.8093896484375"> 54 54 <DataClassMoniker Name="/HiveDataContext/SlaveGroup" /> 55 55 <nestedChildShapes> 56 <elementListCompartment Id="5a790e8f-6e2e-4bf5-bd2b-f8a82224d9d7" absoluteBounds="1 4, 0.75, 0.125, 0.2493896484375" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />56 <elementListCompartment Id="5a790e8f-6e2e-4bf5-bd2b-f8a82224d9d7" absoluteBounds="13.5, 1, 0.125, 0.2493896484375" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" /> 57 57 </nestedChildShapes> 58 58 </classShape> 59 <inheritanceConnector edgePoints="[(11. 75 : 1.53929768880208); (11.375 : 1.53929768880208)]" fixedFrom="Algorithm" fixedTo="Algorithm" TargetRelationshipDomainClassId="7a7fe09e-e9ef-4b01-9ff3-bde95e827b62">59 <inheritanceConnector edgePoints="[(11.25 : 1.78929768880208); (10.875 : 1.78929768880208)]" fixedFrom="Algorithm" fixedTo="Algorithm" TargetRelationshipDomainClassId="7a7fe09e-e9ef-4b01-9ff3-bde95e827b62"> 60 60 <nodes> 61 61 <classShapeMoniker Id="706a4581-6daf-4e71-ae2a-87d50b27a051" /> … … 63 63 </nodes> 64 64 </inheritanceConnector> 65 <inheritanceConnector edgePoints="[(13. 75 : 1.15469482421875); (14 : 1.15469482421875)]" fixedFrom="Algorithm" fixedTo="Algorithm" TargetRelationshipDomainClassId="7a7fe09e-e9ef-4b01-9ff3-bde95e827b62">65 <inheritanceConnector edgePoints="[(13.25 : 1.40469482421875); (13.5 : 1.40469482421875)]" fixedFrom="Algorithm" fixedTo="Algorithm" TargetRelationshipDomainClassId="7a7fe09e-e9ef-4b01-9ff3-bde95e827b62"> 66 66 <nodes> 67 67 <classShapeMoniker Id="706a4581-6daf-4e71-ae2a-87d50b27a051" /> … … 69 69 </nodes> 70 70 </inheritanceConnector> 71 <associationConnector edgePoints="[(1 3.25 : 2.32859537760417); (13.25 : 2.875)]" fixedFrom="Algorithm" fixedTo="Algorithm">71 <associationConnector edgePoints="[(12.25 : 2.57859537760417); (12.25 : 4.44314697265625); (10.875 : 4.44314697265625)]" fixedFrom="Algorithm" fixedTo="Algorithm"> 72 72 <AssociationMoniker Name="/HiveDataContext/Resource/Resource_AssignedResource" /> 73 73 <nodes> … … 76 76 </nodes> 77 77 </associationConnector> 78 <associationConnector edgePoints="[( 11.25 : 7.20274983723958); (14.34375 : 7.20274983723958); (14.34375 : 4.2612939453125)]" fixedFrom="NotFixed" fixedTo="NotFixed">78 <associationConnector edgePoints="[(8.5 : 4.12580485026042); (8.875 : 4.12580485026042)]" fixedFrom="Algorithm" fixedTo="Algorithm"> 79 79 <AssociationMoniker Name="/HiveDataContext/Job/Job_AssignedResource" /> 80 80 <nodes> … … 83 83 </nodes> 84 84 </associationConnector> 85 <associationConnector edgePoints="[( 10.25 : 7.87660970052083); (10.25 : 8.875)]" fixedFrom="NotFixed" fixedTo="NotFixed">85 <associationConnector edgePoints="[(7.1210551923077 : 4.50160970052083); (7.1210551923077 : 5.5)]" fixedFrom="Algorithm" fixedTo="Algorithm"> 86 86 <AssociationMoniker Name="/HiveDataContext/Job/Job_RequiredPlugin" /> 87 87 <nodes> … … 90 90 </nodes> 91 91 </associationConnector> 92 <associationConnector edgePoints="[( 11.0834359271285 : 7.87660970052083); (11.0834359271285 : 7.95910970052083); (11.1656121961154 : 7.95910970052083); (11.1656121961154 : 8.12660970052083); (10.5546153846154 : 8.12660970052083); (10.5546153846154 : 7.87660970052083)]" manuallyRouted="true" fixedFrom="NotFixed" fixedTo="NotFixed">92 <associationConnector edgePoints="[(8.3334359271285 : 4.50160970052083); (8.3334359271285 : 4.58410970052083); (8.4156121961154 : 4.58410970052083); (8.4156121961154 : 4.75160970052083); (7.8046153846154 : 4.75160970052083); (7.8046153846154 : 4.50160970052083)]" manuallyRouted="true" fixedFrom="NotFixed" fixedTo="NotFixed"> 93 93 <AssociationMoniker Name="/HiveDataContext/Job/Job_Job" /> 94 94 <nodes> … … 97 97 </nodes> 98 98 </associationConnector> 99 <associationConnector edgePoints="[( 10.3125 : 3.09780110677083); (10.3125 : 4.375)]" fixedFrom="NotFixed" fixedTo="NotFixed">99 <associationConnector edgePoints="[(8.875 : 2.17390055338542); (8.5 : 2.17390055338542)]" fixedFrom="Algorithm" fixedTo="Algorithm"> 100 100 <AssociationMoniker Name="/HiveDataContext/Slave/Slave_Job" /> 101 101 <nodes> … … 104 104 </nodes> 105 105 </associationConnector> 106 <associationConnector edgePoints="[(12. 21875 : 2.32859537760417); (12.21875 : 4.625)]" fixedFrom="Algorithm" fixedTo="Algorithm">106 <associationConnector edgePoints="[(12.781252 : 2.57859537760417); (12.781252 : 3.54212367513021); (13.5 : 3.54212367513021)]" fixedFrom="Algorithm" fixedTo="Algorithm"> 107 107 <AssociationMoniker Name="/HiveDataContext/Resource/Resource_UptimeCalendar" /> 108 108 <nodes> … … 111 111 </nodes> 112 112 </associationConnector> 113 <associationConnector edgePoints="[( 9.25 : 6.93830485026042); (6.875 : 6.93830485026042)]" fixedFrom="NotFixed" fixedTo="NotFixed">113 <associationConnector edgePoints="[(6.5 : 3.56330485026042); (6.125 : 3.56330485026042)]" fixedFrom="Algorithm" fixedTo="Algorithm"> 114 114 <AssociationMoniker Name="/HiveDataContext/Job/Job_HiveExperiment" /> 115 115 <nodes> … … 118 118 </nodes> 119 119 </associationConnector> 120 <classShape Id="6bc13f26-f9a8-4597-b054-35be34190d12" absoluteBounds=" 6.875, 4.375, 2, 1.3862939453124996">120 <classShape Id="6bc13f26-f9a8-4597-b054-35be34190d12" absoluteBounds="4.125, 1, 2, 1.3862939453124996"> 121 121 <DataClassMoniker Name="/HiveDataContext/JobData" /> 122 122 <nestedChildShapes> 123 <elementListCompartment Id="a068522c-7974-4679-b356-e33c941c465b" absoluteBounds=" 6.89, 4.835, 1.9700000000000002, 0.8262939453125" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />123 <elementListCompartment Id="a068522c-7974-4679-b356-e33c941c465b" absoluteBounds="4.14, 1.46, 1.9700000000000002, 0.8262939453125" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" /> 124 124 </nestedChildShapes> 125 125 </classShape> 126 <classShape Id="ad25bd0f-80e8-4a06-abd8-190eb678eec7" absoluteBounds="11. 5, 10.625, 2, 1.1939925130208344">126 <classShape Id="ad25bd0f-80e8-4a06-abd8-190eb678eec7" absoluteBounds="11.375, 5.5, 2, 1.1939925130208344"> 127 127 <DataClassMoniker Name="/HiveDataContext/PluginData" /> 128 128 <nestedChildShapes> 129 <elementListCompartment Id="acddb513-7de6-4bb4-8335-d6982fb2ef35" absoluteBounds="11. 515, 11.085, 1.9700000000000002, 0.63399251302083326" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />129 <elementListCompartment Id="acddb513-7de6-4bb4-8335-d6982fb2ef35" absoluteBounds="11.39, 5.9600000000000009, 1.9700000000000002, 0.63399251302083326" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" /> 130 130 </nestedChildShapes> 131 131 </classShape> 132 <associationConnector edgePoints="[(11 : 11.2219962565104); (11.5 : 11.2219962565104)]" fixedFrom="NotFixed" fixedTo="NotFixed">132 <associationConnector edgePoints="[(11 : 6.09699625651042); (11.375 : 6.09699625651042)]" fixedFrom="Algorithm" fixedTo="Algorithm"> 133 133 <AssociationMoniker Name="/HiveDataContext/Plugin/Plugin_PluginData" /> 134 134 <nodes> … … 137 137 </nodes> 138 138 </associationConnector> 139 <associationConnector edgePoints="[( 9.25 : 5.06814697265625); (8.875 : 5.06814697265625)]" fixedFrom="NotFixed" fixedTo="NotFixed">139 <associationConnector edgePoints="[(6.5 : 1.69314697265625); (6.125 : 1.69314697265625)]" fixedFrom="Algorithm" fixedTo="Algorithm"> 140 140 <AssociationMoniker Name="/HiveDataContext/Job/Job_JobData" /> 141 141 <nodes> … … 144 144 </nodes> 145 145 </associationConnector> 146 <associationConnector edgePoints="[( 10.125 : 10.625); (10.125 : 10.2612939453125)]" fixedFrom="NotFixed" fixedTo="NotFixed">146 <associationConnector edgePoints="[(9 : 6.19314697265625); (8.5 : 6.19314697265625)]" fixedFrom="Algorithm" fixedTo="Algorithm"> 147 147 <AssociationMoniker Name="/HiveDataContext/Plugin/Plugin_RequiredPlugin" /> 148 148 <nodes> … … 151 151 </nodes> 152 152 </associationConnector> 153 <associationConnector edgePoints="[(1 2.4524234637921 : 0.75); (12.4524234637921 : 0.5); (13.0617468474559 : 0.5); (13.0617468474559 : 0.75)]" fixedFrom="NotFixed" fixedTo="NotFixed">153 <associationConnector edgePoints="[(11.9524234637921 : 1); (11.9524234637921 : 0.75); (12.5617468474559 : 0.75); (12.5617468474559 : 1)]" fixedFrom="NotFixed" fixedTo="NotFixed"> 154 154 <AssociationMoniker Name="/HiveDataContext/Resource/Resource_Resource" /> 155 155 <nodes> -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/Interfaces/IHiveDao.cs
r4905 r5155 75 75 void UpdateResource(DT.Resource dto); 76 76 void DeleteResource(Guid id); 77 void AssignJobToResource(Guid jobId, Guid resourceId); 78 IEnumerable<DT.Resource> GetAssignedResources(Guid jobId); 77 79 #endregion 78 80 -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Tests/DaoTests.cs
r5106 r5155 33 33 DT.Job job1 = new DT.Job(); 34 34 job1.DateCreated = DateTime.Now; 35 job1.JobState = JobState.Waiting;36 35 job1.Id = dao.AddJob(job1); 37 36 … … 46 45 47 46 Assert.AreEqual(null, dao.GetJob(job1.Id)); 47 } 48 48 49 [TestMethod] 50 public void TestSlaveDao() { 51 IHiveDao dao = ServiceLocator.Instance.HiveDao; 49 52 DT.SlaveGroup slaveGroup = new DT.SlaveGroup() { 50 53 Name = "Test" … … 52 55 slaveGroup.Id = dao.AddSlaveGroup(slaveGroup); 53 56 57 DT.Slave slave = new DT.Slave() { 58 Name = "Test" 59 }; 60 slave.Id= dao.AddSlave(slave); 61 62 dao.DeleteSlave(slave.Id); 54 63 dao.DeleteSlaveGroup(slaveGroup.Id); 64 } 65 66 [TestMethod] 67 public void TestJobDaoWaiting() { 68 IHiveDao dao = ServiceLocator.Instance.HiveDao; 69 70 DT.Job job = new DT.Job(); 71 job.DateCreated = DateTime.Now; 72 job.JobState = JobState.Waiting; 73 job.Id = dao.AddJob(job); 74 75 55 76 } 56 77 } -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Tests/ServiceTests.cs
r5106 r5155 48 48 }; 49 49 50 job.Id = service.AddJob(job, jobData );50 job.Id = service.AddJob(job, jobData, null); 51 51 experiment.RootJobId = job.Id; 52 52 … … 89 89 }; 90 90 JobData jobData = new JobData() { Data = PersistenceUtil.Serialize(new MockJob(500, false)) }; 91 job.Id = service.AddJob(job, jobData );91 job.Id = service.AddJob(job, jobData, null); 92 92 jobs.Add(job); 93 93 } -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4/HiveService.cs
r5106 r5155 35 35 //[PrincipalPermission(SecurityAction.Demand, Role = HiveRoles.Administrator)] 36 36 //[PrincipalPermission(SecurityAction.Demand, Role = HiveRoles.Client)] 37 public Guid AddJob(Job job, JobData jobData ) {37 public Guid AddJob(Job job, JobData jobData, IEnumerable<Guid> slaveGroupIds) { 38 38 using (trans.OpenTransaction()) { 39 39 job.UserId = auth.UserId; 40 40 job.DateCreated = DateTime.Now; 41 41 job.JobState = JobState.Waiting; 42 jobData.JobId = dao.AddJob(job); 42 job.Id = dao.AddJob(job); 43 jobData.JobId = job.Id; 43 44 jobData.LastUpdate = DateTime.Now; 45 if (slaveGroupIds != null) { 46 foreach (Guid slaveGroupId in slaveGroupIds) { 47 dao.AssignJobToResource(job.Id, slaveGroupId); 48 } 49 } else { 50 // todo: use default group 51 } 44 52 dao.AddJobData(jobData); 45 53 return jobData.JobId; … … 50 58 using (trans.OpenTransaction()) { 51 59 job.ParentJobId = parentJobId; 52 jobData.LastUpdate = DateTime.Now; 53 return AddJob(job, jobData); 60 return AddJob(job, jobData, dao.GetAssignedResources(parentJobId).Select(x => x.Id)); 54 61 } 55 62 }
Note: See TracChangeset
for help on using the changeset viewer.