- Timestamp:
- 09/25/15 14:39:59 (9 years ago)
- Location:
- branches/gteufl
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/gteufl
- Property svn:ignore
-
old new 8 8 FxCopResults.txt 9 9 Google.ProtocolBuffers-0.9.1.dll 10 Google.ProtocolBuffers-2.4.1.473.dll 10 11 HeuristicLab 3.3.5.1.ReSharper.user 11 12 HeuristicLab 3.3.6.0.ReSharper.user 12 13 HeuristicLab.4.5.resharper.user 13 14 HeuristicLab.ExtLibs.6.0.ReSharper.user 15 HeuristicLab.Scripting.Development 14 16 HeuristicLab.resharper.user 15 17 ProtoGen.exe … … 17 19 _ReSharper.HeuristicLab 18 20 _ReSharper.HeuristicLab 3.3 21 _ReSharper.HeuristicLab 3.3 Tests 19 22 _ReSharper.HeuristicLab.ExtLibs 20 23 bin 21 24 protoc.exe 22 _ReSharper.HeuristicLab 3.3 Tests 23 Google.ProtocolBuffers-2.4.1.473.dll 25 obj
-
- Property svn:mergeinfo changed
-
Property
svn:global-ignores
set to
*.nuget
packages
- Property svn:ignore
-
branches/gteufl/HeuristicLab.Clients.Hive/3.3/HiveClient.cs
r10150 r12969 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 3Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 68 68 set { alreadyUploadedPlugins = value; } 69 69 } 70 71 private bool isAllowedPrivileged; 72 public bool IsAllowedPrivileged { 73 get { return isAllowedPrivileged; } 74 set { isAllowedPrivileged = value; } 75 } 76 #endregion 77 78 private HiveClient() { 79 //this will never be deregistered 80 TaskScheduler.UnobservedTaskException += new EventHandler<UnobservedTaskExceptionEventArgs>(TaskScheduler_UnobservedTaskException); 81 } 82 83 private void TaskScheduler_UnobservedTaskException(object sender, UnobservedTaskExceptionEventArgs e) { 84 e.SetObserved(); // avoid crash of process because task crashes. first exception found is handled in Results property 85 throw new HiveException("Unobserved Exception in ConcurrentTaskDownloader", e.Exception); 86 } 70 #endregion 71 72 private HiveClient() { } 87 73 88 74 public void ClearHiveClient() { … … 107 93 108 94 try { 109 IsAllowedPrivileged = HiveServiceLocator.Instance.CallHiveService((s) => s.IsAllowedPrivileged());110 111 95 jobs = new HiveItemCollection<RefreshableJob>(); 112 96 var jobsLoaded = HiveServiceLocator.Instance.CallHiveService<IEnumerable<Job>>(s => s.GetJobs()); … … 283 267 refreshableJob.Progress.Status = "Uploading Job..."; 284 268 refreshableJob.Job.Id = HiveServiceLocator.Instance.CallHiveService((s) => s.AddJob(refreshableJob.Job)); 285 bool isPrivileged = refreshableJob.Job.IsPrivileged;286 269 refreshableJob.Job = HiveServiceLocator.Instance.CallHiveService((s) => s.GetJob(refreshableJob.Job.Id)); // update owner and permissions 287 refreshableJob.Job.IsPrivileged = isPrivileged;288 270 cancellationToken.ThrowIfCancellationRequested(); 289 271 … … 306 288 foreach (HiveTask hiveTask in refreshableJob.HiveTasks) { 307 289 var task = TS.Task.Factory.StartNew((hj) => { 308 UploadTaskWithChildren(refreshableJob.Progress, (HiveTask)hj, null, resourceIds, jobCount, totalJobCount, configFilePlugin.Id, refreshableJob.Job.Id, refreshableJob.Log, refreshableJob.Job.IsPrivileged,cancellationToken);290 UploadTaskWithChildren(refreshableJob.Progress, (HiveTask)hj, null, resourceIds, jobCount, totalJobCount, configFilePlugin.Id, refreshableJob.Job.Id, refreshableJob.Log, cancellationToken); 309 291 }, hiveTask); 310 292 task.ContinueWith((x) => refreshableJob.Log.LogException(x.Exception), TaskContinuationOptions.OnlyOnFaulted); … … 351 333 /// </summary> 352 334 /// <param name="parentHiveTask">shall be null if its the root task</param> 353 private void UploadTaskWithChildren(IProgress progress, HiveTask hiveTask, HiveTask parentHiveTask, IEnumerable<Guid> groups, int[] taskCount, int totalJobCount, Guid configPluginId, Guid jobId, ILog log, bool isPrivileged,CancellationToken cancellationToken) {335 private void UploadTaskWithChildren(IProgress progress, HiveTask hiveTask, HiveTask parentHiveTask, IEnumerable<Guid> groups, int[] taskCount, int totalJobCount, Guid configPluginId, Guid jobId, ILog log, CancellationToken cancellationToken) { 354 336 taskUploadSemaphore.WaitOne(); 355 337 bool semaphoreReleased = false; … … 383 365 hiveTask.Task.PluginsNeededIds.Add(configPluginId); 384 366 hiveTask.Task.JobId = jobId; 385 hiveTask.Task.IsPrivileged = isPrivileged;386 367 387 368 log.LogMessage(string.Format("Uploading task ({0} kb, {1} objects)", taskData.Data.Count() / 1024, hiveTask.ItemTask.GetObjectGraphObjects().Count())); … … 406 387 var task = TS.Task.Factory.StartNew((tuple) => { 407 388 var arguments = (Tuple<HiveTask, HiveTask>)tuple; 408 UploadTaskWithChildren(progress, arguments.Item1, arguments.Item2, groups, taskCount, totalJobCount, configPluginId, jobId, log, isPrivileged,cancellationToken);389 UploadTaskWithChildren(progress, arguments.Item1, arguments.Item2, groups, taskCount, totalJobCount, configPluginId, jobId, log, cancellationToken); 409 390 }, new Tuple<HiveTask, HiveTask>(child, hiveTask)); 410 391 task.ContinueWith((x) => log.LogException(x.Exception), TaskContinuationOptions.OnlyOnFaulted); … … 450 431 IDictionary<Guid, HiveTask> allHiveTasks = downloader.Results; 451 432 var parents = allHiveTasks.Values.Where(x => !x.Task.ParentTaskId.HasValue); 452 refreshableJob.Job.IsPrivileged = allHiveTasks.Any(x => x.Value.Task.IsPrivileged);453 433 454 434 refreshableJob.Progress.Status = "Downloading/deserializing complete. Displaying tasks...";
Note: See TracChangeset
for help on using the changeset viewer.