- Timestamp:
- 04/11/11 15:32:27 (14 years ago)
- Location:
- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.HiveEngine/3.4
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.HiveEngine/3.4
-
Property
svn:ignore
set to
bin
obj
HeuristicLab.HiveEngine-3.4.csproj.vs10x
-
Property
svn:ignore
set to
-
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.HiveEngine/3.4/HiveEngine.cs
r5958 r6000 46 46 } 47 47 48 private IEnumerable<Plugin> onlinePlugins;49 public IEnumerable<Plugin> OnlinePlugins {48 private List<Plugin> onlinePlugins; 49 public List<Plugin> OnlinePlugins { 50 50 get { return onlinePlugins; } 51 51 set { onlinePlugins = value; } 52 52 } 53 53 54 54 private List<Plugin> alreadyUploadedPlugins; 55 55 public List<Plugin> AlreadyUploadedPlugins { … … 102 102 TaskScheduler.UnobservedTaskException += new EventHandler<UnobservedTaskExceptionEventArgs>(TaskScheduler_UnobservedTaskException); 103 103 104 this.OnlinePlugins = ServiceLocator.Instance.CallHiveService(s => s.GetPlugins()) ;104 this.OnlinePlugins = ServiceLocator.Instance.CallHiveService(s => s.GetPlugins()).Where(x => x.IsLocal == false).ToList(); 105 105 this.AlreadyUploadedPlugins = new List<Plugin>(); 106 106 … … 123 123 124 124 IScope[] scopes = ExecuteOnHive(jobs, parentScopeClone, cancellationToken); 125 125 //IScope[] scopes = ExecuteLocally(jobs, parentScopeClone, cancellationToken); 126 126 127 for (int i = 0; i < coll.Count; i++) { 127 128 if (coll[i] is IAtomicOperation) { … … 183 184 target.SubScopes.AddRange(source.SubScopes); 184 185 // TODO: validate if parent scopes match - otherwise source is invalid 186 } 187 188 private IScope[] ExecuteLocally(EngineJob[] jobs, IScope parentScopeClone, CancellationToken cancellationToken) { 189 IScope[] scopes = new Scope[jobs.Length]; 190 191 for (int i = 0; i < jobs.Length; i++) { 192 var job = (EngineJob)jobs[i].Clone(); 193 job.Start(); 194 while (job.ExecutionState != ExecutionState.Stopped) { 195 Thread.Sleep(100); 196 } 197 scopes[i] = ((IAtomicOperation)job.InitialOperation).Scope; 198 } 199 200 return scopes; 185 201 } 186 202 … … 444 460 /// </summary> 445 461 private static void TryAndRepeat(Action action, int repetitions, string errorMessage) { 446 while (repetitions > 0) { 447 try { action(); } 448 catch (Exception e) { 449 repetitions--; 450 if (repetitions == 0) { 451 throw new HiveEngineException(errorMessage, e); 452 } 453 } 454 } 455 } 456 457 private static void TryAndRepeat(Action action) { 458 TryAndRepeat(action, -1, string.Empty); 462 try { action(); } 463 catch (Exception e) { 464 repetitions--; 465 if (repetitions <= 0) 466 throw new HiveEngineException(errorMessage, e); 467 TryAndRepeat(action, repetitions, errorMessage); 468 } 459 469 } 460 470 }
Note: See TracChangeset
for help on using the changeset viewer.