Changeset 7125
- Timestamp:
- 12/05/11 16:45:27 (13 years ago)
- Location:
- trunk/sources/HeuristicLab.Clients.Hive/3.3
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Clients.Hive/3.3/ConcurrentTaskDownloader.cs
r7115 r7125 78 78 protected Tuple<Task, TaskData> DownloadTaskData(Task task) { 79 79 downloadSemaphore.WaitOne(); 80 deserializeSemaphore.WaitOne();81 80 TaskData result; 82 81 try { … … 90 89 91 90 protected Tuple<Task, T> DeserializeTask(Tuple<Task, TaskData> taskData) { 91 deserializeSemaphore.WaitOne(); 92 92 try { 93 93 if (abort || taskData.Item2 == null || taskData.Item1 == null) return null; -
trunk/sources/HeuristicLab.Clients.Hive/3.3/HiveClient.cs
r7059 r7125 113 113 jobs = null; 114 114 throw; 115 } 116 finally { 115 } finally { 117 116 OnRefreshed(); 118 117 } … … 297 296 } 298 297 refreshableJob.Job.Modified = false; 299 } 300 finally { 298 } finally { 301 299 refreshableJob.IsProgressing = false; 302 300 } … … 362 360 } 363 361 } 364 }, -1, "Failed to upload plugins");362 }, Settings.Default.MaxRepeatServiceCalls, "Failed to upload plugins"); 365 363 cancellationToken.ThrowIfCancellationRequested(); 366 364 hiveTask.Task.PluginsNeededIds.Add(configPluginId); … … 377 375 } 378 376 } 379 }, 50, "Failed to add task", log);377 }, Settings.Default.MaxRepeatServiceCalls, "Failed to add task", log); 380 378 cancellationToken.ThrowIfCancellationRequested(); 381 379 … … 400 398 if (!ae.InnerExceptions.All(e => e is TaskCanceledException)) throw ae; // for some reason the WaitAll throws a AggregateException containg a TaskCanceledException. i don't know where it comes from, however the tasks all finish properly, so for now just ignore it 401 399 } 402 } 403 finally { 400 } finally { 404 401 if (!semaphoreReleased) taskUploadSemaphore.Release(); 405 402 } … … 423 420 totalJobCount = allTasks.Count(); 424 421 422 refreshableJob.Progress.Status = "Downloading tasks..."; 425 423 TaskDownloader downloader = new TaskDownloader(allTasks.Select(x => x.Id)); 426 424 downloader.StartAsync(); … … 445 443 } 446 444 445 refreshableJob.Progress.Status = "Downloading/deserializing complete. Displaying tasks..."; 447 446 // build child-task tree 448 447 foreach (HiveTask hiveTask in refreshableJob.HiveTasks) { … … 451 450 452 451 refreshableJob.OnLoaded(); 453 } 454 finally { 452 } finally { 455 453 refreshableJob.IsProgressing = false; 456 454 } 457 455 } 458 456 459 private static void BuildHiveJobTree(HiveTask parentHive Job, IEnumerable<LightweightTask> allJobs, IDictionary<Guid, HiveTask> allHiveJobs) {460 IEnumerable<LightweightTask> childTasks = from job in all Jobs461 where job.ParentTaskId.HasValue && job.ParentTaskId.Value == parentHive Job.Task.Id457 private static void BuildHiveJobTree(HiveTask parentHiveTask, IEnumerable<LightweightTask> allTasks, IDictionary<Guid, HiveTask> allHiveTasks) { 458 IEnumerable<LightweightTask> childTasks = from job in allTasks 459 where job.ParentTaskId.HasValue && job.ParentTaskId.Value == parentHiveTask.Task.Id 462 460 orderby job.DateCreated ascending 463 461 select job; 464 462 foreach (LightweightTask task in childTasks) { 465 HiveTask childHiveTask = allHive Jobs[task.Id];466 parentHive Job.AddChildHiveJob(childHiveTask);467 BuildHiveJobTree(childHiveTask, all Jobs, allHiveJobs);463 HiveTask childHiveTask = allHiveTasks[task.Id]; 464 parentHiveTask.AddChildHiveTask(childHiveTask); 465 BuildHiveJobTree(childHiveTask, allTasks, allHiveTasks); 468 466 } 469 467 } -
trunk/sources/HeuristicLab.Clients.Hive/3.3/HiveJobs/HiveTask.cs
r6994 r7125 238 238 } 239 239 240 public virtual void AddChildHive Job(HiveTask hiveJob) {240 public virtual void AddChildHiveTask(HiveTask hiveTask) { 241 241 childHiveTasksLock.EnterWriteLock(); 242 242 try { 243 this.childHiveTasks.Add(hive Job);243 this.childHiveTasks.Add(hiveTask); 244 244 } 245 245 finally { childHiveTasksLock.ExitWriteLock(); } -
trunk/sources/HeuristicLab.Clients.Hive/3.3/HiveJobs/OptimizerHiveTask.cs
r6976 r7125 136 136 } 137 137 } 138 } 139 finally { childHiveTasksLock.ExitWriteLock(); } 138 } finally { childHiveTasksLock.ExitWriteLock(); } 140 139 } 141 140 } … … 152 151 } 153 152 } 154 } 155 finally { childHiveTasksLock.ExitWriteLock(); } 153 } finally { childHiveTasksLock.ExitWriteLock(); } 156 154 } 157 155 } … … 163 161 this.childHiveTasks.Remove(this.GetChildByOptimizer(item.Value)); 164 162 } 165 } 166 finally { childHiveTasksLock.ExitWriteLock(); } 163 } finally { childHiveTasksLock.ExitWriteLock(); } 167 164 } 168 165 } … … 174 171 this.childHiveTasks.Remove(this.GetChildByOptimizer(item.Value)); 175 172 } 176 } 177 finally { childHiveTasksLock.ExitWriteLock(); } 173 } finally { childHiveTasksLock.ExitWriteLock(); } 178 174 } 179 175 } … … 205 201 child.syncTasksWithOptimizers = true; 206 202 } 207 } 208 finally { childHiveTasksLock.ExitReadLock(); } 203 } finally { childHiveTasksLock.ExitReadLock(); } 209 204 syncTasksWithOptimizers = true; 210 205 } … … 268 263 child.SetIndexInParentOptimizerList(this); 269 264 } 270 } 271 finally { childHiveTasksLock.ExitReadLock(); } 272 } 273 274 public override void AddChildHiveJob(HiveTask hiveJob) { 275 base.AddChildHiveJob(hiveJob); 276 var optimizerHiveJob = (OptimizerHiveTask)hiveJob; 265 } finally { childHiveTasksLock.ExitReadLock(); } 266 } 267 268 public override void AddChildHiveTask(HiveTask hiveTask) { 269 base.AddChildHiveTask(hiveTask); 270 var optimizerHiveJob = (OptimizerHiveTask)hiveTask; 277 271 syncTasksWithOptimizers = false; 278 272 if (this.ItemTask != null && optimizerHiveJob.ItemTask != null) { … … 339 333 } 340 334 return null; 341 } 342 finally { childHiveTasksLock.ExitReadLock(); } 335 } finally { childHiveTasksLock.ExitReadLock(); } 343 336 } 344 337 … … 351 344 } 352 345 return null; 353 } 354 finally { childHiveTasksLock.ExitReadLock(); } 346 } finally { childHiveTasksLock.ExitReadLock(); } 355 347 } 356 348 -
trunk/sources/HeuristicLab.Clients.Hive/3.3/Settings.Designer.cs
r7020 r7125 44 44 [global::System.Configuration.ApplicationScopedSettingAttribute()] 45 45 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 46 [global::System.Configuration.DefaultSettingValueAttribute("00:00: 10")]46 [global::System.Configuration.DefaultSettingValueAttribute("00:00:20")] 47 47 public global::System.TimeSpan ResultPollingInterval { 48 48 get { … … 53 53 [global::System.Configuration.ApplicationScopedSettingAttribute()] 54 54 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 55 [global::System.Configuration.DefaultSettingValueAttribute(" 2")]55 [global::System.Configuration.DefaultSettingValueAttribute("5")] 56 56 public int MaxParallelDownloads { 57 57 get { … … 59 59 } 60 60 } 61 62 [global::System.Configuration.ApplicationScopedSettingAttribute()] 63 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 64 [global::System.Configuration.DefaultSettingValueAttribute("5")] 65 public int MaxRepeatServiceCalls { 66 get { 67 return ((int)(this["MaxRepeatServiceCalls"])); 68 } 69 } 61 70 } 62 71 } -
trunk/sources/HeuristicLab.Clients.Hive/3.3/Settings.settings
r7020 r7125 10 10 </Setting> 11 11 <Setting Name="ResultPollingInterval" Type="System.TimeSpan" Scope="Application"> 12 <Value Profile="(Default)">00:00: 10</Value>12 <Value Profile="(Default)">00:00:20</Value> 13 13 </Setting> 14 14 <Setting Name="MaxParallelDownloads" Type="System.Int32" Scope="Application"> 15 <Value Profile="(Default)">2</Value> 15 <Value Profile="(Default)">5</Value> 16 </Setting> 17 <Setting Name="MaxRepeatServiceCalls" Type="System.Int32" Scope="Application"> 18 <Value Profile="(Default)">5</Value> 16 19 </Setting> 17 20 </Settings> -
trunk/sources/HeuristicLab.Clients.Hive/3.3/app.config
r7020 r7125 15 15 </setting> 16 16 <setting name="ResultPollingInterval" serializeAs="String"> 17 <value>00:00: 10</value>17 <value>00:00:20</value> 18 18 </setting> 19 19 <setting name="MaxParallelDownloads" serializeAs="String"> 20 <value>2</value> 20 <value>5</value> 21 </setting> 22 <setting name="MaxRepeatServiceCalls" serializeAs="String"> 23 <value>5</value> 21 24 </setting> 22 25 </HeuristicLab.Clients.Hive.Settings>
Note: See TracChangeset
for help on using the changeset viewer.