Changeset 5375
- Timestamp:
- 01/25/11 17:34:47 (14 years ago)
- Location:
- branches/HeuristicLab.Hive-3.4/sources
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.ConsoleClient-3.4/HeuristicLab.Clients.Hive.Slave.ConsoleClient-3.4.csproj
r5158 r5375 78 78 </ItemGroup> 79 79 <ItemGroup> 80 <None Include="app.config" /> 80 <None Include="app.config"> 81 <SubType>Designer</SubType> 82 </None> 81 83 </ItemGroup> 82 84 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.ConsoleClient-3.4/Program.cs
r5314 r5375 22 22 using System; 23 23 using System.Threading; 24 using HeuristicLab.Clients.Hive.Slave;25 24 using HeuristicLab.Clients.Hive.Slave.Tests; 26 25 … … 30 29 static void Main(string[] args) { 31 30 //mock the hive service for testing purposes 32 ServiceLocator.Instance = new MockServiceLocator(); 31 //ServiceLocator.Instance = new MockServiceLocator(); 32 33 33 //slave part 34 34 Core core = new Core(); -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.ConsoleClient-3.4/app.config
r5280 r5375 23 23 24 24 <client> 25 <endpoint address="http://localhost:9000/Hive-3.4" 25 <!--http://localhost:9000/Hive-3.4--> 26 <endpoint address="http://localhost:80/Service.svc" 26 27 binding="wsHttpBinding" 27 28 bindingConfiguration="wsHttpBinding" 28 29 contract="HeuristicLab.Services.Hive.Common.ServiceContracts.IHiveService" 29 30 name="wsHttpBinding_IHiveService"> 30 <identity> 31 <certificate encodedValue="AwAAAAEAAAAUAAAAfEKvcVixnJay+q4hCPFuO0JL5TQgAAAAAQAAAPIBAAAwggHuMIIBW6ADAgECAhCNN5wrUcXMmE/9xwp4TYa9MAkGBSsOAwIdBQAwFDESMBAGA1UEAxMJbG9jYWxob3N0MB4XDTEwMTAxOTEwNTMxNVoXDTM5MTIzMTIzNTk1OVowFDESMBAGA1UEAxMJbG9jYWxob3N0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDXwC5TGcAffd/0oAWHtm0s6YXVXEgXgb1AYmBkkkhkKIFJG/e/Z0KSYbJepmSJD44W3oOAVm+x1DAsZxU79HahDYgWCuHLMm1TLpwSmYOQ0kV3pGHWHhiWV7h7oGLds/eqZ2EOpaNGryfEPnrA4VmxY91vV5/2BTeVSWG6F8lRKQIDAQABo0kwRzBFBgNVHQEEPjA8gBAR7kBnMRHO5gzThEqda0wWoRYwFDESMBAGA1UEAxMJbG9jYWxob3N0ghCNN5wrUcXMmE/9xwp4TYa9MAkGBSsOAwIdBQADgYEAoPwEG4QTDXhlxERNDfsZmM2IhEpV42ppz1kEah2oYKDa/ElIMVtvqLv6flVtg18ENN/mEJWiHZ3NyP3qr2Pip+sh+/2WBiSbOaukES/CM7OJn9kJCImH7M/xqM8pxqY8IfgM6iBVrVj9uHqj3j2BBck+cYY8fKyh3CFifMIp6ac="/> 32 </identity> 31 <identity> 32 <certificate encodedValue="AwAAAAEAAAAUAAAAiQt8DnyaI8rYHhLNyW62i58+eG8gAAAAAQAAAPIBAAAwggHuMIIBW6ADAgECAhAFNFYz6Srdmk3PZJ/mka5sMAkGBSsOAwIdBQAwFDESMBAGA1UEAxMJbG9jYWxob3N0MB4XDTEwMTIwNjE0MTc0M1oXDTM5MTIzMTIzNTk1OVowFDESMBAGA1UEAxMJbG9jYWxob3N0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCueTMWJzOZ1IBacG40aWdr3qDWijEO4VwhgtNr+WNFsRG+qW2rTZZFtaC0U028aj3MX13mr+pzpcPJMes2rr38PuxhN6BhdzgRfyEy/eHk4iKqZztuJSXgNAyfyjhovTchLitT2lilddTRFj2PlLYv+PUu+QhQNTm2iW4UDljS9wIDAQABo0kwRzBFBgNVHQEEPjA8gBBeipmIklE3kPz7i+AdKqAgoRYwFDESMBAGA1UEAxMJbG9jYWxob3N0ghAFNFYz6Srdmk3PZJ/mka5sMAkGBSsOAwIdBQADgYEAGnxEaFT8QKKk1DtJ8/+TOBxSo0UkBlNiTY0HKkA3w/2DOPZKybhslm8gqJic8ZPsk5YgEibrdQqB0AnNG983RAlFqgGvsAbQAMXTDJ5GoTgHaxk/T+7a7Sk4xJALUL/vWuPGbA354RVoKA4gV3gJzU+Fj3/fLACf0+D/nR9B5nw=" /> 33 </identity> 34 33 35 </endpoint> 34 36 </client> -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Tests/Mocks/MockHiveService.cs
r5266 r5375 219 219 } 220 220 221 public void GoodBye( ) {222 // do nothing 221 public void GoodBye(Guid id) { 222 // do nothing 223 223 } 224 224 -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/HeartbeatManager.cs
r5314 r5375 91 91 92 92 Heartbeat heartBeatData = new Heartbeat { 93 SlaveId = info.Id, 93 SlaveId = info.Id, /*Settings.Default.Guid*/ 94 94 FreeCores = info.Cores.HasValue ? info.Cores.Value - ConfigManager.Instance.GetUsedCores() : 0, 95 95 FreeMemory = GetFreeMemory(), -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/WcfService.cs
r5314 r5375 79 79 ConnState = NetworkEnum.WcfConnState.Connected; 80 80 ConnectedSince = DateTime.Now; 81 service.Obj.Hello( Settings.Default.Guid, slaveInfo.Name, slaveInfo.Cores.Value, slaveInfo.Memory.Value);81 service.Obj.Hello(slaveInfo.Id/*Settings.Default.Guid*/, slaveInfo.Name, slaveInfo.Cores.Value, slaveInfo.Memory.Value); 82 82 OnConnected(); 83 83 } … … 94 94 using (Disposable<IHiveService> service = ServiceLocator.Instance.GetService()) { 95 95 try { 96 service.Obj.GoodBye( );96 service.Obj.GoodBye(ConfigManager.Instance.GetClientInfo().Id); 97 97 ConnState = NetworkEnum.WcfConnState.Disconnected; 98 98 } -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ServiceLocator.cs
r5055 r5375 20 20 #endregion 21 21 22 using HeuristicLab.Clients.Common; 22 23 using HeuristicLab.Services.Hive.Common.ServiceContracts; 23 using HeuristicLab.Clients.Hive.Properties;24 using HeuristicLab.Clients.Common;25 24 26 25 namespace HeuristicLab.Clients.Hive { … … 40 39 41 40 public Disposable<IHiveService> GetService() { 42 return ClientFactory.CreateClient<IHiveService>("wsHttpBinding_IHiveService"); 41 //TODO: move user config to app.config! 42 return ClientFactory.CreateClient<IHiveService>("wsHttpBinding_IHiveService", null, "ascheibe", "ascheibe$4"); 43 43 } 44 44 } -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Hive 3.4.sln
r5364 r5375 49 49 Release.AspNetCompiler.FixedNames = "false" 50 50 Release.AspNetCompiler.Debug = "False" 51 VWDPort = "49 227"51 VWDPort = "49885" 52 52 DefaultWebSiteLanguage = "Visual C#" 53 53 EndProjectSection -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/DataTransfer/PluginData.cs
r5266 r5375 29 29 public class PluginData : HiveItemBase { 30 30 [DataMember] 31 public int PluginDataId { get; set; } 32 [DataMember] 31 33 public Guid PluginId { get; set; } 32 34 [DataMember] … … 43 45 Array.Copy(original.Data, this.Data, original.Data.Length); 44 46 this.FileName = original.FileName; 47 this.PluginDataId = original.PluginDataId; 48 this.PluginId = original.PluginId; 45 49 } 46 50 public override IDeepCloneable Clone(Cloner cloner) { -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/ServiceContracts/IHiveService.cs
r5155 r5375 1 1 using System; 2 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 3 using System.Net.Security; 5 4 using System.ServiceModel; 6 using System.IO;7 5 using HeuristicLab.Services.Hive.Common.DataTransfer; 8 using System.Net.Security;9 6 10 7 namespace HeuristicLab.Services.Hive.Common.ServiceContracts { … … 85 82 86 83 [OperationContract] 87 void GoodBye( );84 void GoodBye(Guid slaveId); 88 85 #endregion 89 86 … … 101 98 IEnumerable<PluginData> GetPluginDatas(List<Guid> pluginIds); 102 99 #endregion 103 100 104 101 #region Slave Methods 105 102 [OperationContract] -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/Convert.cs
r5266 r5375 126 126 public static DT.PluginData ToDto(PluginData source) { 127 127 if (source == null) return null; 128 return new DT.PluginData { PluginId = source.PluginId, Data = source.Data.ToArray(), FileName = source.FileName };128 return new DT.PluginData { PluginId = source.PluginId, Data = source.Data.ToArray(), FileName = source.FileName, PluginDataId = source.PluginDataId }; 129 129 } 130 130 public static PluginData ToEntity(DT.PluginData source) { -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HiveDao.cs
r5156 r5375 90 90 orderby ar.Job.Priority descending 91 91 select Convert.ToDto(ar.Job); 92 return query ;92 return query.ToArray(); 93 93 } 94 94 } … … 100 100 orderby j.Priority descending 101 101 select Convert.ToDto(j); 102 return query.Union(GetWaitingParentJobs(slave.Id)).OrderByDescending(x => x.Priority).ToArray(); 102 var waitingJobs = query.ToArray(); 103 var waitingParentJobs = GetWaitingParentJobs(slave.Id); 104 return waitingJobs.Union(waitingParentJobs).OrderByDescending(x => x.Priority); 103 105 } 104 106 } … … 322 324 public Guid AddSlaveGroup(DT.SlaveGroup dto) { 323 325 using (var db = CreateContext()) { 326 if (dto.Id == Guid.Empty) 327 dto.Id = Guid.NewGuid(); 324 328 var entity = Convert.ToEntity(dto); 325 329 db.Resources.InsertOnSubmit(entity); -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HiveDataContext.dbml
r5266 r5375 15 15 <Column Name="Version" Type="System.String" DbType="VarChar(MAX)" CanBeNull="false" /> 16 16 <Association Name="Plugin_RequiredPlugin" Member="RequiredPlugins" ThisKey="PluginId" OtherKey="PluginId" Type="RequiredPlugin" /> 17 <Association Name="Plugin_PluginData" Member="PluginData" ThisKey="PluginId" OtherKey="PluginId" Type="PluginData" Cardinality="One"/>17 <Association Name="Plugin_PluginData" Member="PluginData" ThisKey="PluginId" OtherKey="PluginId" Type="PluginData" /> 18 18 </Type> 19 19 </Table> … … 29 29 <Table Name="dbo.Resource" Member="Resources"> 30 30 <Type Name="Resource" InheritanceCode="RESOURCE"> 31 <Column Name="ResourceId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" />31 <Column Name="ResourceId" AutoSync="OnInsert" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" /> 32 32 <Column Name="Name" Type="System.String" DbType="VarChar(MAX)" CanBeNull="false" /> 33 33 <Column Name="ResourceType" Type="System.String" CanBeNull="false" IsDiscriminator="true" /> … … 112 112 <Column Name="Data" Type="System.Data.Linq.Binary" DbType="VarBinary(MAX) NOT NULL" CanBeNull="false" UpdateCheck="Never" /> 113 113 <Column Name="FileName" Type="System.String" DbType="VarChar(MAX)" CanBeNull="false" /> 114 <Column Name="PluginDataId" Type="System.Int32" DbType="Int IDENTITY(1,1)" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" /> 114 115 <Association Name="Plugin_PluginData" Member="Plugin" ThisKey="PluginId" OtherKey="PluginId" Type="Plugin" IsForeignKey="true" /> 115 116 </Type> -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HiveDataContext.dbml.layout
r5266 r5375 124 124 </nestedChildShapes> 125 125 </classShape> 126 <classShape Id="ad25bd0f-80e8-4a06-abd8-190eb678eec7" absoluteBounds="11. 375, 5.5, 2, 1.3862939453124996">126 <classShape Id="ad25bd0f-80e8-4a06-abd8-190eb678eec7" absoluteBounds="11.625, 5.5, 2, 1.5785953776041666"> 127 127 <DataClassMoniker Name="/HiveDataContext/PluginData" /> 128 128 <nestedChildShapes> 129 <elementListCompartment Id="acddb513-7de6-4bb4-8335-d6982fb2ef35" absoluteBounds="11. 39, 5.9600000000000009, 1.9700000000000002, 0.8262939453125" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />129 <elementListCompartment Id="acddb513-7de6-4bb4-8335-d6982fb2ef35" absoluteBounds="11.64, 5.9600000000000009, 1.9700000000000002, 1.0185953776041665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" /> 130 130 </nestedChildShapes> 131 131 </classShape> 132 <associationConnector edgePoints="[(11 : 6.19314697265625); (11. 375 : 6.19314697265625)]" fixedFrom="Algorithm" fixedTo="Algorithm">132 <associationConnector edgePoints="[(11 : 6.19314697265625); (11.625 : 6.19314697265625)]" fixedFrom="NotFixed" fixedTo="NotFixed"> 133 133 <AssociationMoniker Name="/HiveDataContext/Plugin/Plugin_PluginData" /> 134 134 <nodes> … … 137 137 </nodes> 138 138 </associationConnector> 139 <associationConnector edgePoints="[(6.5 : 1.69314697265625); (6.125 : 1.69314697265625)]" fixedFrom=" Algorithm" fixedTo="Algorithm">139 <associationConnector edgePoints="[(6.5 : 1.69314697265625); (6.125 : 1.69314697265625)]" fixedFrom="NotFixed" fixedTo="NotFixed"> 140 140 <AssociationMoniker Name="/HiveDataContext/Job/Job_JobData" /> 141 141 <nodes> -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HiveDataContext.designer.cs
r5266 r5375 55 55 partial void UpdateJobData(JobData instance); 56 56 partial void DeleteJobData(JobData instance); 57 partial void InsertPluginData(PluginData instance); 58 partial void UpdatePluginData(PluginData instance); 59 partial void DeletePluginData(PluginData instance); 57 60 #endregion 58 61 … … 360 363 private EntitySet<RequiredPlugin> _RequiredPlugins; 361 364 365 private EntitySet<PluginData> _PluginData; 366 362 367 #region Extensibility Method Definitions 363 368 partial void OnLoaded(); … … 375 380 { 376 381 this._RequiredPlugins = new EntitySet<RequiredPlugin>(new Action<RequiredPlugin>(this.attach_RequiredPlugins), new Action<RequiredPlugin>(this.detach_RequiredPlugins)); 382 this._PluginData = new EntitySet<PluginData>(new Action<PluginData>(this.attach_PluginData), new Action<PluginData>(this.detach_PluginData)); 377 383 OnCreated(); 378 384 } … … 451 457 } 452 458 459 [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Plugin_PluginData", Storage="_PluginData", ThisKey="PluginId", OtherKey="PluginId")] 460 public EntitySet<PluginData> PluginData 461 { 462 get 463 { 464 return this._PluginData; 465 } 466 set 467 { 468 this._PluginData.Assign(value); 469 } 470 } 471 453 472 public event PropertyChangingEventHandler PropertyChanging; 454 473 … … 478 497 479 498 private void detach_RequiredPlugins(RequiredPlugin entity) 499 { 500 this.SendPropertyChanging(); 501 entity.Plugin = null; 502 } 503 504 private void attach_PluginData(PluginData entity) 505 { 506 this.SendPropertyChanging(); 507 entity.Plugin = this; 508 } 509 510 private void detach_PluginData(PluginData entity) 480 511 { 481 512 this.SendPropertyChanging(); … … 724 755 } 725 756 726 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ResourceId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true , IsDbGenerated=true)]757 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ResourceId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true)] 727 758 public System.Guid ResourceId 728 759 { … … 2386 2417 2387 2418 [global::System.Data.Linq.Mapping.TableAttribute(Name="")] 2388 public partial class PluginData 2419 public partial class PluginData : INotifyPropertyChanging, INotifyPropertyChanged 2389 2420 { 2390 2421 2422 private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty); 2423 2391 2424 private System.Guid _PluginId; 2392 2425 … … 2395 2428 private string _FileName; 2396 2429 2430 private int _PluginDataId; 2431 2432 private EntityRef<Plugin> _Plugin; 2433 2434 #region Extensibility Method Definitions 2435 partial void OnLoaded(); 2436 partial void OnValidate(System.Data.Linq.ChangeAction action); 2437 partial void OnCreated(); 2438 partial void OnPluginIdChanging(System.Guid value); 2439 partial void OnPluginIdChanged(); 2440 partial void OnDataChanging(System.Data.Linq.Binary value); 2441 partial void OnDataChanged(); 2442 partial void OnFileNameChanging(string value); 2443 partial void OnFileNameChanged(); 2444 partial void OnPluginDataIdChanging(int value); 2445 partial void OnPluginDataIdChanged(); 2446 #endregion 2447 2397 2448 public PluginData() 2398 2449 { 2450 this._Plugin = default(EntityRef<Plugin>); 2451 OnCreated(); 2399 2452 } 2400 2453 … … 2410 2463 if ((this._PluginId != value)) 2411 2464 { 2465 if (this._Plugin.HasLoadedOrAssignedValue) 2466 { 2467 throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException(); 2468 } 2469 this.OnPluginIdChanging(value); 2470 this.SendPropertyChanging(); 2412 2471 this._PluginId = value; 2472 this.SendPropertyChanged("PluginId"); 2473 this.OnPluginIdChanged(); 2413 2474 } 2414 2475 } … … 2426 2487 if ((this._Data != value)) 2427 2488 { 2489 this.OnDataChanging(value); 2490 this.SendPropertyChanging(); 2428 2491 this._Data = value; 2492 this.SendPropertyChanged("Data"); 2493 this.OnDataChanged(); 2429 2494 } 2430 2495 } … … 2442 2507 if ((this._FileName != value)) 2443 2508 { 2509 this.OnFileNameChanging(value); 2510 this.SendPropertyChanging(); 2444 2511 this._FileName = value; 2445 } 2512 this.SendPropertyChanged("FileName"); 2513 this.OnFileNameChanged(); 2514 } 2515 } 2516 } 2517 2518 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PluginDataId", AutoSync=AutoSync.OnInsert, DbType="Int IDENTITY(1,1)", IsPrimaryKey=true, IsDbGenerated=true)] 2519 public int PluginDataId 2520 { 2521 get 2522 { 2523 return this._PluginDataId; 2524 } 2525 set 2526 { 2527 if ((this._PluginDataId != value)) 2528 { 2529 this.OnPluginDataIdChanging(value); 2530 this.SendPropertyChanging(); 2531 this._PluginDataId = value; 2532 this.SendPropertyChanged("PluginDataId"); 2533 this.OnPluginDataIdChanged(); 2534 } 2535 } 2536 } 2537 2538 [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Plugin_PluginData", Storage="_Plugin", ThisKey="PluginId", OtherKey="PluginId", IsForeignKey=true)] 2539 public Plugin Plugin 2540 { 2541 get 2542 { 2543 return this._Plugin.Entity; 2544 } 2545 set 2546 { 2547 Plugin previousValue = this._Plugin.Entity; 2548 if (((previousValue != value) 2549 || (this._Plugin.HasLoadedOrAssignedValue == false))) 2550 { 2551 this.SendPropertyChanging(); 2552 if ((previousValue != null)) 2553 { 2554 this._Plugin.Entity = null; 2555 previousValue.PluginData.Remove(this); 2556 } 2557 this._Plugin.Entity = value; 2558 if ((value != null)) 2559 { 2560 value.PluginData.Add(this); 2561 this._PluginId = value.PluginId; 2562 } 2563 else 2564 { 2565 this._PluginId = default(System.Guid); 2566 } 2567 this.SendPropertyChanged("Plugin"); 2568 } 2569 } 2570 } 2571 2572 public event PropertyChangingEventHandler PropertyChanging; 2573 2574 public event PropertyChangedEventHandler PropertyChanged; 2575 2576 protected virtual void SendPropertyChanging() 2577 { 2578 if ((this.PropertyChanging != null)) 2579 { 2580 this.PropertyChanging(this, emptyChangingEventArgs); 2581 } 2582 } 2583 2584 protected virtual void SendPropertyChanged(String propertyName) 2585 { 2586 if ((this.PropertyChanged != null)) 2587 { 2588 this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); 2446 2589 } 2447 2590 } -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Web/Hive-3.4/App_Code/HiveServerModule.cs
r5364 r5375 35 35 36 36 public void Init(HttpApplication context) { 37 if (hiveService == null)38 hiveService = new HiveService();39 40 37 if (lifecycleManager == null) 41 38 lifecycleManager = new LifecycleManager(); -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4/HiveService.cs
r5155 r5375 2 2 using System.Collections.Generic; 3 3 using System.Linq; 4 using System.Text;5 4 using System.ServiceModel; 5 using HeuristicLab.Services.Hive.Common; 6 using HeuristicLab.Services.Hive.Common.DataTransfer; 6 7 using HeuristicLab.Services.Hive.Common.ServiceContracts; 7 using HeuristicLab.Services.Hive.Common.DataTransfer;8 using System.IO;9 using System.Security.Permissions;10 using System.Data.Linq;11 using HeuristicLab.Services.Hive.Common;12 using System.Transactions;13 8 14 9 namespace HeuristicLab.Services.Hive { … … 121 116 122 117 public PluginData GetConfigurationFile() { 123 throw new NotImplementedException(); 118 using (trans.OpenTransaction()) { 119 //TODO: move filename to app.config 120 PluginData configFile = dao.GetPluginDatas(x => x.FileName == "HeuristicLab 3.3.exe.config").SingleOrDefault(); 121 if (configFile == null) { 122 //TODO: error handling 123 return null; 124 } else { 125 return configFile; 126 } 127 } 124 128 } 125 129 … … 173 177 #region Login Methods 174 178 public void Hello(Guid slaveId, string name, int cores, int memory) { 175 throw new NotImplementedException(); 176 } 177 178 public void GoodBye() { 179 throw new NotImplementedException(); 179 using (trans.OpenTransaction()) { 180 var slave = dao.GetSlave(slaveId); 181 182 if (slave == null) { 183 slave = new Slave { Id = slaveId, Name = name, Cores = cores, Memory = memory }; 184 slave.IsAllowedToCalculate = true; //a little bit to optimistic? 185 slave.SlaveState = SlaveState.Idle; 186 dao.AddSlave(slave); 187 } else { 188 //TODO: error handling? 189 } 190 } 191 } 192 193 public void GoodBye(Guid slaveId) { 194 using (trans.OpenTransaction()) { 195 var slave = dao.GetSlave(slaveId); 196 if (slave != null) { 197 slave.SlaveState = SlaveState.Offline; 198 dao.UpdateSlave(slave); 199 } 200 } 180 201 } 181 202 #endregion … … 203 224 return dao.GetPlugins(x => true); 204 225 } 226 205 227 public IEnumerable<PluginData> GetPluginDatas(List<Guid> pluginIds) { 206 throw new NotImplementedException(); 207 } 208 public Stream GetStreamedPluginDatas(List<Guid> pluginIds) { 209 throw new NotImplementedException(); 210 } 228 List<PluginData> pluginDatas = new List<PluginData>(); 229 230 using (trans.OpenTransaction()) { 231 foreach (Guid guid in pluginIds) { 232 List<PluginData> pluginData = dao.GetPluginDatas(x => x.PluginId == guid).ToList(); 233 if (pluginData != null) { 234 pluginDatas.AddRange(pluginData); 235 } else { 236 //ignore ? 237 } 238 } 239 return pluginDatas; 240 } 241 } 242 211 243 #endregion 212 244 … … 301 333 302 334 #endregion 303 335 304 336 } 305 337 }
Note: See TracChangeset
for help on using the changeset viewer.