Changeset 4141 for branches/3.3-HiveMigration/sources
- Timestamp:
- 08/04/10 10:44:14 (14 years ago)
- Location:
- branches/3.3-HiveMigration/sources/HeuristicLab.Hive
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Client.Core/3.3/Core.cs
r4119 r4141 46 46 using HeuristicLab.Tracing; 47 47 using HeuristicLab.Core; 48 using System.IO; 48 49 49 50 namespace HeuristicLab.Hive.Client.Core { … … 134 135 135 136 case MessageContainer.MessageType.JobAborted: 136 //todo: thread this 137 lock (engines) { 138 Guid jobId = new Guid(container.JobId.ToString()); 139 if (engines.ContainsKey(jobId)) { 140 appDomains[jobId].UnhandledException -= new UnhandledExceptionEventHandler(appDomain_UnhandledException); 141 AppDomain.Unload(appDomains[jobId]); 142 appDomains.Remove(jobId); 143 engines.Remove(jobId); 144 jobs.Remove(jobId); 145 GC.Collect(); 146 } else 147 Logger.Error("JobAbort: Engine doesn't exist"); 148 } 137 Guid jobId = new Guid(container.JobId.ToString()); 138 KillAppDomain(jobId); 149 139 break; 150 140 … … 247 237 if (WcfService.Instance.ConnState == NetworkEnum.WcfConnState.Loggedin) { 248 238 Logger.Info("Sending the finished job with id: " + jId); 249 wcfService.StoreFinishedJobResultAsync(ConfigManager.Instance.GetClientInfo().Id, jId, sJob, 1.0, null, true);239 wcfService.StoreFinishedJobResultAsync(ConfigManager.Instance.GetClientInfo().Id, jId, sJob, 1.0, engines[jId].CurrentException, true); 250 240 } else { 251 241 Logger.Info("Storing the finished job with id: " + jId + " to hdd"); 252 242 JobStorageManager.PersistObjectToDisc(wcfService.ServerIP, wcfService.ServerPort, jId, sJob); 253 lock (engines) { 254 appDomains[jId].UnhandledException -= new UnhandledExceptionEventHandler(appDomain_UnhandledException); 255 256 //Disposing it 257 engines[jId].Dispose(); 258 259 AppDomain.Unload(appDomains[jId]); 260 Logger.Debug("Unloaded appdomain"); 261 appDomains.Remove(jId); 262 engines.Remove(jId); 263 jobs.Remove(jId); 264 Logger.Debug("Removed job from appDomains, Engines and Jobs"); 265 } 243 KillAppDomain(jId); 266 244 } 267 245 } catch (InvalidStateException ise) { … … 332 310 PluginCache.Instance.PreparePlugins(e.Result.Job.PluginsNeeded); 333 311 312 PluginCache.Instance.CopyPluginsForJob(e.Result.Job.PluginsNeeded, e.Result.Job.Id); 313 334 314 // foreach (CachedHivePluginInfoDto plugininfo in PluginCache.Instance.GetPlugins(e.Result.Job.PluginsNeeded)) 335 315 // files.AddRange(plugininfo.PluginFiles); 336 316 Logger.Debug("Plugins fetched for job " + e.Result.Job.Id); 337 317 try { 338 AppDomain appDomain =339 HeuristicLab.PluginInfrastructure.Sandboxing.SandboxManager.CreateAndInitSandbox(340 e.Result.Job.Id.ToString(), null);318 String pluginDir = Path.Combine(PluginCache.PLUGIN_REPO, e.Result.Job.Id.ToString()); 319 320 AppDomain appDomain = HeuristicLab.PluginInfrastructure.Sandboxing.SandboxManager.CreateAndInitSandbox(pluginDir, null); 341 321 appDomain.UnhandledException += new UnhandledExceptionEventHandler(appDomain_UnhandledException); 342 322 lock (engines) { … … 365 345 CurrentlyFetching = false; 366 346 KillAppDomain(e.Result.Job.Id); 347 wcfService.StoreFinishedJobResultsSync(ConfigManager.Instance.GetClientInfo().Id, e.Result.Job.Id, new byte[] { }, 1, exception, true); 367 348 } 368 349 } else … … 497 478 engines.Remove(id); 498 479 jobs.Remove(id); 480 PluginCache.Instance.DeletePluginsForJob(id); 499 481 GC.Collect(); 500 482 } catch (Exception ex) { -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Client.Core/3.3/PluginCache.cs
r4119 r4141 1 1 using System; 2 2 using System.Collections.Generic; 3 using System.IO; 3 4 using System.Linq; 4 using System.Text; 5 using System.Runtime.CompilerServices; 6 using HeuristicLab.Hive.Client.Communication; 7 using HeuristicLab.Hive.Contracts.BusinessObjects; 5 8 using HeuristicLab.PluginInfrastructure; 6 using HeuristicLab.Hive.Client.Communication; 7 using HeuristicLab.Hive.Client.Common; 8 using HeuristicLab.Hive.Contracts.BusinessObjects; 9 using HeuristicLab.PluginInfrastructure.Manager; 9 10 using HeuristicLab.Tracing; 10 using System.IO;11 11 12 12 namespace HeuristicLab.Hive.Client.Core { … … 14 14 15 15 private static PluginCache instance = null; 16 17 public const string PLUGIN_REPO = @"plugins\"; 18 19 private List<PluginDescription> cachedPlugins = new List<PluginDescription>(); 20 21 private PluginManager pm = new PluginManager(PLUGIN_REPO); 22 16 23 public static PluginCache Instance { 17 24 get { … … 20 27 return instance; 21 28 } 22 } 23 24 private List<CachedHivePluginInfoDto> pluginCache; 25 26 29 } 27 30 public PluginCache() { 28 pluginCache = new List<CachedHivePluginInfoDto>(); 29 } 30 31 public void AddPlugin(CachedHivePluginInfoDto plugin) { 32 pluginCache.Add(plugin); 31 DoUpdateRun(); 33 32 } 34 33 35 public List<CachedHivePluginInfoDto> GetPlugins(List<HivePluginInfoDto> requests) { 34 private void DoUpdateRun() { 35 pm.DiscoverAndCheckPlugins(); 36 cachedPlugins = new List<PluginDescription>(pm.Plugins); 37 } 38 39 40 [MethodImpl(MethodImplOptions.Synchronized)] 41 public bool CopyPluginsForJob(List<HivePluginInfoDto> requests, Guid jobId) { 42 43 String targetDir = PLUGIN_REPO + jobId.ToString() + "\\"; 44 45 if (Directory.Exists(targetDir)) { 46 Directory.Delete(targetDir, true); 47 } 48 49 DirectoryInfo di = Directory.CreateDirectory(targetDir); 50 51 foreach (HivePluginInfoDto requestedPlugin in requests) { 52 PluginDescription pd = 53 cachedPlugins.Where( 54 cp => 55 cp.Name == requestedPlugin.Name && 56 cp.Version.Major == requestedPlugin.Version.Major && 57 cp.Version.Minor == requestedPlugin.Version.Minor && 58 cp.Version.Revision >= requestedPlugin.Version.Revision). 59 SingleOrDefault(); 60 if (pd == null) { 61 return false; 62 } 63 64 foreach (IPluginFile ipf in pd.Files) { 65 File.Copy(ipf.Name, targetDir + ipf.Name.Split('\\').Last()); 66 } 67 } 68 return true; 69 } 70 71 [MethodImpl(MethodImplOptions.Synchronized)] 72 internal void PreparePlugins(List<HivePluginInfoDto> requiredPlugins) { 36 73 Logger.Debug("Fetching plugins for job"); 37 List<CachedHivePluginInfoDto> neededPlugins = new List<CachedHivePluginInfoDto>(); 74 List<HivePluginInfoDto> localPlugins = new List<HivePluginInfoDto>(); 75 List<HivePluginInfoDto> neededPlugins = new List<HivePluginInfoDto>(); 38 76 List<HivePluginInfoDto> missingPlugins = new List<HivePluginInfoDto>(); 39 77 bool found = false; 40 41 foreach (HivePluginInfoDto info in requ ests) {78 79 foreach (HivePluginInfoDto info in requiredPlugins) { 42 80 //we MAY run in problems here - if there is a plugin twice in requests, there may be added two different versions of the plugin 43 foreach ( CachedHivePluginInfoDto cache in pluginCache) {44 if (info.Name.Equals(cache .Name) && info.Version.Equals(cache.Version)) {81 foreach (PluginDescription cachedPlugin in cachedPlugins) { 82 if (info.Name.Equals(cachedPlugin.Name)) { 45 83 Logger.Debug("Found plugin " + info.Name + ", " + info.Version); 46 neededPlugins.Add(cache); 84 localPlugins.Add(new HivePluginInfoDto() { Id = new Guid(), Name = info.Name, Version = info.Version, Update = true }); 85 neededPlugins.Add(info); 47 86 found = true; 87 48 88 break; 49 89 } 50 90 } 51 if (!found) 52 Logger.Debug(" FoundNOT found " + info.Name + ", " + info.Version);91 if (!found) { 92 Logger.Debug("Plugin NOT found " + info.Name + ", " + info.Version); 53 93 missingPlugins.Add(info); 94 } 54 95 found = false; 55 96 } 56 97 57 Logger.Debug("Requesting missing plugins"); 58 List<CachedHivePluginInfoDto> receivedPlugins = WcfService.Instance.RequestPlugins(missingPlugins); 59 Logger.Debug("Requested missing plugins"); 98 Logger.Debug("First run - Update the plugins in the cache"); 60 99 61 if (receivedPlugins != null) { 62 neededPlugins.AddRange(receivedPlugins); 63 pluginCache.AddRange(receivedPlugins); 64 } else 65 Logger.Error("Fetching of the plugins failed!"); 100 localPlugins.AddRange(missingPlugins); 66 101 67 return neededPlugins; 102 List<CachedHivePluginInfoDto> updateablePlugins = WcfService.Instance.RequestPlugins(localPlugins); 103 104 foreach (CachedHivePluginInfoDto updateablePlugin in updateablePlugins) { 105 PluginDescription pd = 106 cachedPlugins.Where(cachedPlugin => cachedPlugin.Name.Equals(updateablePlugin.Name)).SingleOrDefault(); 107 108 if (pd != null) { 109 Logger.Debug("deleting old files"); 110 foreach (IPluginFile ipf in pd.Files) { 111 File.Delete(ipf.Name); 112 } 113 } 114 115 Logger.Debug("deleted old files"); 116 Logger.Debug("creating new files"); 117 118 119 120 foreach (HivePluginFile pf in updateablePlugin.PluginFiles) { 121 File.WriteAllBytes(PLUGIN_REPO + pf.Name.Split('\\').Last(), pf.BinaryFile); 122 } 123 124 Logger.Debug("created new files"); 125 DoUpdateRun(); 126 } 68 127 } 69 128 70 71 internal void PreparePlugins(List<HivePluginInfoDto> requiredPlugins) { 72 List<HivePluginInfoDto> missingPlugins = new List<HivePluginInfoDto>(); 73 foreach (HivePluginInfoDto requiredPlugin in requiredPlugins) { 74 if(ApplicationManager.Manager.Plugins.Count(ipd => ipd.Version.Major == requiredPlugin.Version.Major && ipd.Version.Minor >= requiredPlugin.Version.Minor) == 0) { 75 missingPlugins.Add(requiredPlugin); 76 } 129 internal void DeletePluginsForJob(Guid id) { 130 try { 131 Logger.Debug("unloading..."); 132 Directory.Delete(Path.Combine(PLUGIN_REPO, id.ToString()), true); 133 } catch (Exception ex) { 134 Logger.Debug("failed while unloading " + id + " with exception " + ex); 77 135 } 78 79 Logger.Debug("Requesting missing plugins");80 List<CachedHivePluginInfoDto> receivedPlugins = WcfService.Instance.RequestPlugins(missingPlugins);81 Logger.Debug("Requested missing plugins");82 83 foreach (CachedHivePluginInfoDto receivedPlugin in receivedPlugins) {84 foreach (HivePluginFile hpf in receivedPlugin.PluginFiles) {85 Logger.Info("writing file " + hpf.Name);86 File.WriteAllBytes("C:\\temp\\" + hpf.Name.Split('\\').Last(), hpf.BinaryFile);87 }88 }89 90 136 } 91 137 } -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Client.ExecutionEngine/3.3/ExecutionEnginePlugin.cs
r4107 r4141 30 30 [PluginFile("HeuristicLab.Hive.Client.ExecutionEngine-3.3.dll", PluginFileType.Assembly)] 31 31 [PluginDependency("HeuristicLab.Core", "3.3")] 32 [PluginDependency("HeuristicLab.Common", "3.3")] 32 33 [PluginDependency("HeuristicLab.Hive.Client.Common", "3.3")] 33 34 [PluginDependency("HeuristicLab.Hive.Client.Communication", "3.3")] -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Client.ExecutionEngine/3.3/Executor.cs
r4119 r4141 36 36 public IJob Job { get; set; } 37 37 public MessageContainer.MessageType CurrentMessage { get; set; } 38 public Exception CurrentException { get; set; } 38 39 public MessageQueue Queue { get; set; } 39 40 … … 64 65 65 66 void Job_JobFailed(object sender, EventArgs e) { 66 Queue.AddMessage(new MessageContainer(MessageContainer.MessageType.JobFailed, JobId)); 67 HeuristicLab.Common.EventArgs<Exception> ex = (HeuristicLab.Common.EventArgs<Exception>)e; 68 CurrentException = ex.Value; 69 Queue.AddMessage(new MessageContainer(MessageContainer.MessageType.FinishedJob, JobId)); 67 70 } 68 71 -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Contracts/3.3/ApplicationConstants.cs
r4092 r4141 87 87 public static string RESPONSE_COMMUNICATOR_SEND_JOBRESULT = "Please send the Jobresult to the server"; 88 88 public static string RESPONSE_COMMUNICATOR_PLUGINS_SENT = "Communicator.PluginsSent"; 89 public static string RESPONSE_COMMUNICATOR_PLUGINS_NOT_AVAIL = "Communicator.PluginsNotAvail"; 89 90 public static string RESPONSE_COMMUNICATOR_JOB_WAS_ABORTED = "Job was aborted"; 90 91 -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Contracts/3.3/BusinessObjects/ClientDto.cs
r4133 r4141 27 27 using HeuristicLab.Common; 28 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 29 29 30 30 namespace HeuristicLab.Hive.Contracts.BusinessObjects { 31 31 32 public enum State { NullState, Idle, Calculating, Offline, Finished, Abort, RequestSnapshot, RequestSnapshotSent, Pending };32 public enum State { NullState, Idle, Calculating, Offline, Finished, Abort, RequestSnapshot, RequestSnapshotSent, Pending, Failed }; 33 33 public enum CalendarState { Fetch, ForceFetch, Fetching, Fetched, NotAllowedToFetch }; 34 34 -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Contracts/3.3/BusinessObjects/HivePluginInfoDto.cs
r4133 r4141 45 45 private string storableVersion; 46 46 47 [Storable] 48 [DataMember] 49 public Boolean Update { get; set; } 50 47 51 public HivePluginInfoDto() { } 48 52 … … 64 68 clone.Name = this.Name; 65 69 clone.Version = (Version)this.Version.Clone(); 70 clone.Update = this.Update; 66 71 return clone; 67 72 } -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Contracts/3.3/BusinessObjects/JobDto.cs
r4133 r4141 53 53 [Storable] 54 54 [DataMember] 55 public String Exception { get; set; } 56 [Storable] 57 [DataMember] 55 58 public DateTime? DateCreated { get; set; } 56 59 [Storable] … … 79 82 public ProjectDto Project { get; set; } 80 83 84 85 81 86 public override string ToString() { 82 87 return base.ToString() + "State: " + State + ", [Ressource : " + Client + " ] , DateCreated: " + DateCreated + ", DateCalculated: " + DateCalculated + … … 98 103 clone.DateCreated = this.DateCreated; 99 104 clone.DateFinished = this.DateFinished; 105 clone.Exception = this.Exception; 100 106 clone.Id = this.Id; 101 107 clone.MemoryNeeded = this.MemoryNeeded; -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Experiment.Views/3.3/JobItemView.Designer.cs
r4133 r4141 58 58 this.logTabPage = new System.Windows.Forms.TabPage(); 59 59 this.logView = new HeuristicLab.Core.Views.LogView(); 60 this.requestSnapshotButton = new System.Windows.Forms.Button(); 60 61 this.snapshotGroupBox.SuspendLayout(); 61 62 this.jobStatusGroupBox.SuspendLayout(); … … 247 248 this.snapshotGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 248 249 | System.Windows.Forms.AnchorStyles.Right))); 250 this.snapshotGroupBox.Controls.Add(this.requestSnapshotButton); 249 251 this.snapshotGroupBox.Controls.Add(this.openSnapshotButton); 250 252 this.snapshotGroupBox.Controls.Add(this.snapshotTimeText); … … 262 264 // 263 265 this.openSnapshotButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 264 this.openSnapshotButton.Location = new System.Drawing.Point(42 6, 67);266 this.openSnapshotButton.Location = new System.Drawing.Point(420, 67); 265 267 this.openSnapshotButton.Name = "openSnapshotButton"; 266 this.openSnapshotButton.Size = new System.Drawing.Size(10 1, 26);268 this.openSnapshotButton.Size = new System.Drawing.Size(107, 26); 267 269 this.openSnapshotButton.TabIndex = 25; 268 270 this.openSnapshotButton.Text = "Open Snapshot"; … … 415 417 this.logView.Size = new System.Drawing.Size(536, 447); 416 418 this.logView.TabIndex = 0; 419 // 420 // requestSnapshotButton 421 // 422 this.requestSnapshotButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 423 this.requestSnapshotButton.Location = new System.Drawing.Point(307, 67); 424 this.requestSnapshotButton.Name = "requestSnapshotButton"; 425 this.requestSnapshotButton.Size = new System.Drawing.Size(107, 26); 426 this.requestSnapshotButton.TabIndex = 26; 427 this.requestSnapshotButton.Text = "Request Snapshot"; 428 this.requestSnapshotButton.UseVisualStyleBackColor = true; 429 this.requestSnapshotButton.Click += new System.EventHandler(this.requestSnapshotButton_Click); 417 430 // 418 431 // JobItemView … … 471 484 private System.Windows.Forms.TabPage logTabPage; 472 485 private Core.Views.LogView logView; 486 private System.Windows.Forms.Button requestSnapshotButton; 473 487 } 474 488 } -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Experiment.Views/3.3/JobItemView.cs
r4133 r4141 111 111 MainFormManager.MainForm.ShowContent(job.Optimizer); 112 112 } 113 114 private void requestSnapshotButton_Click(object sender, EventArgs e) { 115 116 } 113 117 } 114 118 } -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Experiment/3.3/HeuristicLab.Hive.Experiment-3.3.csproj
r4139 r4141 96 96 </ItemGroup> 97 97 <ItemGroup> 98 <Compile Include="OptimizerList.cs" />99 98 <Compile Include="JobItemList.cs" /> 100 99 <Compile Include="JobItem.cs" /> -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Experiment/3.3/HiveExperiment.cs
r4139 r4141 53 53 private const string itemDescription = "A runner for a single experiment, which's algorithms are executed in the Hive."; 54 54 private const int resultPollingIntervalMs = 15000; 55 private const int snapshotPollingIntervalMs = 1000; 55 56 private const int maxSnapshotRetries = 20; 56 57 private object locker = new object(); … … 169 170 clone.executionTime = this.executionTime; 170 171 clone.pendingOptimizersByJobId = new Dictionary<Guid, IOptimizer>(); 172 171 173 foreach (var pair in this.pendingOptimizersByJobId) 172 174 clone.pendingOptimizersByJobId[pair.Key] = (IOptimizer)cloner.Clone(pair.Value); 175 173 176 foreach (var pair in this.parentOptimizersByPendingOptimizer) 174 clone.parentOptimizersByPendingOptimizer[pair.Key] = (IOptimizer)cloner.Clone(pair.Value); 177 clone.parentOptimizersByPendingOptimizer[(IOptimizer)cloner.Clone(pair.Key)] = (IOptimizer)cloner.Clone(pair.Value); 178 175 179 clone.log = (ILog)cloner.Clone(log); 176 180 clone.stopPending = this.stopPending; … … 243 247 public void Prepare() { 244 248 if (experiment != null) { 249 StopResultPolling(); 250 pendingOptimizersByJobId.Clear(); 251 parentOptimizersByPendingOptimizer.Clear(); 252 jobItems.Clear(); 245 253 experiment.Prepare(); 246 254 this.ExecutionState = Core.ExecutionState.Prepared; … … 251 259 public void Start() { 252 260 OnStarted(); 261 ExecutionTime = new TimeSpan(); 253 262 lastUpdateTime = DateTime.Now; 254 263 this.ExecutionState = Core.ExecutionState.Started; … … 295 304 private void CreateResultPollingThreads() { 296 305 foreach (JobItem jobItem in JobItems) { 297 if (!resultPollingThreads.ContainsKey(jobItem.JobDto.Id) ) {306 if (!resultPollingThreads.ContainsKey(jobItem.JobDto.Id) && jobItem.JobDto.State != State.Finished) { 298 307 resultPollingThreads.Add(jobItem.JobDto.Id, CreateResultPollingThread(jobItem.JobDto)); 299 308 } … … 303 312 public void StartResultPolling() { 304 313 this.stopResultsPollingPending = false; 305 CreateResultPollingThreads();306 foreach (Thread pollingThread in resultPollingThreads.Values) {307 if (pollingThread.ThreadState != System.Threading.ThreadState.Running) {308 pollingThread.Start();309 }310 }311 314 this.IsPollingResults = true; 315 lock (resultPollingThreads) { 316 CreateResultPollingThreads(); 317 foreach (Thread pollingThread in resultPollingThreads.Values) { 318 if (pollingThread.ThreadState != System.Threading.ThreadState.Running) { 319 pollingThread.Start(); 320 } 321 } 322 } 312 323 } 313 324 … … 452 463 453 464 do { 454 Thread.Sleep(resultPollingIntervalMs);455 465 if (stopPending || !this.IsPollingResults) { 456 466 return; … … 479 489 UpdateSnapshot(jobResponse); 480 490 } 491 492 Thread.Sleep(resultPollingIntervalMs); 481 493 } while (restoredObject == null || restoredObject.ExecutionState != Core.ExecutionState.Stopped); 482 494 … … 486 498 IOptimizer originalOptimizer = pendingOptimizersByJobId[job.Id]; 487 499 IOptimizer restoredOptimizer = ((OptimizerJob)restoredObject).Optimizer; 488 500 489 501 ReplaceOptimizer(parentOptimizersByPendingOptimizer[originalOptimizer], originalOptimizer, restoredOptimizer); 490 502 pendingOptimizersByJobId.Remove(job.Id); 491 503 parentOptimizersByPendingOptimizer.Remove(originalOptimizer); 492 504 505 } catch (ThreadInterruptedException exception) { 506 507 } finally { 508 GetJobItemById(job.Id).LogMessage("ResultsPolling Thread stopped"); 509 lock (resultPollingThreads) { 510 resultPollingThreads.Remove(job.Id); 511 if (resultPollingThreads.Count == 0) { 512 IsPollingResults = false; 513 } 514 } 515 516 // check if finished 493 517 if (pendingOptimizersByJobId.Count == 0) { 494 // finished495 518 this.ExecutionState = Core.ExecutionState.Stopped; 496 519 OnStopped(); 497 520 } 498 } catch (ThreadInterruptedException exception) {499 500 } finally {501 GetJobItemById(job.Id).LogMessage("ResultsPolling Thread stopped");502 resultPollingThreads.Remove(job.Id);503 if (resultPollingThreads.Count == 0) {504 IsPollingResults = false;505 }506 521 } 507 522 }); … … 519 534 520 535 private void LogMessage(string message) { 521 // HeuristicLab.Log is not Thread-Safe, so lock every call536 // HeuristicLab.Log is not Thread-Safe, so lock on every call 522 537 lock (locker) { 523 538 log.LogMessage(message); 539 } 540 } 541 542 public void RequestSnapshot(Guid jobId) { 543 IExecutionEngineFacade executionEngineFacade = GetExecutionEngineFacade(); 544 ResponseObject<SerializedJob> response; 545 int retryCount = 0; 546 547 Response snapShotResponse = executionEngineFacade.RequestSnapshot(jobId); 548 if (snapShotResponse.StatusMessage == ApplicationConstants.RESPONSE_JOB_IS_NOT_BEEING_CALCULATED) { 549 // job already finished 550 Logger.Debug("HiveEngine: Abort - GetLastResult(false)"); 551 response = executionEngineFacade.GetLastSerializedResult(jobId, false, false); 552 Logger.Debug("HiveEngine: Abort - Server: " + response.StatusMessage + " success: " + response.Success); 553 } else { 554 // server sent snapshot request to client 555 // poll until snapshot is ready 556 do { 557 Thread.Sleep(snapshotPollingIntervalMs); 558 Logger.Debug("HiveEngine: Abort - GetLastResult(true)"); 559 response = executionEngineFacade.GetLastSerializedResult(jobId, false, true); 560 Logger.Debug("HiveEngine: Abort - Server: " + response.StatusMessage + " success: " + response.Success); 561 retryCount++; 562 // loop while 563 // 1. problem with communication with server 564 // 2. job result not yet ready 565 } while ( 566 (retryCount < maxSnapshotRetries) && ( 567 !response.Success || 568 response.StatusMessage == ApplicationConstants.RESPONSE_JOB_RESULT_NOT_YET_HERE) 569 ); 570 } 571 SerializedJob jobResult = response.Obj; 572 if (jobResult != null) { 573 Logger.Debug("HiveEngine: Results-polling - Got result!"); 574 575 //job = XmlParser.Deserialize<Job>(new MemoryStream(jobResult.SerializedJobData)); 576 577 throw new NotImplementedException("[chn] how to create a view in 3.3 and why should i do this here? shouldnt the caller of this method receive a result and decide what to do?"); 578 //ControlManager.Manager.ShowControl(job.Engine.CreateView()); 524 579 } 525 580 } -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.Core/3.3/ClientCommunicator.cs
r4135 r4141 140 140 } 141 141 CheckForPendingJobs(); 142 // DaoLocator.DestroyContext();142 // DaoLocator.DestroyContext(); 143 143 scope.Complete(); 144 144 } … … 591 591 job.JobInfo.Percentage = percentage; 592 592 593 if (finished) { 593 if (exception != null) { 594 job.JobInfo.State = State.Failed; 595 job.JobInfo.Exception = exception.ToString(); 596 job.JobInfo.DateFinished = DateTime.Now; 597 } else if (finished) { 594 598 job.JobInfo.State = State.Finished; 595 599 job.JobInfo.DateFinished = DateTime.Now; … … 710 714 ResponsePlugin response = new ResponsePlugin(); 711 715 foreach (HivePluginInfoDto pluginInfo in pluginList) { 712 // TODO: Split version to major, minor and revision number 713 foreach (IPluginDescription currPlugin in ApplicationManager.Manager.Plugins) { 714 if (currPlugin.Name == pluginInfo.Name) { 715 716 CachedHivePluginInfoDto currCachedPlugin = new CachedHivePluginInfoDto { 717 Name = currPlugin.Name, 718 Version = currPlugin.Version 719 }; 720 721 foreach (string fileName in from file in currPlugin.Files select file.Name) { 722 currCachedPlugin.PluginFiles.Add(new HivePluginFile(File.ReadAllBytes(fileName), fileName)); 723 } 724 response.Plugins.Add(currCachedPlugin); 716 if (pluginInfo.Update) { 717 //check if there is a newer version 718 IPluginDescription ipd = 719 ApplicationManager.Manager.Plugins.Where(pd => pd.Name == pluginInfo.Name && pd.Version.Major == pluginInfo.Version.Major && pd.Version.Minor == pluginInfo.Version.Minor && pd.Version.Revision > pluginInfo.Version.Revision).SingleOrDefault(); 720 if (ipd != null) { 721 response.Plugins.Add(convertPluginDescriptorToDto(ipd)); 722 } 723 } else { 724 IPluginDescription ipd = 725 ApplicationManager.Manager.Plugins.Where(pd => pd.Name == pluginInfo.Name && pd.Version.Major == pluginInfo.Version.Major && pd.Version.Minor == pluginInfo.Version.Minor && pd.Version.Revision >= pluginInfo.Version.Revision).SingleOrDefault(); 726 if (ipd != null) { 727 response.Plugins.Add(convertPluginDescriptorToDto(ipd)); 728 } else { 729 response.Success = false; 730 response.StatusMessage = ApplicationConstants.RESPONSE_COMMUNICATOR_PLUGINS_NOT_AVAIL; 731 return response; 725 732 } 726 733 } … … 730 737 731 738 return response; 739 } 740 741 private CachedHivePluginInfoDto convertPluginDescriptorToDto(IPluginDescription currPlugin) { 742 CachedHivePluginInfoDto currCachedPlugin = new CachedHivePluginInfoDto { 743 Name = currPlugin.Name, 744 Version = currPlugin.Version 745 }; 746 747 foreach (string fileName in from file in currPlugin.Files select file.Name) { 748 currCachedPlugin.PluginFiles.Add(new HivePluginFile(File.ReadAllBytes(fileName), fileName)); 749 } 750 return currCachedPlugin; 732 751 } 733 752 -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.Core/3.3/DbTestApp.cs
r4116 r4141 232 232 using (contextFactory.GetContext()) { 233 233 //TestLINQImplementation(); 234 TestLinqFileHandling();234 //TestLinqFileHandling(); 235 235 236 236 //StressTest(); -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.LINQDataAccess/3.3/HiveDataContext.cs
r3931 r4141 3 3 // <auto-generated> 4 4 // This code was generated by a tool. 5 // Runtime Version: 2.0.50727.49275 // Runtime Version:4.0.30319.1 6 6 // 7 7 // Changes to this file may cause incorrect behavior and will be lost if … … 23 23 24 24 25 [ System.Data.Linq.Mapping.DatabaseAttribute(Name="HeuristicLab.Hive.Linq.Test")]25 [global::System.Data.Linq.Mapping.DatabaseAttribute(Name="HeuristicLab.Hive")] 26 26 public partial class HiveDataContext : System.Data.Linq.DataContext 27 27 { … … 168 168 } 169 169 170 [ Table(Name="dbo.AssignedResources")]170 [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.AssignedResources")] 171 171 public partial class AssignedResource : INotifyPropertyChanging, INotifyPropertyChanged 172 172 { … … 203 203 } 204 204 205 [ Column(Storage="_ResourceId", DbType="UniqueIdentifier NOT NULL")]205 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ResourceId", DbType="UniqueIdentifier NOT NULL")] 206 206 public System.Guid ResourceId 207 207 { … … 227 227 } 228 228 229 [ Column(Storage="_JobId", DbType="UniqueIdentifier NOT NULL")]229 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_JobId", DbType="UniqueIdentifier NOT NULL")] 230 230 public System.Guid JobId 231 231 { … … 251 251 } 252 252 253 [ Column(Storage="_AssignedRessourcesId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true)]253 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_AssignedRessourcesId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true)] 254 254 public System.Guid AssignedRessourcesId 255 255 { … … 271 271 } 272 272 273 [ Association(Name="Resource_AssignedResource", Storage="_Resource", ThisKey="ResourceId", OtherKey="ResourceId", IsForeignKey=true, DeleteRule="CASCADE")]273 [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Resource_AssignedResource", Storage="_Resource", ThisKey="ResourceId", OtherKey="ResourceId", IsForeignKey=true, DeleteRule="CASCADE")] 274 274 public Resource Resource 275 275 { … … 305 305 } 306 306 307 [ Association(Name="Job_AssignedResource", Storage="_Job", ThisKey="JobId", OtherKey="JobId", IsForeignKey=true, DeleteRule="CASCADE")]307 [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Job_AssignedResource", Storage="_Job", ThisKey="JobId", OtherKey="JobId", IsForeignKey=true, DeleteRule="CASCADE")] 308 308 public Job Job 309 309 { … … 360 360 } 361 361 362 [ Table(Name="dbo.UptimeStatistics")]362 [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.UptimeStatistics")] 363 363 public partial class UptimeStatistic : INotifyPropertyChanging, INotifyPropertyChanged 364 364 { … … 396 396 } 397 397 398 [ Column(Storage="_UptimeStatisticsId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true)]398 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UptimeStatisticsId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true)] 399 399 public System.Guid UptimeStatisticsId 400 400 { … … 416 416 } 417 417 418 [ Column(Storage="_Login", DbType="DateTime")]418 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Login", DbType="DateTime")] 419 419 public System.DateTime Login 420 420 { … … 436 436 } 437 437 438 [ Column(Storage="_Logout", DbType="DateTime")]438 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Logout", DbType="DateTime")] 439 439 public System.DateTime Logout 440 440 { … … 456 456 } 457 457 458 [ Column(Storage="_ResourceId", DbType="UniqueIdentifier")]458 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ResourceId", DbType="UniqueIdentifier")] 459 459 public System.Guid ResourceId 460 460 { … … 480 480 } 481 481 482 [ Association(Name="Client_UptimeStatistic", Storage="_Client", ThisKey="ResourceId", OtherKey="ResourceId", IsForeignKey=true, DeleteRule="SET NULL")]482 [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Client_UptimeStatistic", Storage="_Client", ThisKey="ResourceId", OtherKey="ResourceId", IsForeignKey=true, DeleteRule="SET NULL")] 483 483 public Client Client 484 484 { … … 535 535 } 536 536 537 [ Table(Name="dbo.ClientConfig")]537 [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.ClientConfig")] 538 538 public partial class ClientConfig : INotifyPropertyChanging, INotifyPropertyChanged 539 539 { … … 567 567 } 568 568 569 [ Column(Storage="_ClientConfigId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true)]569 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ClientConfigId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true)] 570 570 public System.Guid ClientConfigId 571 571 { … … 587 587 } 588 588 589 [ Column(Storage="_UpDownTimeCalendar", DbType="Xml", UpdateCheck=UpdateCheck.Never)]589 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UpDownTimeCalendar", DbType="Xml", UpdateCheck=UpdateCheck.Never)] 590 590 public System.Xml.Linq.XElement UpDownTimeCalendar 591 591 { … … 607 607 } 608 608 609 [ Column(Storage="_HeartBeatIntervall", DbType="Int")]609 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_HeartBeatIntervall", DbType="Int")] 610 610 public System.Nullable<int> HeartBeatIntervall 611 611 { … … 627 627 } 628 628 629 [ Association(Name="ClientConfig_Client", Storage="_Clients", ThisKey="ClientConfigId", OtherKey="ClientConfigId")]629 [global::System.Data.Linq.Mapping.AssociationAttribute(Name="ClientConfig_Client", Storage="_Clients", ThisKey="ClientConfigId", OtherKey="ClientConfigId")] 630 630 public EntitySet<Client> Clients 631 631 { … … 673 673 } 674 674 675 [ Table(Name="dbo.ClientGroup_Resource")]675 [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.ClientGroup_Resource")] 676 676 public partial class ClientGroup_Resource : INotifyPropertyChanging, INotifyPropertyChanged 677 677 { … … 708 708 } 709 709 710 [ Column(Storage="_ClientGroup_RessourceId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true)]710 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ClientGroup_RessourceId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true)] 711 711 public System.Guid ClientGroup_RessourceId 712 712 { … … 728 728 } 729 729 730 [ Column(Storage="_ClientGroupId", DbType="UniqueIdentifier NOT NULL")]730 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ClientGroupId", DbType="UniqueIdentifier NOT NULL")] 731 731 public System.Guid ClientGroupId 732 732 { … … 752 752 } 753 753 754 [ Column(Storage="_ResourceId", DbType="UniqueIdentifier NOT NULL")]754 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ResourceId", DbType="UniqueIdentifier NOT NULL")] 755 755 public System.Guid ResourceId 756 756 { … … 776 776 } 777 777 778 [ Association(Name="ClientGroup_ClientGroup_Resource", Storage="_ClientGroup", ThisKey="ClientGroupId", OtherKey="ResourceId", IsForeignKey=true)]778 [global::System.Data.Linq.Mapping.AssociationAttribute(Name="ClientGroup_ClientGroup_Resource", Storage="_ClientGroup", ThisKey="ClientGroupId", OtherKey="ResourceId", IsForeignKey=true)] 779 779 public ClientGroup ClientGroup 780 780 { … … 810 810 } 811 811 812 [ Association(Name="Resource_ClientGroup_Resource", Storage="_Resource", ThisKey="ResourceId", OtherKey="ResourceId", IsForeignKey=true, DeleteRule="CASCADE")]812 [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Resource_ClientGroup_Resource", Storage="_Resource", ThisKey="ResourceId", OtherKey="ResourceId", IsForeignKey=true, DeleteRule="CASCADE")] 813 813 public Resource Resource 814 814 { … … 865 865 } 866 866 867 [ Table(Name="dbo.PluginInfo")]867 [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.PluginInfo")] 868 868 public partial class PluginInfo : INotifyPropertyChanging, INotifyPropertyChanged 869 869 { … … 901 901 } 902 902 903 [ Column(Storage="_PluginId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true)]903 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PluginId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true)] 904 904 public System.Guid PluginId 905 905 { … … 921 921 } 922 922 923 [ Column(Storage="_Name", DbType="VarChar(MAX)")]923 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Name", DbType="VarChar(MAX)")] 924 924 public string Name 925 925 { … … 941 941 } 942 942 943 [ Column(Storage="_Version", DbType="VarChar(MAX)")]943 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Version", DbType="VarChar(MAX)")] 944 944 public string Version 945 945 { … … 961 961 } 962 962 963 [ Column(Storage="_BuildDate", DbType="VarChar(20)")]963 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_BuildDate", DbType="VarChar(20)")] 964 964 public string BuildDate 965 965 { … … 981 981 } 982 982 983 [ Association(Name="PluginInfo_RequiredPlugin", Storage="_RequiredPlugins", ThisKey="PluginId", OtherKey="PluginId")]983 [global::System.Data.Linq.Mapping.AssociationAttribute(Name="PluginInfo_RequiredPlugin", Storage="_RequiredPlugins", ThisKey="PluginId", OtherKey="PluginId")] 984 984 public EntitySet<RequiredPlugin> RequiredPlugins 985 985 { … … 1027 1027 } 1028 1028 1029 [ Table(Name="dbo.Project")]1029 [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Project")] 1030 1030 public partial class Project : INotifyPropertyChanging, INotifyPropertyChanged 1031 1031 { … … 1055 1055 } 1056 1056 1057 [ Column(Storage="_ProjectId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true)]1057 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true)] 1058 1058 public System.Guid ProjectId 1059 1059 { … … 1075 1075 } 1076 1076 1077 [ Column(Storage="_Name", DbType="VarChar(MAX)")]1077 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Name", DbType="VarChar(MAX)")] 1078 1078 public string Name 1079 1079 { … … 1095 1095 } 1096 1096 1097 [ Association(Name="Project_Job", Storage="_Jobs", ThisKey="ProjectId", OtherKey="ProjectId")]1097 [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Project_Job", Storage="_Jobs", ThisKey="ProjectId", OtherKey="ProjectId")] 1098 1098 public EntitySet<Job> Jobs 1099 1099 { … … 1141 1141 } 1142 1142 1143 [ Table(Name="dbo.RequiredPlugins")]1143 [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.RequiredPlugins")] 1144 1144 public partial class RequiredPlugin : INotifyPropertyChanging, INotifyPropertyChanged 1145 1145 { … … 1176 1176 } 1177 1177 1178 [ Column(Storage="_RequiredPluginId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true, UpdateCheck=UpdateCheck.Never)]1178 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RequiredPluginId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true, UpdateCheck=UpdateCheck.Never)] 1179 1179 public System.Guid RequiredPluginId 1180 1180 { … … 1196 1196 } 1197 1197 1198 [ Column(Storage="_JobId", DbType="UniqueIdentifier NOT NULL")]1198 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_JobId", DbType="UniqueIdentifier NOT NULL")] 1199 1199 public System.Guid JobId 1200 1200 { … … 1220 1220 } 1221 1221 1222 [ Column(Storage="_PluginId", DbType="UniqueIdentifier NOT NULL")]1222 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PluginId", DbType="UniqueIdentifier NOT NULL")] 1223 1223 public System.Guid PluginId 1224 1224 { … … 1244 1244 } 1245 1245 1246 [ Association(Name="PluginInfo_RequiredPlugin", Storage="_PluginInfo", ThisKey="PluginId", OtherKey="PluginId", IsForeignKey=true, DeleteRule="CASCADE")]1246 [global::System.Data.Linq.Mapping.AssociationAttribute(Name="PluginInfo_RequiredPlugin", Storage="_PluginInfo", ThisKey="PluginId", OtherKey="PluginId", IsForeignKey=true, DeleteRule="CASCADE")] 1247 1247 public PluginInfo PluginInfo 1248 1248 { … … 1278 1278 } 1279 1279 1280 [ Association(Name="Job_RequiredPlugin", Storage="_Job", ThisKey="JobId", OtherKey="JobId", IsForeignKey=true)]1280 [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Job_RequiredPlugin", Storage="_Job", ThisKey="JobId", OtherKey="JobId", IsForeignKey=true)] 1281 1281 public Job Job 1282 1282 { … … 1333 1333 } 1334 1334 1335 [ Table(Name="dbo.Resource")]1336 [ InheritanceMapping(Code="RESOURCE", Type=typeof(Resource))]1337 [ InheritanceMapping(Code="CLIENT", Type=typeof(Client), IsDefault=true)]1338 [ InheritanceMapping(Code="GROUP", Type=typeof(ClientGroup))]1335 [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Resource")] 1336 [global::System.Data.Linq.Mapping.InheritanceMappingAttribute(Code="RESOURCE", Type=typeof(Resource))] 1337 [global::System.Data.Linq.Mapping.InheritanceMappingAttribute(Code="CLIENT", Type=typeof(Client), IsDefault=true)] 1338 [global::System.Data.Linq.Mapping.InheritanceMappingAttribute(Code="GROUP", Type=typeof(ClientGroup))] 1339 1339 public partial class Resource : INotifyPropertyChanging, INotifyPropertyChanged 1340 1340 { … … 1374 1374 } 1375 1375 1376 [ Column(Storage="_ResourceId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true)]1376 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ResourceId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true)] 1377 1377 public System.Guid ResourceId 1378 1378 { … … 1394 1394 } 1395 1395 1396 [ Column(Storage="_Name", DbType="VarChar(MAX)")]1396 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Name", DbType="VarChar(MAX)")] 1397 1397 public string Name 1398 1398 { … … 1414 1414 } 1415 1415 1416 [ Column(Storage="_ResourceType", IsDiscriminator=true)]1416 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ResourceType", IsDiscriminator=true)] 1417 1417 public string ResourceType 1418 1418 { … … 1434 1434 } 1435 1435 1436 [ Association(Name="Resource_AssignedResource", Storage="_AssignedResources", ThisKey="ResourceId", OtherKey="ResourceId")]1436 [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Resource_AssignedResource", Storage="_AssignedResources", ThisKey="ResourceId", OtherKey="ResourceId")] 1437 1437 public EntitySet<AssignedResource> AssignedResources 1438 1438 { … … 1447 1447 } 1448 1448 1449 [ Association(Name="Resource_ClientGroup_Resource", Storage="_ClientGroup_Resources_Parents", ThisKey="ResourceId", OtherKey="ResourceId")]1449 [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Resource_ClientGroup_Resource", Storage="_ClientGroup_Resources_Parents", ThisKey="ResourceId", OtherKey="ResourceId")] 1450 1450 public EntitySet<ClientGroup_Resource> ClientGroup_Resources_Parents 1451 1451 { … … 1460 1460 } 1461 1461 1462 [ Association(Name="Resource_UptimeCalendar", Storage="_UptimeCalendars", ThisKey="ResourceId", OtherKey="ResourceId")]1462 [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Resource_UptimeCalendar", Storage="_UptimeCalendars", ThisKey="ResourceId", OtherKey="ResourceId")] 1463 1463 public EntitySet<UptimeCalendar> UptimeCalendars 1464 1464 { … … 1593 1593 } 1594 1594 1595 [ Column(Storage="_CPUSpeed", DbType="Int")]1595 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CPUSpeed", DbType="Int")] 1596 1596 public System.Nullable<int> CPUSpeed 1597 1597 { … … 1613 1613 } 1614 1614 1615 [ Column(Storage="_Memory", DbType="Int")]1615 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Memory", DbType="Int")] 1616 1616 public System.Nullable<int> Memory 1617 1617 { … … 1633 1633 } 1634 1634 1635 [ Column(Storage="_Login", DbType="DateTime")]1635 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Login", DbType="DateTime")] 1636 1636 public System.Nullable<System.DateTime> Login 1637 1637 { … … 1653 1653 } 1654 1654 1655 [ Column(Storage="_Status", DbType="VarChar(MAX)")]1655 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Status", DbType="VarChar(MAX)")] 1656 1656 public string Status 1657 1657 { … … 1673 1673 } 1674 1674 1675 [ Column(Storage="_CalendarSyncStatus", DbType="VarChar(MAX)")]1675 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CalendarSyncStatus", DbType="VarChar(MAX)")] 1676 1676 public string CalendarSyncStatus 1677 1677 { … … 1693 1693 } 1694 1694 1695 [ Column(Storage="_UseCalendarFromResourceId", DbType="UniqueIdentifier")]1695 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UseCalendarFromResourceId", DbType="UniqueIdentifier")] 1696 1696 public System.Nullable<System.Guid> UseCalendarFromResourceId 1697 1697 { … … 1713 1713 } 1714 1714 1715 [ Column(Storage="_ClientConfigId", DbType="UniqueIdentifier")]1715 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ClientConfigId", DbType="UniqueIdentifier")] 1716 1716 public System.Nullable<System.Guid> ClientConfigId 1717 1717 { … … 1737 1737 } 1738 1738 1739 [ Column(Storage="_NumberOfCores", DbType="Int")]1739 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_NumberOfCores", DbType="Int")] 1740 1740 public System.Nullable<int> NumberOfCores 1741 1741 { … … 1757 1757 } 1758 1758 1759 [ Column(Storage="_NumberOfFreeCores", DbType="Int")]1759 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_NumberOfFreeCores", DbType="Int")] 1760 1760 public System.Nullable<int> NumberOfFreeCores 1761 1761 { … … 1777 1777 } 1778 1778 1779 [ Column(Storage="_FreeMemory", DbType="Int")]1779 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_FreeMemory", DbType="Int")] 1780 1780 public System.Nullable<int> FreeMemory 1781 1781 { … … 1797 1797 } 1798 1798 1799 [ Association(Name="Client_UptimeStatistic", Storage="_UptimeStatistics", ThisKey="ResourceId", OtherKey="ResourceId")]1799 [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Client_UptimeStatistic", Storage="_UptimeStatistics", ThisKey="ResourceId", OtherKey="ResourceId")] 1800 1800 public EntitySet<UptimeStatistic> UptimeStatistics 1801 1801 { … … 1810 1810 } 1811 1811 1812 [ Association(Name="Client_Job", Storage="_Jobs", ThisKey="ResourceId", OtherKey="ResourceId", DeleteRule="SET NULL")]1812 [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Client_Job", Storage="_Jobs", ThisKey="ResourceId", OtherKey="ResourceId", DeleteRule="SET NULL")] 1813 1813 public EntitySet<Job> Jobs 1814 1814 { … … 1823 1823 } 1824 1824 1825 [ Association(Name="ClientConfig_Client", Storage="_ClientConfig", ThisKey="ClientConfigId", OtherKey="ClientConfigId", IsForeignKey=true, DeleteRule="SET NULL")]1825 [global::System.Data.Linq.Mapping.AssociationAttribute(Name="ClientConfig_Client", Storage="_ClientConfig", ThisKey="ClientConfigId", OtherKey="ClientConfigId", IsForeignKey=true, DeleteRule="SET NULL")] 1826 1826 public ClientConfig ClientConfig 1827 1827 { … … 1899 1899 } 1900 1900 1901 [ Association(Name="ClientGroup_ClientGroup_Resource", Storage="_ClientGroup_Resources_Children", ThisKey="ResourceId", OtherKey="ClientGroupId")]1901 [global::System.Data.Linq.Mapping.AssociationAttribute(Name="ClientGroup_ClientGroup_Resource", Storage="_ClientGroup_Resources_Children", ThisKey="ResourceId", OtherKey="ClientGroupId")] 1902 1902 public EntitySet<ClientGroup_Resource> ClientGroup_Resources_Children 1903 1903 { … … 1925 1925 } 1926 1926 1927 [ Table(Name="dbo.Job")]1927 [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Job")] 1928 1928 public partial class Job : INotifyPropertyChanging, INotifyPropertyChanged 1929 1929 { … … 1940 1940 1941 1941 private System.Nullable<double> _Percentage; 1942 1943 private string _Exception; 1942 1944 1943 1945 private System.Data.Linq.Link<System.Data.Linq.Binary> _SerializedJob; … … 1985 1987 partial void OnPercentageChanging(System.Nullable<double> value); 1986 1988 partial void OnPercentageChanged(); 1989 partial void OnExceptionChanging(string value); 1990 partial void OnExceptionChanged(); 1987 1991 partial void OnSerializedJobChanging(System.Data.Linq.Binary value); 1988 1992 partial void OnSerializedJobChanged(); … … 2016 2020 } 2017 2021 2018 [ Column(Storage="_JobId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true)]2022 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_JobId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true)] 2019 2023 public System.Guid JobId 2020 2024 { … … 2036 2040 } 2037 2041 2038 [ Column(Storage="_ParentJobId", DbType="UniqueIdentifier")]2042 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ParentJobId", DbType="UniqueIdentifier")] 2039 2043 public System.Nullable<System.Guid> ParentJobId 2040 2044 { … … 2060 2064 } 2061 2065 2062 [ Column(Storage="_JobState", DbType="VarChar(MAX)")]2066 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_JobState", DbType="VarChar(MAX)")] 2063 2067 public string JobState 2064 2068 { … … 2080 2084 } 2081 2085 2082 [ Column(Storage="_ResourceId", DbType="UniqueIdentifier")]2086 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ResourceId", DbType="UniqueIdentifier")] 2083 2087 public System.Nullable<System.Guid> ResourceId 2084 2088 { … … 2104 2108 } 2105 2109 2106 [ Column(Storage="_Percentage", DbType="Float")]2110 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Percentage", DbType="Float")] 2107 2111 public System.Nullable<double> Percentage 2108 2112 { … … 2124 2128 } 2125 2129 2126 [Column(Storage="_SerializedJob", DbType="VarBinary(MAX)", UpdateCheck=UpdateCheck.Never)] 2130 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Exception", DbType="VarChar(MAX)")] 2131 public string Exception 2132 { 2133 get 2134 { 2135 return this._Exception; 2136 } 2137 set 2138 { 2139 if ((this._Exception != value)) 2140 { 2141 this.OnExceptionChanging(value); 2142 this.SendPropertyChanging(); 2143 this._Exception = value; 2144 this.SendPropertyChanged("Exception"); 2145 this.OnExceptionChanged(); 2146 } 2147 } 2148 } 2149 2150 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SerializedJob", DbType="VarBinary(MAX)", UpdateCheck=UpdateCheck.Never)] 2127 2151 public System.Data.Linq.Binary SerializedJob 2128 2152 { … … 2144 2168 } 2145 2169 2146 [ Column(Storage="_DateCreated", DbType="DateTime")]2170 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DateCreated", DbType="DateTime")] 2147 2171 public System.Nullable<System.DateTime> DateCreated 2148 2172 { … … 2164 2188 } 2165 2189 2166 [ Column(Storage="_DateCalculated", DbType="DateTime")]2190 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DateCalculated", DbType="DateTime")] 2167 2191 public System.Nullable<System.DateTime> DateCalculated 2168 2192 { … … 2184 2208 } 2185 2209 2186 [ Column(Storage="_DateFinished", DbType="DateTime")]2210 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DateFinished", DbType="DateTime")] 2187 2211 public System.Nullable<System.DateTime> DateFinished 2188 2212 { … … 2204 2228 } 2205 2229 2206 [ Column(Storage="_Priority", DbType="Int NOT NULL")]2230 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Priority", DbType="Int NOT NULL")] 2207 2231 public int Priority 2208 2232 { … … 2224 2248 } 2225 2249 2226 [ Column(Storage="_ProjectId", DbType="UniqueIdentifier")]2250 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectId", DbType="UniqueIdentifier")] 2227 2251 public System.Nullable<System.Guid> ProjectId 2228 2252 { … … 2248 2272 } 2249 2273 2250 [ Column(Storage="_UserId", DbType="UniqueIdentifier")]2274 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UserId", DbType="UniqueIdentifier")] 2251 2275 public System.Nullable<System.Guid> UserId 2252 2276 { … … 2268 2292 } 2269 2293 2270 [ Column(Storage="_CoresNeeded", DbType="Int NOT NULL")]2294 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CoresNeeded", DbType="Int NOT NULL")] 2271 2295 public int CoresNeeded 2272 2296 { … … 2288 2312 } 2289 2313 2290 [ Column(Storage="_MemoryNeeded", DbType="Int NOT NULL")]2314 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MemoryNeeded", DbType="Int NOT NULL")] 2291 2315 public int MemoryNeeded 2292 2316 { … … 2308 2332 } 2309 2333 2310 [ Association(Name="Job_AssignedResource", Storage="_AssignedResources", ThisKey="JobId", OtherKey="JobId")]2334 [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Job_AssignedResource", Storage="_AssignedResources", ThisKey="JobId", OtherKey="JobId")] 2311 2335 public EntitySet<AssignedResource> AssignedResources 2312 2336 { … … 2321 2345 } 2322 2346 2323 [ Association(Name="Job_RequiredPlugin", Storage="_RequiredPlugins", ThisKey="JobId", OtherKey="JobId")]2347 [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Job_RequiredPlugin", Storage="_RequiredPlugins", ThisKey="JobId", OtherKey="JobId")] 2324 2348 public EntitySet<RequiredPlugin> RequiredPlugins 2325 2349 { … … 2334 2358 } 2335 2359 2336 [ Association(Name="Job_Job", Storage="_Jobs", ThisKey="JobId", OtherKey="ParentJobId")]2360 [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Job_Job", Storage="_Jobs", ThisKey="JobId", OtherKey="ParentJobId")] 2337 2361 public EntitySet<Job> Jobs 2338 2362 { … … 2347 2371 } 2348 2372 2349 [ Association(Name="Job_Job", Storage="_Job1", ThisKey="ParentJobId", OtherKey="JobId", IsForeignKey=true)]2373 [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Job_Job", Storage="_Job1", ThisKey="ParentJobId", OtherKey="JobId", IsForeignKey=true)] 2350 2374 public Job Job1 2351 2375 { … … 2381 2405 } 2382 2406 2383 [ Association(Name="Project_Job", Storage="_Project", ThisKey="ProjectId", OtherKey="ProjectId", IsForeignKey=true, DeleteRule="SET NULL")]2407 [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Project_Job", Storage="_Project", ThisKey="ProjectId", OtherKey="ProjectId", IsForeignKey=true, DeleteRule="SET NULL")] 2384 2408 public Project Project 2385 2409 { … … 2415 2439 } 2416 2440 2417 [ Association(Name="Client_Job", Storage="_Client", ThisKey="ResourceId", OtherKey="ResourceId", IsForeignKey=true, DeleteRule="SET NULL")]2441 [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Client_Job", Storage="_Client", ThisKey="ResourceId", OtherKey="ResourceId", IsForeignKey=true, DeleteRule="SET NULL")] 2418 2442 public Client Client 2419 2443 { … … 2506 2530 } 2507 2531 2508 [ Table(Name="dbo.UptimeCalendar")]2532 [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.UptimeCalendar")] 2509 2533 public partial class UptimeCalendar : INotifyPropertyChanging, INotifyPropertyChanged 2510 2534 { … … 2554 2578 } 2555 2579 2556 [ Column(Storage="_UptimeCalendarId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true)]2580 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UptimeCalendarId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true)] 2557 2581 public System.Guid UptimeCalendarId 2558 2582 { … … 2574 2598 } 2575 2599 2576 [ Column(Storage="_ResourceId", DbType="UniqueIdentifier NOT NULL")]2600 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ResourceId", DbType="UniqueIdentifier NOT NULL")] 2577 2601 public System.Guid ResourceId 2578 2602 { … … 2598 2622 } 2599 2623 2600 [ Column(Storage="_StartDate", DbType="DateTime NOT NULL")]2624 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_StartDate", DbType="DateTime NOT NULL")] 2601 2625 public System.DateTime StartDate 2602 2626 { … … 2618 2642 } 2619 2643 2620 [ Column(Storage="_EndDate", DbType="DateTime NOT NULL")]2644 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_EndDate", DbType="DateTime NOT NULL")] 2621 2645 public System.DateTime EndDate 2622 2646 { … … 2638 2662 } 2639 2663 2640 [ Column(Storage="_AllDayEvent", DbType="Bit NOT NULL")]2664 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_AllDayEvent", DbType="Bit NOT NULL")] 2641 2665 public bool AllDayEvent 2642 2666 { … … 2658 2682 } 2659 2683 2660 [ Column(Storage="_Recurring", DbType="Bit NOT NULL")]2684 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Recurring", DbType="Bit NOT NULL")] 2661 2685 public bool Recurring 2662 2686 { … … 2678 2702 } 2679 2703 2680 [ Column(Storage="_RecurringId", DbType="UniqueIdentifier")]2704 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RecurringId", DbType="UniqueIdentifier")] 2681 2705 public System.Guid RecurringId 2682 2706 { … … 2698 2722 } 2699 2723 2700 [ Association(Name="Resource_UptimeCalendar", Storage="_Resource", ThisKey="ResourceId", OtherKey="ResourceId", IsForeignKey=true, DeleteRule="CASCADE")]2724 [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Resource_UptimeCalendar", Storage="_Resource", ThisKey="ResourceId", OtherKey="ResourceId", IsForeignKey=true, DeleteRule="CASCADE")] 2701 2725 public Resource Resource 2702 2726 { -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.LINQDataAccess/3.3/HiveDataContext.xml
r3931 r4141 1 1 <?xml version="1.0" encoding="utf-8"?> 2 <Database Name="HeuristicLab.Hive .Linq.Test" Class="HiveDataContext" xmlns="http://schemas.microsoft.com/linqtosql/dbml/2007">2 <Database Name="HeuristicLab.Hive" Class="HiveDataContext" xmlns="http://schemas.microsoft.com/linqtosql/dbml/2007"> 3 3 <Table Name="dbo.AssignedResources" Member="AssignedResources"> 4 4 <Type Name="AssignedResource"> … … 99 99 <Column Name="ResourceId" Member="ResourceId" DbType="UniqueIdentifier" Type="System.Guid" CanBeNull="true"/> 100 100 <Column Name="Percentage" Member="Percentage" DbType="Float" Type="System.Double" CanBeNull="true"/> 101 <Column Name="Exception" Member="Exception" DbType="VarChar(MAX)" Type="System.String" CanBeNull="true"/> 101 102 <Column Name="SerializedJob" Member="SerializedJob" DbType="VarBinary(MAX)" UpdateCheck="Never" Type="System.Data.Linq.Binary" IsDelayLoaded="true"/> 102 103 <Column Name="DateCreated" Member="DateCreated" DbType="DateTime" Type="System.DateTime" CanBeNull="true"/> -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.LINQDataAccess/3.3/JobDao.cs
r4119 r4141 167 167 168 168 target.Percentage = source.Percentage; 169 target.Exception = source.Exception; 169 170 170 171 target.Priority = source.Priority; … … 193 194 target.DateFinished = source.DateFinished; 194 195 target.Id = source.JobId; 195 196 197 target.Exception = source.Exception; 196 198 target.Percentage = source.Percentage; 197 199
Note: See TracChangeset
for help on using the changeset viewer.