Changeset 4173
- Timestamp:
- 08/06/10 15:31:15 (14 years ago)
- Location:
- branches/3.3-HiveMigration
- Files:
-
- 1 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Experiment.Views/3.3/HiveExperimentView.Designer.cs
r4144 r4173 54 54 this.hiveStatusTabPage = new System.Windows.Forms.TabPage(); 55 55 this.jobListView = new HeuristicLab.Hive.Experiment.Views.JobItemListView(); 56 this.runsTabPage = new System.Windows.Forms.TabPage(); 57 this.runCollectionView = new HeuristicLab.Optimization.Views.RunCollectionView(); 56 58 this.logTabPage = new System.Windows.Forms.TabPage(); 57 59 this.logView = new HeuristicLab.Core.Views.LogView(); … … 68 70 this.disconnectButton = new System.Windows.Forms.Button(); 69 71 this.reconnectButton = new System.Windows.Forms.Button(); 70 this.runsTabPage = new System.Windows.Forms.TabPage();71 this.runCollectionView = new HeuristicLab.Optimization.Views.RunCollectionView();72 72 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit(); 73 73 this.tabControl.SuspendLayout(); 74 74 this.experimentTabPage.SuspendLayout(); 75 75 this.hiveStatusTabPage.SuspendLayout(); 76 this.runsTabPage.SuspendLayout(); 76 77 this.logTabPage.SuspendLayout(); 77 this.runsTabPage.SuspendLayout();78 78 this.SuspendLayout(); 79 79 // … … 187 187 this.jobListView.TabIndex = 0; 188 188 // 189 // runsTabPage 190 // 191 this.runsTabPage.Controls.Add(this.runCollectionView); 192 this.runsTabPage.Location = new System.Drawing.Point(4, 22); 193 this.runsTabPage.Name = "runsTabPage"; 194 this.runsTabPage.Size = new System.Drawing.Size(727, 369); 195 this.runsTabPage.TabIndex = 4; 196 this.runsTabPage.Text = "Runs"; 197 this.runsTabPage.UseVisualStyleBackColor = true; 198 // 199 // runCollectionView 200 // 201 this.runCollectionView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 202 | System.Windows.Forms.AnchorStyles.Left) 203 | System.Windows.Forms.AnchorStyles.Right))); 204 this.runCollectionView.Caption = "RunCollection View"; 205 this.runCollectionView.Content = null; 206 this.runCollectionView.Location = new System.Drawing.Point(0, 3); 207 this.runCollectionView.Name = "runCollectionView"; 208 this.runCollectionView.ReadOnly = false; 209 this.runCollectionView.Size = new System.Drawing.Size(727, 366); 210 this.runCollectionView.TabIndex = 0; 211 // 189 212 // logTabPage 190 213 // … … 322 345 this.disconnectButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 323 346 this.disconnectButton.Enabled = false; 324 this.disconnectButton.Image = ((System.Drawing.Image)(resources.GetObject("disconnectButton.Image"))); 325 this.disconnectButton.Location = new System.Drawing.Point(120, 500); 347 this.disconnectButton.Location = new System.Drawing.Point(131, 500); 326 348 this.disconnectButton.Name = "disconnectButton"; 327 this.disconnectButton.Size = new System.Drawing.Size( 24, 24);349 this.disconnectButton.Size = new System.Drawing.Size(120, 24); 328 350 this.disconnectButton.TabIndex = 15; 351 this.disconnectButton.Text = "Disconnect from Hive"; 329 352 this.toolTip.SetToolTip(this.disconnectButton, "Disconnect from Hive (Jobs will be continue to be calculated)"); 330 353 this.disconnectButton.UseVisualStyleBackColor = true; … … 335 358 this.reconnectButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 336 359 this.reconnectButton.Enabled = false; 337 this.reconnectButton.Image = ((System.Drawing.Image)(resources.GetObject("reconnectButton.Image"))); 338 this.reconnectButton.Location = new System.Drawing.Point(150, 500); 360 this.reconnectButton.Location = new System.Drawing.Point(257, 500); 339 361 this.reconnectButton.Name = "reconnectButton"; 340 this.reconnectButton.Size = new System.Drawing.Size( 24, 24);362 this.reconnectButton.Size = new System.Drawing.Size(77, 24); 341 363 this.reconnectButton.TabIndex = 16; 364 this.reconnectButton.Text = "Reconnect"; 342 365 this.toolTip.SetToolTip(this.reconnectButton, "Reconnect to Hive"); 343 366 this.reconnectButton.UseVisualStyleBackColor = true; 344 367 this.reconnectButton.Click += new System.EventHandler(this.reconnectButton_Click); 345 368 // 346 // runsTabPage347 //348 this.runsTabPage.Controls.Add(this.runCollectionView);349 this.runsTabPage.Location = new System.Drawing.Point(4, 22);350 this.runsTabPage.Name = "runsTabPage";351 this.runsTabPage.Size = new System.Drawing.Size(727, 369);352 this.runsTabPage.TabIndex = 4;353 this.runsTabPage.Text = "Runs";354 this.runsTabPage.UseVisualStyleBackColor = true;355 //356 // runCollectionView357 //358 this.runCollectionView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)359 | System.Windows.Forms.AnchorStyles.Left)360 | System.Windows.Forms.AnchorStyles.Right)));361 this.runCollectionView.Caption = "RunCollection View";362 this.runCollectionView.Content = null;363 this.runCollectionView.Location = new System.Drawing.Point(0, 3);364 this.runCollectionView.Name = "runCollectionView";365 this.runCollectionView.ReadOnly = false;366 this.runCollectionView.Size = new System.Drawing.Size(727, 366);367 this.runCollectionView.TabIndex = 0;368 //369 369 // HiveExperimentView 370 370 // 371 371 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 372 372 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 373 this.Controls.Add(this.reconnectButton);374 this.Controls.Add(this.disconnectButton);375 373 this.Controls.Add(this.resourceIdsTextBox); 376 374 this.Controls.Add(this.serverUrlTextBox); 377 375 this.Controls.Add(this.resourceIdsLabel); 378 376 this.Controls.Add(this.tabControl); 377 this.Controls.Add(this.disconnectButton); 379 378 this.Controls.Add(this.startButton); 380 379 this.Controls.Add(this.executionTimeTextBox); … … 384 383 this.Controls.Add(this.stopButton); 385 384 this.Controls.Add(this.resetButton); 385 this.Controls.Add(this.reconnectButton); 386 386 this.Name = "HiveExperimentView"; 387 387 this.Size = new System.Drawing.Size(735, 524); 388 this.Controls.SetChildIndex(this.reconnectButton, 0); 388 389 this.Controls.SetChildIndex(this.resetButton, 0); 389 390 this.Controls.SetChildIndex(this.stopButton, 0); … … 393 394 this.Controls.SetChildIndex(this.executionTimeTextBox, 0); 394 395 this.Controls.SetChildIndex(this.startButton, 0); 396 this.Controls.SetChildIndex(this.disconnectButton, 0); 395 397 this.Controls.SetChildIndex(this.tabControl, 0); 396 398 this.Controls.SetChildIndex(this.resourceIdsLabel, 0); 397 399 this.Controls.SetChildIndex(this.serverUrlTextBox, 0); 398 400 this.Controls.SetChildIndex(this.resourceIdsTextBox, 0); 399 this.Controls.SetChildIndex(this.disconnectButton, 0);400 this.Controls.SetChildIndex(this.reconnectButton, 0);401 401 this.Controls.SetChildIndex(this.nameLabel, 0); 402 402 this.Controls.SetChildIndex(this.descriptionLabel, 0); … … 407 407 this.experimentTabPage.ResumeLayout(false); 408 408 this.hiveStatusTabPage.ResumeLayout(false); 409 this.runsTabPage.ResumeLayout(false); 409 410 this.logTabPage.ResumeLayout(false); 410 this.runsTabPage.ResumeLayout(false);411 411 this.ResumeLayout(false); 412 412 this.PerformLayout(); -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Experiment.Views/3.3/HiveExperimentView.resx
r4144 r4173 128 128 <value> 129 129 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 130 YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAALD QAA131 Cw 0B7QfALAAAAn9JREFUOE+lk2tI01EYxhf0oU8WqVEIRpaIBWJgSPUhROmippS3QkkTylsXDMW8ts3b130 YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAALDAAA 131 CwwBP0AiyAAAAn9JREFUOE+lk2tI01EYxhf0oU8WqVEIRpaIBWJgSPUhROmippS3QkkTylsXDMW8ts3b 132 132 1G06daVibuqaOq0sxbBCKBSJ0PJCialZUFSKqaGSt1//TbIsww8deOBwznl+5zkv71kHiP5rGAFrKb1Q 133 133 5ypR6bmaVU6m2kCiXJv007Om2XgwJEaNT4QiyDi/GF9mKRVgsWkav+CYQkR1utwAQfypphqZ4l/JIhOL … … 146 146 <value> 147 147 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 148 YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAALD QAA149 Cw 0B7QfALAAAAaJJREFUOE+Nkk1LAkEYx5egU9Sla9AX6NKhLlH3IujSoXtBn0EI+gB5qVBIKyIMtEDo148 YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAALDAAA 149 CwwBP0AiyAAAAaJJREFUOE+Nkk1LAkEYx5egU9Sla9AX6NKhLlH3IujSoXtBn0EI+gB5qVBIKyIMtEDo 150 150 BUIhK6qDSUj4gqYloilmvqa5rrr/Zlx3dkU0B/48z87O/zfzPDMcAE7SOg8sB2AkqYdIXIoAK4LyX17X 151 151 HiVzYPhC0NBUB1yR6Jfy5lx59rQXRAKEhl6Y4YhMnXOSmUDywRlYHV5YbG6YLp1UW2pgEyBoSdARbdNP … … 160 160 <value> 161 161 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 162 YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAALA gAA163 Cw IBm8luNgAAALZJREFUOE9j/P//PwNFAGQAOi7bn+2GTRybGIZmkKKEGRH/iTUEpwGWZfpEGYLVgKgp162 YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAALAQAA 163 CwEBNnBPWwAAALZJREFUOE9j/P//PwNFAGQAOi7bn+2GTRybGIZmkKKEGRH/iTUEpwGWZfpEGYLVgKgp 164 164 Qf833Fr8nxhDsBoQPMEbZDtRhmA1wKfLGWwACEctCsDrEqwGODZb/M/YEAvWbNus/1+nWOG/RBo3iFZD 165 165 jwmsBpjX6KFo5k9gwaoZnIawxa1eqTLcZnyacRqgki8FdjYhzTgNkM4QJEozTgNEkjlx+pmoQMQW2rjy … … 170 170 <value> 171 171 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 172 YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAALA gAA173 Cw IBm8luNgAAAXJJREFUOE+tkj1IQmEYhWsoaIi2xmhpiYSgKFoiCMLJJYSEJiEI0mgIyqjA6vaLUKIU172 YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAALAQAA 173 CwEBNnBPWwAAAXJJREFUOE+tkj1IQmEYhWsoaIi2xmhpiYSgKFoiCMLJJYSEJiEI0mgIyqjA6vaLUKIU 174 174 iZlJKKUoWEbZDzVYCYlQYVxcNDIoRND8ud7idD83C27g7YNvPM8573nfcgBlgh4BCPmCxIX0Qtx/ATTu 175 175 Lyy78ph3ZKC2pTBlSWB86w2jhleMrD9jWB9N/jQsSkDEj5FPPERZ+J7yOL5j4PYzsPsYGL1piKR7nL64 … … 183 183 <value> 184 184 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 185 YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAALA gAA186 Cw IBm8luNgAAAYNJREFUOE9j/P//PwNFAGQAJZgizWDXI9veu/nvfxhuW/vtf+OKz/9rF7//XzHv1f+S185 YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAALAQAA 186 CwEBNnBPWwAAAYNJREFUOE9j/P//PwNFAGQAJZgizWDXI9veu/nvfxhuW/vtf+OKz/9rF7//XzHv1f+S 187 187 2c//F0x//L901mOgFoSrUQzo2vDr/6aT3/6vPPTl/4I9n/5ffvDzf+/ad/+bl74BG5I3/cV/3dBVuA0A 188 188 2bri4Jf/83Z9+n/ryS+Qwv8NS978L5378n/O1Of/k3qf/Vf1W4TbAJCT5+z49P/hyx9gzSBQMvvl/6wp … … 196 196 <value> 197 197 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 198 YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAALAgAA199 CwIBm8luNgAAAMZJREFUOE9j/P//PwNFAGQAJZgizWDXU2I7VgN6N//937Xh1/+8qY8+gRSg89EtxHAB200 SPPVh3/+64auAqr9z4DOJ2hA29pv/289/f1f1W8R2AB0PkEDGld8/n/54e//cm6zwAag8wkaULv4/f8T201 13//F7ObBDYAnU/QgIp5r/7vvvDzP79ZN9gAdD5BA0pmP/+//uTP/5wGrWAD0PkEDSiY/vj/gj2f/7Pq202 NIINQOcTNAAU/2y6TXAD0PkEDSA1ZVI/KZPqAgBmE8VVB/UQsAAAAABJRU5ErkJggg==203 </value>204 </data>205 <data name="disconnectButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">206 <value>207 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8208 198 YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAALAQAA 209 199 CwEBNnBPWwAAAMZJREFUOE9j/P//PwNFAGQAJZgizWDXU2I7VgN6N//937Xh1/+8qY8+gRSg89EtxHAB … … 213 203 </value> 214 204 </data> 215 <data name="reconnectButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">216 <value>217 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8218 YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAALAAAA219 CwAB5DetvwAAAMZJREFUOE9j/P//PwNFAGQAJZgizWDXU2I7VgN6N//937Xh1/+8qY8+gRSg89EtxHAB220 SPPVh3/+64auAqr9z4DOJ2hA29pv/289/f1f1W8R2AB0PkEDGld8/n/54e//cm6zwAag8wkaULv4/f8T221 13//F7ObBDYAnU/QgIp5r/7vvvDzP79ZN9gAdD5BA0pmP/+//uTP/5wGrWAD0PkEDSiY/vj/gj2f/7Pq222 NIINQOcTNAAU/2y6TXAD0PkEDSA1ZVI/KZPqAgBmE8VVB/UQsAAAAABJRU5ErkJggg==223 </value>224 </data>225 205 </root> -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Experiment.Views/3.3/JobItemView.Designer.cs
r4170 r4173 262 262 this.snapshotGroupBox.TabStop = false; 263 263 this.snapshotGroupBox.Text = "Latest Snapshot"; 264 this.snapshotGroupBox.Visible = false; 264 265 // 265 266 // requestSnapshotButton … … 433 434 this.logTabPage.Name = "logTabPage"; 434 435 this.logTabPage.Padding = new System.Windows.Forms.Padding(3); 435 this.logTabPage.Size = new System.Drawing.Size( 545, 453);436 this.logTabPage.Size = new System.Drawing.Size(619, 492); 436 437 this.logTabPage.TabIndex = 1; 437 438 this.logTabPage.Text = "Log"; -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Experiment.Views/3.3/JobItemView.cs
r4170 r4173 102 102 103 103 protected override void SetEnabledStateOfControls() { 104 base.SetEnabledStateOfControls(); 105 if (Content != null) { 106 openSnapshotButton.Enabled = Content.LatestSnapshot != null && Content.SnapshotRequestedState == SnapshotRequestedState.Idle; 107 requestSnapshotButton.Enabled = Content.SnapshotRequestedState == SnapshotRequestedState.Idle; 104 if (InvokeRequired) { 105 this.InvokeIfRequired(c => { SetEnabledStateOfControls(); }); 106 } else { 107 base.SetEnabledStateOfControls(); 108 if (Content != null) { 109 openSnapshotButton.Enabled = Content.LatestSnapshot != null && Content.SnapshotRequestedState == SnapshotRequestedState.Idle; 110 requestSnapshotButton.Enabled = Content.SnapshotRequestedState == SnapshotRequestedState.Idle; 111 } 112 this.jobIdTextBox.ReadOnly = this.ReadOnly; 113 this.stateTextBox.ReadOnly = this.ReadOnly; 114 this.userIdTextBox.ReadOnly = this.ReadOnly; 115 this.percentageTextBox.ReadOnly = this.ReadOnly; 116 this.dateCreatedTextBox.ReadOnly = this.ReadOnly; 117 this.dateCalculatedText.ReadOnly = this.ReadOnly; 118 this.dateFinishedTextBox.ReadOnly = this.ReadOnly; 119 this.priorityTextBox.ReadOnly = this.ReadOnly; 120 this.coresNeededTextBox.ReadOnly = this.ReadOnly; 121 this.memoryNeededTextBox.ReadOnly = this.ReadOnly; 122 this.exceptionTextBox.ReadOnly = this.ReadOnly; 123 this.projectTextBox.ReadOnly = this.ReadOnly; 124 this.snapshotStatusText.ReadOnly = this.ReadOnly; 125 this.snapshotTimeText.ReadOnly = this.ReadOnly; 108 126 } 109 this.jobIdTextBox.ReadOnly = this.ReadOnly;110 this.stateTextBox.ReadOnly = this.ReadOnly;111 this.userIdTextBox.ReadOnly = this.ReadOnly;112 this.percentageTextBox.ReadOnly = this.ReadOnly;113 this.dateCreatedTextBox.ReadOnly = this.ReadOnly;114 this.dateCalculatedText.ReadOnly = this.ReadOnly;115 this.dateFinishedTextBox.ReadOnly = this.ReadOnly;116 this.priorityTextBox.ReadOnly = this.ReadOnly;117 this.coresNeededTextBox.ReadOnly = this.ReadOnly;118 this.memoryNeededTextBox.ReadOnly = this.ReadOnly;119 this.exceptionTextBox.ReadOnly = this.ReadOnly;120 this.projectTextBox.ReadOnly = this.ReadOnly;121 this.snapshotStatusText.ReadOnly = this.ReadOnly;122 this.snapshotTimeText.ReadOnly = this.ReadOnly;123 127 } 124 128 -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Experiment/3.3/HiveExperiment.cs
r4170 r4173 65 65 private Semaphore fetchJobSemaphore = new Semaphore(2, 2); 66 66 67 [Storable] 68 private DateTime lastUpdateTime; 67 private bool stopResultsPollingPending = false; 68 69 private Thread resultPollingThread; 69 70 70 71 private bool isPollingResults; … … 79 80 } 80 81 81 private bool stopResultsPollingPending = false; 82 83 private Thread resultPollingThread; 82 public IEnumerable<string> ResourceGroups { 83 get { 84 if (!string.IsNullOrEmpty(resourceIds)) { 85 return resourceIds.Split(';'); 86 } else { 87 return new List<string>(); 88 } 89 } 90 } 91 92 #region Storable Properties 93 [Storable] 94 private DateTime lastUpdateTime; 84 95 85 96 /// <summary> … … 146 157 get { return log; } 147 158 } 159 160 [Storable] 161 private Core.ExecutionState executionState; 162 public ExecutionState ExecutionState { 163 get { return executionState; } 164 private set { 165 if (executionState != value) { 166 executionState = value; 167 OnExecutionStateChanged(); 168 } 169 } 170 } 171 172 [Storable] 173 private TimeSpan executionTime; 174 public TimeSpan ExecutionTime { 175 get { return executionTime; } 176 private set { 177 if (executionTime != value) { 178 executionTime = value; 179 OnExecutionTimeChanged(); 180 } 181 } 182 } 183 #endregion 148 184 149 185 [StorableConstructor] … … 198 234 } 199 235 236 #region Execution Time Timer 200 237 private void InitTimer() { 201 238 timer = new System.Timers.Timer(100); … … 209 246 lastUpdateTime = now; 210 247 } 211 212 public IEnumerable<string> ResourceGroups { 213 get { 214 if (!string.IsNullOrEmpty(resourceIds)) { 215 return resourceIds.Split(';'); 216 } else { 217 return new List<string>(); 218 } 219 } 220 } 221 #region IExecutable Members 222 223 [Storable] 224 private Core.ExecutionState executionState; 225 public ExecutionState ExecutionState { 226 get { return executionState; } 227 private set { 228 if (executionState != value) { 229 executionState = value; 230 OnExecutionStateChanged(); 231 } 232 } 233 } 234 235 [Storable] 236 private TimeSpan executionTime; 237 public TimeSpan ExecutionTime { 238 get { return executionTime; } 239 private set { 240 if (executionTime != value) { 241 executionTime = value; 242 OnExecutionTimeChanged(); 243 } 244 } 245 } 246 248 #endregion 249 250 #region IExecutable Methods 247 251 public void Pause() { 248 252 throw new NotSupportedException(); … … 252 256 if (experiment != null) { 253 257 StopResultPolling(); 254 pendingOptimizersByJobId.Clear(); 258 lock (pendingOptimizersByJobId) { 259 pendingOptimizersByJobId.Clear(); 260 } 255 261 parentOptimizersByPendingOptimizer.Clear(); 256 jobItems.Clear(); 262 lock (jobItems) { 263 jobItems.Clear(); 264 } 257 265 experiment.Prepare(); 258 266 this.ExecutionState = Core.ExecutionState.Prepared; … … 262 270 263 271 public void Start() { 272 sendingJobsFinished = false; 264 273 OnStarted(); 265 274 ExecutionTime = new TimeSpan(); … … 270 279 Thread t = new Thread(() => { 271 280 IExecutionEngineFacade executionEngineFacade = GetExecutionEngineFacade(); 272 281 273 282 try { 274 283 pendingOptimizersByJobId = new Dictionary<Guid, IOptimizer>(); … … 277 286 parentOptimizersByPendingOptimizer = GetOptimizers(true); 278 287 LogMessage("Extraction of jobs from Experiment finished"); 279 288 280 289 IEnumerable<string> groups = ResourceGroups; 281 290 282 sendingJobsFinished = false;283 291 foreach (IOptimizer optimizer in parentOptimizersByPendingOptimizer.Keys) { 284 292 SerializedJob serializedJob = CreateSerializedJob(optimizer); 285 293 ResponseObject<JobDto> response = executionEngineFacade.AddJobWithGroupStrings(serializedJob, groups); 286 pendingOptimizersByJobId.Add(response.Obj.Id, optimizer); 294 lock (pendingOptimizersByJobId) { 295 pendingOptimizersByJobId.Add(response.Obj.Id, optimizer); 296 } 287 297 288 298 JobItem jobItem = new JobItem() { … … 296 306 LogMessage(jobItem.JobDto.Id, "Job sent to Hive"); 297 307 } 298 sendingJobsFinished = true;299 308 } catch (Exception e) { 300 309 LogMessage("Error: Starting HiveExperiment failed: " + e.Message); … … 303 312 } 304 313 314 sendingJobsFinished = true; 305 315 }); 306 316 t.Start(); … … 314 324 OnStopped(); 315 325 } 316 317 public void StartResultPolling() { 318 this.stopResultsPollingPending = false; 319 this.IsPollingResults = true; 320 resultPollingThread = CreateResultPollingThread(); 321 if (resultPollingThread.ThreadState != System.Threading.ThreadState.Running) 322 resultPollingThread.Start(); 323 } 324 325 public void StopResultPolling() { 326 this.stopResultsPollingPending = true; 327 resultPollingThread.Interrupt(); 328 this.stopResultsPollingPending = false; 329 } 330 331 private JobItem GetJobItemById(Guid jobId) { 332 return jobItems.Single(x => x.JobDto.Id == jobId); 333 } 334 326 #endregion 327 328 #region Optimizier Management 335 329 /// <summary> 336 330 /// Returns all optimizers in the current Experiment … … 381 375 optimizer.Name = prepend + optimizer.Name; 382 376 optimizers.Add(optimizer, parent); 377 LogMessage("Optimizer extracted: " + optimizer.Name); 383 378 } else { 384 379 Logger.Warn("Optimizer of type " + optimizers.GetType().ToString() + " unknown"); 385 380 optimizer.Name = prepend + optimizer.Name; 386 381 optimizers.Add(optimizer, parent); 382 LogMessage("Optimizer extracted: " + optimizer.Name); 387 383 } 388 384 return optimizers; 389 }390 391 private void AddRange(IDictionary<IOptimizer, IOptimizer> optimizers, IDictionary<IOptimizer, IOptimizer> childs) {392 foreach (KeyValuePair<IOptimizer, IOptimizer> kvp in childs) {393 optimizers.Add(kvp);394 }395 385 } 396 386 … … 414 404 } 415 405 406 private bool NoMorePendingOptimizers() { 407 lock (pendingOptimizersByJobId) { 408 return pendingOptimizersByJobId.Count == 0; 409 } 410 } 411 412 /// <summary> 413 /// Removes optimizers from 414 /// - parentOptimizersByPendingOptimizer 415 /// - pendingOptimizersByJobId 416 /// </summary> 417 /// <param name="jobId"></param> 418 private void DisposeOptimizerMappings(Guid jobId) { 419 lock (pendingOptimizersByJobId) { 420 LogMessage(jobId, "Disposing Optimizer Mappings"); 421 parentOptimizersByPendingOptimizer.Remove(pendingOptimizersByJobId[jobId]); 422 pendingOptimizersByJobId.Remove(jobId); 423 } 424 } 425 426 #endregion 427 428 #region Job Management 429 /// <summary> 430 /// Updates all JobItems with the results 431 /// </summary> 432 /// <param name="jobResultList"></param> 433 private void UpdateJobItems(JobResultList jobResultList) { 434 // use a Dict to avoid quadratic runtime complexity 435 IDictionary<Guid, JobResult> jobResultDict = jobResultList.ToDictionary(job => job.JobId); 436 lock (jobItems) { 437 foreach (JobItem jobItem in JobItems) { 438 if (jobResultDict.ContainsKey(jobItem.JobDto.Id)) { 439 jobItem.JobResult = jobResultDict[jobItem.JobDto.Id]; 440 } 441 } 442 } 443 } 444 445 private void JobItem_JobStateChanged(object sender, EventArgs e) { 446 JobItem jobItem = (JobItem)sender; 447 Thread t = new Thread(() => { 448 if (jobItem.State == State.Finished) { 449 FetchAndUpdateJob(jobItem.JobDto.Id); 450 DisposeOptimizerMappings(jobItem.JobDto.Id); 451 } else if (jobItem.State == State.Failed) { 452 DisposeOptimizerMappings(jobItem.JobDto.Id); 453 } 454 455 if (NoMorePendingOptimizers()) { 456 StopResultPolling(); 457 this.ExecutionState = Core.ExecutionState.Stopped; 458 OnStopped(); 459 } 460 }); 461 t.Start(); 462 } 463 464 /// <summary> 465 /// Fetches the finished job from the server and updates the jobItem 466 /// </summary> 467 private void FetchAndUpdateJob(Guid jobId) { 468 LogMessage(jobId, "FetchAndUpdateJob started"); 469 IExecutionEngineFacade executionEngineFacade = GetExecutionEngineFacade(); 470 IOptimizer originalOptimizer; 471 lock (pendingOptimizersByJobId) { 472 originalOptimizer = pendingOptimizersByJobId[jobId]; 473 } 474 475 fetchJobSemaphore.WaitOne(); 476 ResponseObject<SerializedJob> jobResponse = executionEngineFacade.GetLastSerializedResult(jobId, false, false); 477 IJob restoredObject = XmlParser.Deserialize<IJob>(new MemoryStream(jobResponse.Obj.SerializedJobData)); 478 IOptimizer restoredOptimizer = ((OptimizerJob)restoredObject).Optimizer; 479 480 ReplaceOptimizer(parentOptimizersByPendingOptimizer[originalOptimizer], originalOptimizer, restoredOptimizer); 481 fetchJobSemaphore.Release(); 482 LogMessage(jobId, "FetchAndUpdateJob ended"); 483 } 484 485 private void UpdateJobItem(JobDto jobDto) { 486 JobItem jobItem = jobItems.Single(x => x.JobDto.Id == jobDto.Id); 487 jobItem.JobDto = jobDto; 488 } 489 416 490 public void AbortJob(Guid jobId) { 417 491 IExecutionEngineFacade executionEngineFacade = GetExecutionEngineFacade(); 418 492 Response response = executionEngineFacade.AbortJob(jobId); 419 493 LogMessage(jobId, "Aborting Job: " + response.StatusMessage); 420 }421 422 #endregion423 424 private IExecutionEngineFacade GetExecutionEngineFacade() {425 IExecutionEngineFacade executionEngineFacade = null;426 do {427 try {428 executionEngineFacade = ServiceLocator.CreateExecutionEngineFacade(ServerUrl);429 } catch (EndpointNotFoundException exception) {430 LogMessage("Could not connect to Server: " + exception.Message + ". Will try again in " + (resultPollingIntervalMs / 1000) + " sec.");431 Thread.Sleep(resultPollingIntervalMs);432 }433 } while (executionEngineFacade == null && this.ExecutionState != Core.ExecutionState.Stopped);434 return executionEngineFacade;435 494 } 436 495 … … 470 529 } 471 530 472 /// <summary> 473 /// Requests a resultList for all jobItems not finished or aborted 474 /// </summary> 475 /// <returns></returns> 531 private JobItem GetJobItemById(Guid jobId) { 532 return jobItems.Single(x => x.JobDto.Id == jobId); 533 } 534 #endregion 535 536 #region Result Polling 537 public void StartResultPolling() { 538 this.stopResultsPollingPending = false; 539 this.IsPollingResults = true; 540 resultPollingThread = CreateResultPollingThread(); 541 if (resultPollingThread.ThreadState != System.Threading.ThreadState.Running) 542 resultPollingThread.Start(); 543 } 544 545 public void StopResultPolling() { 546 this.stopResultsPollingPending = true; 547 resultPollingThread.Interrupt(); 548 this.stopResultsPollingPending = false; 549 } 550 476 551 private Thread CreateResultPollingThread() { 477 552 return new Thread(() => { … … 512 587 } 513 588 514 /// <summary> 515 /// Updates all JobItems with the results 516 /// </summary> 517 /// <param name="jobResultList"></param> 518 private void UpdateJobItems(JobResultList jobResultList) { 519 // use a Dict to avoid quadratic runtime complexity 520 IDictionary<Guid, JobResult> jobResultDict = jobResultList.ToDictionary(job => job.JobId); 521 lock (jobItems) { 522 foreach (JobItem jobItem in JobItems) { 523 if (jobResultDict.ContainsKey(jobItem.JobDto.Id)) { 524 jobItem.JobResult = jobResultDict[jobItem.JobDto.Id]; 525 } 526 } 527 } 528 } 529 530 void JobItem_JobStateChanged(object sender, EventArgs e) { 531 JobItem jobItem = (JobItem)sender; 532 Thread t = new Thread(() => { 533 if (jobItem.State == State.Finished) { 534 FetchAndUpdateJob(jobItem.JobDto.Id); 535 DisposeOptimizerMappings(jobItem.JobDto.Id); 536 } else if (jobItem.State == State.Failed) { 537 DisposeOptimizerMappings(jobItem.JobDto.Id); 538 } 539 540 if (NoMorePendingOptimizers()) { 541 StopResultPolling(); 542 this.ExecutionState = Core.ExecutionState.Stopped; 543 OnStopped(); 544 } 545 }); 546 t.Start(); 547 } 548 549 private bool NoMorePendingOptimizers() { 550 return pendingOptimizersByJobId.Count == 0; 551 } 552 553 /// <summary> 554 /// Removes optimizers from 555 /// - parentOptimizersByPendingOptimizer 556 /// - pendingOptimizersByJobId 557 /// </summary> 558 /// <param name="jobId"></param> 559 private void DisposeOptimizerMappings(Guid jobId) { 560 parentOptimizersByPendingOptimizer.Remove(pendingOptimizersByJobId[jobId]); 561 pendingOptimizersByJobId.Remove(jobId); 562 } 563 564 /// <summary> 565 /// Fetches the finished job from the server and updates the jobItem 566 /// </summary> 567 private void FetchAndUpdateJob(Guid jobId) { 568 LogMessage(jobId, "FetchAndUpdateJob started"); 569 IExecutionEngineFacade executionEngineFacade = GetExecutionEngineFacade(); 570 IOptimizer originalOptimizer = pendingOptimizersByJobId[jobId]; 571 572 fetchJobSemaphore.WaitOne(); 573 ResponseObject<SerializedJob> jobResponse = executionEngineFacade.GetLastSerializedResult(jobId, false, false); 574 UpdateSnapshot(jobResponse); 575 576 IJob restoredObject = XmlParser.Deserialize<IJob>(new MemoryStream(jobResponse.Obj.SerializedJobData)); 577 IOptimizer restoredOptimizer = ((OptimizerJob)restoredObject).Optimizer; 578 579 ReplaceOptimizer(parentOptimizersByPendingOptimizer[originalOptimizer], originalOptimizer, restoredOptimizer); 580 fetchJobSemaphore.Release(); 581 LogMessage(jobId, "FetchAndUpdateJob ended"); 582 } 583 584 //// ensure that not all resultPollingThreads can access the server simultaniously 585 //private Semaphore resultPollingSemaphore = new Semaphore(5, 5); 586 587 //private Thread CreateResultPollingThread(JobDto job) { 588 // return new Thread(() => { 589 // try { 590 // GetJobItemById(job.Id).LogMessage("Starting job results polling"); 591 // IExecutionEngineFacade executionEngineFacade = GetExecutionEngineFacade(); 592 // IJob restoredObject = null; 593 // IOptimizer originalOptimizer = pendingOptimizersByJobId[job.Id]; 594 595 // do { 596 // // loop while 597 // // 1. the user doesn't request an abort 598 // // 2. there is a problem with server communication (success==false) 599 // // 3. no result for the job is available yet (response.Obj==null) 600 // // 4. the result that we get from the server is a snapshot and not the final result 601 // try { 602 // resultPollingSemaphore.WaitOne(); 603 // if (stopPending || !this.IsPollingResults) { 604 // return; 605 // } 606 607 // ResponseObject<JobDto> response = null; 608 // try { 609 // response = executionEngineFacade.GetJobById(job.Id); 610 // LogMessage("Response: " + response.StatusMessage + " (jobId: " + job.Id + ")"); 611 // GetJobItemById(job.Id).LogMessage("Response: " + response.StatusMessage); 612 613 // UpdateJobItem(response.Obj); 614 615 // if (response.Obj.State == State.Abort) { 616 // pendingOptimizersByJobId.Remove(job.Id); 617 // parentOptimizersByPendingOptimizer.Remove(originalOptimizer); 618 // GetJobItemById(job.Id).LogMessage("Job successfully aborted"); 619 // return; 620 // } 621 622 // if (response.Obj.State == State.Failed) { 623 // pendingOptimizersByJobId.Remove(job.Id); 624 // parentOptimizersByPendingOptimizer.Remove(originalOptimizer); 625 // GetJobItemById(job.Id).LogMessage("Job failed with exception: " + response.Obj.Exception); 626 // return; 627 // } 628 // } catch (Exception e) { 629 // LogMessage("Error: Result polling failed for job (" + job.Id + "): " + e.Message); 630 // GetJobItemById(job.Id).LogMessage("Error: Result polling failed: " + e.Message); 631 // } 632 633 // if (response != null && response.Success && response.Obj != null && response.Obj.State == State.Finished) { 634 // try { 635 // ResponseObject<SerializedJob> jobResponse = executionEngineFacade.GetLastSerializedResult(job.Id, false, false); 636 // restoredObject = XmlParser.Deserialize<IJob>(new MemoryStream(jobResponse.Obj.SerializedJobData)); 637 // UpdateSnapshot(jobResponse); 638 // } catch (Exception e) { 639 // LogMessage("Error: Retrieving final result failed for job (" + job.Id + "): " + e.Message); 640 // GetJobItemById(job.Id).LogMessage("Error: Retrieving final result failed: " + e.Message); 641 // } 642 // } else { 643 // Thread.Sleep(resultPollingIntervalMs); 644 // } 645 // } finally { 646 // // use finally to always release the semaphore lock 647 // resultPollingSemaphore.Release(); 648 // } 649 // } while (restoredObject == null || restoredObject.ExecutionState != Core.ExecutionState.Stopped); 650 651 // LogMessage("Job finished (jobId: " + job.Id + ")"); 652 // GetJobItemById(job.Id).LogMessage("Job finished"); 653 // // job retrieved... replace the existing optimizers with the finished one 654 655 // IOptimizer restoredOptimizer = ((OptimizerJob)restoredObject).Optimizer; 656 657 // ReplaceOptimizer(parentOptimizersByPendingOptimizer[originalOptimizer], originalOptimizer, restoredOptimizer); 658 // pendingOptimizersByJobId.Remove(job.Id); 659 // parentOptimizersByPendingOptimizer.Remove(originalOptimizer); 660 661 // } catch (ThreadInterruptedException exception) { 662 663 // } finally { 664 // GetJobItemById(job.Id).LogMessage("ResultsPolling Thread stopped"); 665 // //lock (resultPollingThreads) { 666 // // resultPollingThreads.Remove(job.Id); 667 // // if (resultPollingThreads.Count == 0) { 668 // // IsPollingResults = false; 669 // // } 670 // //} 671 672 // // check if finished 673 // if (pendingOptimizersByJobId.Count == 0) { 674 // this.ExecutionState = Core.ExecutionState.Stopped; 675 // OnStopped(); 676 // } 677 // } 678 // }); 679 //} 680 681 private void UpdateJobItem(JobDto jobDto) { 682 JobItem jobItem = jobItems.Single(x => x.JobDto.Id == jobDto.Id); 683 jobItem.JobDto = jobDto; 684 } 589 #endregion 590 591 #region Snapshots 685 592 686 593 private void UpdateSnapshot(ResponseObject<SerializedJob> response) { … … 689 596 } 690 597 691 private void LogMessage(string message) { 692 // HeuristicLab.Log is not Thread-Safe, so lock on every call 693 lock (locker) { 694 log.LogMessage(message); 695 } 696 } 697 698 private void LogMessage(Guid jobId, string message) { 699 GetJobItemById(jobId).LogMessage(message); 700 LogMessage(message + " (jobId: " + jobId + ")"); 598 public void RequestSnapshot(Guid jobId) { 599 Thread t = new Thread(() => { 600 IExecutionEngineFacade executionEngineFacade = GetExecutionEngineFacade(); 601 ResponseObject<SerializedJob> response; 602 int retryCount = 0; 603 604 Response snapShotResponse = executionEngineFacade.RequestSnapshot(jobId); 605 if (snapShotResponse.StatusMessage == ApplicationConstants.RESPONSE_JOB_IS_NOT_BEEING_CALCULATED) { 606 // job already finished 607 Logger.Debug("HiveExperiment: Abort - GetLastResult(false)"); 608 response = executionEngineFacade.GetLastSerializedResult(jobId, false, false); 609 Logger.Debug("HiveExperiment: Abort - Server: " + response.StatusMessage + " success: " + response.Success); 610 } else { 611 // server sent snapshot request to client 612 // poll until snapshot is ready 613 do { 614 Thread.Sleep(snapshotPollingIntervalMs); 615 Logger.Debug("HiveExperiment: Abort - GetLastResult(true)"); 616 response = executionEngineFacade.GetLastSerializedResult(jobId, false, true); 617 Logger.Debug("HiveExperiment: Abort - Server: " + response.StatusMessage + " success: " + response.Success); 618 retryCount++; 619 // loop while 620 // 1. problem with communication with server 621 // 2. job result not yet ready 622 } while ( 623 (retryCount < maxSnapshotRetries) && ( 624 !response.Success || 625 response.StatusMessage == ApplicationConstants.RESPONSE_JOB_RESULT_NOT_YET_HERE) 626 ); 627 } 628 if (response.Success) { 629 LogMessage(jobId, "Snapshot polling successfull for job " + jobId); 630 UpdateSnapshot(response); 631 } else { 632 LogMessage(jobId, "Error: Polling of Snapshot failed for job " + jobId + ": " + response.StatusMessage); 633 } 634 }); 635 t.Start(); 701 636 } 702 637 … … 708 643 } 709 644 710 public void RequestSnapshot(Guid jobId) { 711 IExecutionEngineFacade executionEngineFacade = GetExecutionEngineFacade(); 712 ResponseObject<SerializedJob> response; 713 int retryCount = 0; 714 715 Response snapShotResponse = executionEngineFacade.RequestSnapshot(jobId); 716 if (snapShotResponse.StatusMessage == ApplicationConstants.RESPONSE_JOB_IS_NOT_BEEING_CALCULATED) { 717 // job already finished 718 Logger.Debug("HiveEngine: Abort - GetLastResult(false)"); 719 response = executionEngineFacade.GetLastSerializedResult(jobId, false, false); 720 Logger.Debug("HiveEngine: Abort - Server: " + response.StatusMessage + " success: " + response.Success); 721 } else { 722 // server sent snapshot request to client 723 // poll until snapshot is ready 724 do { 725 Thread.Sleep(snapshotPollingIntervalMs); 726 Logger.Debug("HiveEngine: Abort - GetLastResult(true)"); 727 response = executionEngineFacade.GetLastSerializedResult(jobId, false, true); 728 Logger.Debug("HiveEngine: Abort - Server: " + response.StatusMessage + " success: " + response.Success); 729 retryCount++; 730 // loop while 731 // 1. problem with communication with server 732 // 2. job result not yet ready 733 } while ( 734 (retryCount < maxSnapshotRetries) && ( 735 !response.Success || 736 response.StatusMessage == ApplicationConstants.RESPONSE_JOB_RESULT_NOT_YET_HERE) 737 ); 738 } 739 if (response.Success) { 740 LogMessage(jobId, "Snapshot polling successfull for job " + jobId); 741 GetJobItemById(jobId).LatestSnapshot = response; 742 } else { 743 LogMessage(jobId, "Error: Polling of Snapshot failed for job " + jobId + ": " + response.StatusMessage); 744 } 745 } 645 #endregion 746 646 747 647 #region Required Plugin Search … … 915 815 jobItems.ItemsRemoved += new CollectionItemsChangedEventHandler<IndexedItem<JobItem>>(jobItems_ItemsRemoved); 916 816 jobItems.ItemsReplaced += new CollectionItemsChangedEventHandler<IndexedItem<JobItem>>(jobItems_ItemsReplaced); 817 foreach (JobItem jobItem in jobItems) { 818 RegisterJobItemEvents(jobItem); 819 } 917 820 } 918 821 … … 922 825 jobItems.ItemsRemoved -= new CollectionItemsChangedEventHandler<IndexedItem<JobItem>>(jobItems_ItemsRemoved); 923 826 jobItems.ItemsReplaced -= new CollectionItemsChangedEventHandler<IndexedItem<JobItem>>(jobItems_ItemsReplaced); 827 foreach (JobItem jobItem in jobItems) { 828 DeregisterJobItemEvents(jobItem); 829 } 924 830 } 925 831 … … 931 837 if (e.OldItems != null) { 932 838 foreach (var item in e.OldItems) { 933 item.Value.SnapshotRequestedStateChanged -= new EventHandler(JobItem_SnapshotRequestedStateChanged); 934 item.Value.JobStateChanged -= new EventHandler(JobItem_JobStateChanged); 839 DeregisterJobItemEvents(item.Value); 935 840 } 936 841 } 937 842 if (e.Items != null) { 938 843 foreach (var item in e.Items) { 939 item.Value.JobStateChanged += new EventHandler(JobItem_JobStateChanged); 940 item.Value.SnapshotRequestedStateChanged += new EventHandler(JobItem_SnapshotRequestedStateChanged); 941 } 942 } 844 RegisterJobItemEvents(item.Value); 845 } 846 } 847 } 848 849 private void RegisterJobItemEvents(JobItem jobItem) { 850 jobItem.SnapshotRequestedStateChanged += new EventHandler(JobItem_SnapshotRequestedStateChanged); 851 jobItem.JobStateChanged += new EventHandler(JobItem_JobStateChanged); 852 } 853 854 private void DeregisterJobItemEvents(JobItem jobItem) { 855 jobItem.SnapshotRequestedStateChanged -= new EventHandler(JobItem_SnapshotRequestedStateChanged); 856 jobItem.JobStateChanged -= new EventHandler(JobItem_JobStateChanged); 943 857 } 944 858 … … 958 872 } 959 873 #endregion 874 875 #region Helper Functions 876 private IExecutionEngineFacade GetExecutionEngineFacade() { 877 IExecutionEngineFacade executionEngineFacade = null; 878 do { 879 try { 880 executionEngineFacade = ServiceLocator.CreateExecutionEngineFacade(ServerUrl); 881 } catch (EndpointNotFoundException exception) { 882 LogMessage("Could not connect to Server: " + exception.Message + ". Will try again in " + (resultPollingIntervalMs / 1000) + " sec."); 883 Thread.Sleep(resultPollingIntervalMs); 884 } 885 } while (executionEngineFacade == null && this.ExecutionState != Core.ExecutionState.Stopped); 886 return executionEngineFacade; 887 } 888 889 890 private void AddRange(IDictionary<IOptimizer, IOptimizer> optimizers, IDictionary<IOptimizer, IOptimizer> childs) { 891 foreach (KeyValuePair<IOptimizer, IOptimizer> kvp in childs) { 892 optimizers.Add(kvp); 893 } 894 } 895 896 #endregion 897 898 #region Logging 899 private void LogMessage(string message) { 900 // HeuristicLab.Log is not Thread-Safe, so lock on every call 901 lock (locker) { 902 log.LogMessage(message); 903 } 904 } 905 906 private void LogMessage(Guid jobId, string message) { 907 GetJobItemById(jobId).LogMessage(message); 908 LogMessage(message + " (jobId: " + jobId + ")"); 909 } 910 911 #endregion 960 912 } 961 913 } -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Experiment/3.3/JobItem.cs
r4170 r4173 155 155 public event EventHandler JobStateChanged; 156 156 private void OnJobStateChanged() { 157 LogMessage("JobStateChanged ");157 LogMessage("JobStateChanged (State: " + this.State + ", Percentage: " + this.Percentage + ")"); 158 158 EventHandler handler = JobStateChanged; 159 159 if (handler != null) handler(this, EventArgs.Empty); -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.Core/3.3/ClientCommunicator.cs
r4170 r4173 349 349 response.Success = false; 350 350 response.StatusMessage = ApplicationConstants.RESPONSE_COMMUNICATOR_JOB_IS_NOT_BEEING_CALCULATED; 351 Logger.Error("There is no job calculated by this user " + hbData.ClientId); 351 352 foreach (Guid jobId in hbData.JobProgress.Keys) { 353 response.ActionRequest.Add(new MessageContainer(MessageContainer.MessageType.AbortJob, jobId)); 354 } 355 356 Logger.Error("There is no job calculated by this user " + hbData.ClientId + ", advise him to abort all"); 352 357 return; 353 358 } … … 359 364 response.Success = false; 360 365 response.StatusMessage = ApplicationConstants.RESPONSE_COMMUNICATOR_JOB_IS_NOT_BEEING_CALCULATED; 366 response.ActionRequest.Add(new MessageContainer(MessageContainer.MessageType.AbortJob, curJob.Id)); 361 367 Logger.Error("There is no job calculated by this user " + hbData.ClientId + " Job: " + curJob); 362 368 } else if (curJob.State == State.Abort) { … … 524 530 response.StatusMessage = ApplicationConstants.RESPONSE_COMMUNICATOR_NO_JOB_WITH_THIS_ID; 525 531 response.JobId = jobId; 526 527 532 Logger.Error("No job with Id " + jobId); 528 533 -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.Core/3.3/JobManager.cs
r4170 r4173 235 235 // [chn] [refactor] why does this method handle 3 different cases? wouldn't 3 methods be easier? 236 236 //Requested means: there MUST be a job result which gets sent back 237 // requested==true: resultat mit job 238 // requested==false: 237 239 public ResponseObject<SerializedJob> GetLastSerializedJobResultOf(Guid jobId, bool requested, bool snapshot) { 238 240 ResponseObject<SerializedJob> response = new ResponseObject<SerializedJob>();
Note: See TracChangeset
for help on using the changeset viewer.