Changeset 7142
- Timestamp:
- 12/06/11 19:21:45 (13 years ago)
- Location:
- trunk/sources/HeuristicLab.Clients.Hive/3.3
- Files:
-
- 6 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Clients.Hive/3.3/HeuristicLab.Clients.Hive-3.3.csproj
r7133 r7142 167 167 <Compile Include="ServiceClients\Heartbeat.cs" /> 168 168 <Compile Include="ServiceClients\HiveItem.cs" /> 169 <Compile Include="ServiceClients\ JobData.cs" />169 <Compile Include="ServiceClients\TaskData.cs" /> 170 170 <Compile Include="ServiceClients\Plugin.cs" /> 171 171 <Compile Include="ServiceClients\PluginData.cs" /> -
trunk/sources/HeuristicLab.Clients.Hive/3.3/HiveJobs/EngineHiveTask.cs
r6976 r7142 55 55 IEnumerable<Type> usedTypes; 56 56 57 // clone operation and remove unnecessary scopes; don't do this earlier to avoid memory problems 58 //lock (locker) { 59 ((IAtomicOperation)ItemTask.InitialOperation).Scope.Parent = parentScopeClone; 60 ItemTask.InitialOperation = (IOperation)ItemTask.InitialOperation.Clone(); 61 ((IAtomicOperation)ItemTask.InitialOperation).Scope.ClearParentScopes(); 62 jobData.Data = PersistenceUtil.Serialize(ItemTask, out usedTypes); 63 //} 57 // clone operation and remove unnecessary scopes; don't do this earlier to avoid memory problems 58 ((IAtomicOperation)ItemTask.InitialOperation).Scope.Parent = parentScopeClone; 59 ItemTask.InitialOperation = (IOperation)ItemTask.InitialOperation.Clone(); 60 ((IAtomicOperation)ItemTask.InitialOperation).Scope.ClearParentScopes(); 61 jobData.Data = PersistenceUtil.Serialize(ItemTask, out usedTypes); 64 62 65 63 // add type objects from object graph to work around ticket #1527 … … 68 66 69 67 PluginUtil.CollectDeclaringPlugins(plugins, usedTypes); 70 68 71 69 return jobData; 72 70 } -
trunk/sources/HeuristicLab.Clients.Hive/3.3/HiveJobs/OptimizerHiveTask.cs
r7125 r7142 354 354 int idx = run.Name.IndexOf("Run ") + 4; 355 355 356 if (idx == -1|| runs.Count == 0)356 if (idx == 3 || runs.Count == 0) 357 357 return run.Name; 358 358 … … 371 371 private static int GetRunNumber(string runName) { 372 372 int idx = runName.IndexOf("Run ") + 4; 373 if (idx == -1) {373 if (idx == 3) { 374 374 return 0; 375 375 } else { -
trunk/sources/HeuristicLab.Clients.Hive/3.3/HiveServiceLocator.cs
r7132 r7142 33 33 return instance; 34 34 } 35 set {36 instance = value;37 }38 35 } 39 36 … … 56 53 else 57 54 cl = ClientFactory.CreateClient<HiveServiceClient, IHiveService>(null, null, username, password); 58 55 59 56 return cl; 60 57 } … … 64 61 try { 65 62 return call(client); 66 } 67 finally { 63 } finally { 68 64 try { 69 65 client.Close(); … … 79 75 try { 80 76 call(client); 81 } 82 finally { 77 } finally { 83 78 try { 84 79 client.Close(); -
trunk/sources/HeuristicLab.Clients.Hive/3.3/JobResultPoller.cs
r7132 r7142 27 27 namespace HeuristicLab.Clients.Hive { 28 28 public class JobResultPoller { 29 private bool stopRequested { get; set; }29 private bool stopRequested; 30 30 private AutoResetEvent waitHandle; 31 31 private Thread thread; … … 96 96 catch (Exception e) { 97 97 OnExceptionOccured(e); 98 } 99 finally { 98 } finally { 100 99 IsPolling = false; 101 100 } -
trunk/sources/HeuristicLab.Clients.Hive/3.3/Util/PersistenceUtil.cs
r6976 r7142 29 29 public static class PersistenceUtil { 30 30 public static byte[] Serialize(object obj, out IEnumerable<Type> types) { 31 MemoryStream memStream = new MemoryStream();32 XmlGenerator.Serialize(obj, memStream, ConfigurationService.Instance.GetConfiguration(new XmlFormat()), false, out types);33 byte[] jobByteArray = memStream.ToArray();34 memStream.Dispose();35 return jobByteArray;31 using (MemoryStream memStream = new MemoryStream()) { 32 XmlGenerator.Serialize(obj, memStream, ConfigurationService.Instance.GetConfiguration(new XmlFormat()), false, out types); 33 byte[] jobByteArray = memStream.ToArray(); 34 return jobByteArray; 35 } 36 36 } 37 37 38 38 public static byte[] Serialize(object obj) { 39 MemoryStream memStream = new MemoryStream();40 XmlGenerator.Serialize(obj, memStream);41 byte[] jobByteArray = memStream.ToArray();42 memStream.Dispose();43 return jobByteArray;39 using (MemoryStream memStream = new MemoryStream()) { 40 XmlGenerator.Serialize(obj, memStream); 41 byte[] jobByteArray = memStream.ToArray(); 42 return jobByteArray; 43 } 44 44 } 45 45 46 46 public static T Deserialize<T>(byte[] sjob) { 47 MemoryStream memStream = new MemoryStream(sjob);48 T job = XmlParser.Deserialize<T>(memStream);49 memStream.Dispose();50 return job;47 using (MemoryStream memStream = new MemoryStream(sjob)) { 48 T job = XmlParser.Deserialize<T>(memStream); 49 return job; 50 } 51 51 } 52 52 }
Note: See TracChangeset
for help on using the changeset viewer.