Changeset 17062 for stable/HeuristicLab.Clients.Hive
- Timestamp:
- 07/04/19 14:45:47 (5 years ago)
- Location:
- stable
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Clients.Hive
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Clients.Hive merged: 16356,16389,16430
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Clients.Hive/3.3/HeuristicLab.Clients.Hive-3.3.csproj
r17059 r17062 236 236 <Private>False</Private> 237 237 </ProjectReference> 238 <ProjectReference Include="..\..\HeuristicLab.MainForm.WindowsForms\3.3\HeuristicLab.MainForm.WindowsForms-3.3.csproj"> 239 <Project>{AB687BBE-1BFE-476B-906D-44237135431D}</Project> 240 <Name>HeuristicLab.MainForm.WindowsForms-3.3</Name> 241 <Private>False</Private> 242 </ProjectReference> 238 243 <ProjectReference Include="..\..\HeuristicLab.MainForm\3.3\HeuristicLab.MainForm-3.3.csproj"> 239 244 <Project>{3BD61258-31DA-4B09-89C0-4F71FEF5F05A}</Project> -
stable/HeuristicLab.Clients.Hive/3.3/HiveClient.cs
r17059 r17062 167 167 RefreshDisabledParentProjects(); 168 168 RefreshDisabledParentResources(); 169 } 170 catch { 169 } catch { 171 170 jobs = null; 172 171 projects = null; 173 172 resources = null; 174 173 throw; 175 } 176 finally { 174 } finally { 177 175 OnRefreshed(); 178 176 } … … 215 213 216 214 public void RefreshAsync(Action<Exception> exceptionCallback) { 217 var call = new Func<Exception>(delegate () {215 var call = new Func<Exception>(delegate () { 218 216 try { 219 217 Refresh(); 220 } 221 catch (Exception ex) { 218 } catch (Exception ex) { 222 219 return ex; 223 220 } 224 221 return null; 225 222 }); 226 call.BeginInvoke(delegate (IAsyncResult result) {223 call.BeginInvoke(delegate (IAsyncResult result) { 227 224 Exception ex = call.EndInvoke(result); 228 225 if (ex != null) exceptionCallback(ex); … … 244 241 resourceAncestors.Keys.ToList().ForEach(k => resourceDescendants.Add(k, new HashSet<Guid>())); 245 242 foreach (var ra in resourceAncestors) { 246 foreach (var ancestor in ra.Value) {243 foreach (var ancestor in ra.Value) { 247 244 resourceDescendants[ancestor].Add(ra.Key); 248 245 } … … 263 260 // build project descendant list 264 261 projectAncestors.Keys.ToList().ForEach(k => projectDescendants.Add(k, new HashSet<Guid>())); 265 foreach (var pa in projectAncestors) {266 foreach (var ancestor in pa.Value) {262 foreach (var pa in projectAncestors) { 263 foreach (var ancestor in pa.Value) { 267 264 projectDescendants[ancestor].Add(pa.Key); 268 265 } … … 362 359 } 363 360 public static void StoreAsync(Action<Exception> exceptionCallback, IHiveItem item, CancellationToken cancellationToken) { 364 var call = new Func<Exception>(delegate () {361 var call = new Func<Exception>(delegate () { 365 362 try { 366 363 Store(item, cancellationToken); 367 } 368 catch (Exception ex) { 364 } catch (Exception ex) { 369 365 return ex; 370 366 } 371 367 return null; 372 368 }); 373 call.BeginInvoke(delegate (IAsyncResult result) {369 call.BeginInvoke(delegate (IAsyncResult result) { 374 370 Exception ex = call.EndInvoke(result); 375 371 if (ex != null) exceptionCallback(ex); … … 460 456 public static void UpdateJob(Action<Exception> exceptionCallback, RefreshableJob refreshableJob, CancellationToken cancellationToken) { 461 457 refreshableJob.IsProgressing = true; 462 refreshableJob.Progress. Status= "Saving Job...";458 refreshableJob.Progress.Message = "Saving Job..."; 463 459 HiveClient.StoreAsync( 464 460 new Action<Exception>((Exception ex) => { … … 473 469 474 470 try { 475 refreshableJob.Progress.Start("Saving Job..." );471 refreshableJob.Progress.Start("Saving Job...", ProgressMode.Indeterminate); 476 472 HiveClient.StoreAsync(new Action<Exception>((Exception ex) => { 477 473 throw new Exception("Update failed.", ex); … … 492 488 try { 493 489 refreshableJob.IsProgressing = true; 494 refreshableJob.Progress.Start("Connecting to server..." );490 refreshableJob.Progress.Start("Connecting to server...", ProgressMode.Indeterminate); 495 491 496 492 foreach (OptimizerHiveTask hiveJob in refreshableJob.HiveTasks.OfType<OptimizerHiveTask>()) { … … 499 495 500 496 // upload Job 501 refreshableJob.Progress. Status= "Uploading Job...";497 refreshableJob.Progress.Message = "Uploading Job..."; 502 498 refreshableJob.Job.Id = HiveServiceLocator.Instance.CallHiveService((s) => s.AddJob(refreshableJob.Job, refreshableJob.Job.ResourceIds)); 503 499 refreshableJob.Job = HiveServiceLocator.Instance.CallHiveService((s) => s.GetJob(refreshableJob.Job.Id)); // update owner and permissions … … 509 505 510 506 // upload plugins 511 refreshableJob.Progress. Status= "Uploading plugins...";507 refreshableJob.Progress.Message = "Uploading plugins..."; 512 508 this.OnlinePlugins = HiveServiceLocator.Instance.CallHiveService((s) => s.GetPlugins()); 513 509 this.AlreadyUploadedPlugins = new List<Plugin>(); … … 517 513 518 514 // upload tasks 519 refreshableJob.Progress.Status = "Uploading tasks..."; 515 refreshableJob.Progress.Message = "Uploading tasks..."; 516 refreshableJob.Progress.ProgressMode = ProgressMode.Determinate; 517 refreshableJob.Progress.ProgressValue = 0; 520 518 521 519 var tasks = new List<TS.Task>(); … … 528 526 } 529 527 TS.Task.WaitAll(tasks.ToArray()); 530 } 531 finally { 528 } finally { 532 529 refreshableJob.Job.Modified = false; 533 530 refreshableJob.IsProgressing = false; … … 615 612 lock (jobCountLocker) { 616 613 progress.ProgressValue = (double)taskCount[0] / totalJobCount; 617 progress. Status= string.Format("Uploaded task ({0} of {1})", taskCount[0], totalJobCount);614 progress.Message = string.Format("Uploaded task ({0} of {1})", taskCount[0], totalJobCount); 618 615 } 619 616 … … 646 643 647 644 // fetch all task objects to create the full tree of tree of HiveTask objects 648 refreshableJob.Progress.Start("Downloading list of tasks..." );645 refreshableJob.Progress.Start("Downloading list of tasks...", ProgressMode.Indeterminate); 649 646 allTasks = HiveServiceLocator.Instance.CallHiveService(s => s.GetLightweightJobTasksWithoutStateLog(hiveExperiment.Id)); 650 647 totalJobCount = allTasks.Count(); 651 648 652 refreshableJob.Progress.Status = "Downloading tasks..."; 649 refreshableJob.Progress.Message = "Downloading tasks..."; 650 refreshableJob.Progress.ProgressMode = ProgressMode.Determinate; 651 refreshableJob.Progress.ProgressValue = 0.0; 653 652 downloader = new TaskDownloader(allTasks.Select(x => x.Id)); 654 653 downloader.StartAsync(); … … 656 655 while (!downloader.IsFinished) { 657 656 refreshableJob.Progress.ProgressValue = downloader.FinishedCount / (double)totalJobCount; 658 refreshableJob.Progress. Status= string.Format("Downloading/deserializing tasks... ({0}/{1} finished)", downloader.FinishedCount, totalJobCount);657 refreshableJob.Progress.Message = string.Format("Downloading/deserializing tasks... ({0}/{1} finished)", downloader.FinishedCount, totalJobCount); 659 658 Thread.Sleep(500); 660 659 … … 666 665 var parents = allHiveTasks.Values.Where(x => !x.Task.ParentTaskId.HasValue); 667 666 668 refreshableJob.Progress.Status = "Downloading/deserializing complete. Displaying tasks..."; 667 refreshableJob.Progress.Message = "Downloading/deserializing complete. Displaying tasks..."; 668 refreshableJob.Progress.ProgressMode = ProgressMode.Indeterminate; 669 669 670 // build child-task tree 670 671 foreach (HiveTask hiveTask in parents) { … … 677 678 } else if (refreshableJob.IsPaused()) { 678 679 refreshableJob.ExecutionState = Core.ExecutionState.Paused; 679 } else { 680 } else { 680 681 refreshableJob.ExecutionState = Core.ExecutionState.Started; 681 682 } 682 683 refreshableJob.OnLoaded(); 683 } 684 finally { 684 } finally { 685 685 refreshableJob.IsProgressing = false; 686 686 refreshableJob.Progress.Finish(); … … 719 719 try { 720 720 return PersistenceUtil.Deserialize<ItemTask>(taskData.Data); 721 } 722 catch { 721 } catch { 723 722 return null; 724 723 } … … 731 730 public static void TryAndRepeat(Action action, int repetitions, string errorMessage, ILog log = null) { 732 731 while (true) { 733 try { action(); return; } 734 catch (Exception e) { 732 try { action(); return; } catch (Exception e) { 735 733 if (repetitions == 0) throw new HiveException(errorMessage, e); 736 734 if (log != null) log.LogMessage(string.Format("{0}: {1} - will try again!", errorMessage, e.ToString())); -
stable/HeuristicLab.Clients.Hive/3.3/Plugin.cs.frame
r17059 r17062 37 37 [PluginDependency("HeuristicLab.Hive", "3.3")] 38 38 [PluginDependency("HeuristicLab.MainForm", "3.3")] 39 [PluginDependency("HeuristicLab.MainForm.WindowsForms", "3.3")] 39 40 [PluginDependency("HeuristicLab.Optimization", "3.3")] 40 41 [PluginDependency("HeuristicLab.Persistence", "3.3")]
Note: See TracChangeset
for help on using the changeset viewer.