Changeset 2111
- Timestamp:
- 06/25/09 18:28:38 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.Hive.Engine/3.2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Hive.Engine/3.2/HiveEngine.cs
r2105 r2111 43 43 private const int SNAPSHOT_POLLING_INTERVAL_MS = 1000; 44 44 private const int RESULT_POLLING_INTERVAL_MS = 10000; 45 private const int MAX_SNAPSHOT_RETRIES = 20; 45 46 private Guid jobId; 46 47 private Job job; … … 117 118 HiveLogger.Debug("HiveEngine: Results-polling - Got result!"); 118 119 restoredJob = (Job)PersistenceManager.RestoreFromGZip(response.Obj.SerializedJobResultData); 119 HiveLogger.Debug("HiveEngine: Results-polling - IsSnapshotResult: " + restoredJob.Engine.Canceled);120 HiveLogger.Debug("HiveEngine: Results-polling - IsSnapshotResult: " + (restoredJob.Progress<1.0)); 120 121 } 121 122 } 122 } while (restoredJob == null || restoredJob.Engine.Canceled);123 } while (restoredJob == null || (restoredJob.Progress < 1.0)); 123 124 124 125 job = restoredJob; … … 133 134 public void RequestSnapshot() { 134 135 IExecutionEngineFacade executionEngineFacade = ServiceLocator.CreateExecutionEngineFacade(HiveServerUrl); 135 136 int retryCount = 0; 136 137 ResponseObject<SerializedJobResult> response; 137 138 lock (locker) { … … 151 152 response = executionEngineFacade.GetLastSerializedResult(jobId, true); 152 153 HiveLogger.Debug("HiveEngine: Abort - Server: " + response.StatusMessage + " success: " + response.Success); 154 retryCount++; 153 155 // loop while 154 156 // 1. problem with communication with server 155 157 // 2. job result not yet ready 156 158 } while ( 159 (retryCount < MAX_SNAPSHOT_RETRIES) && ( 157 160 !response.Success || 158 response.StatusMessage == ApplicationConstants.RESPONSE_JOB_RESULT_NOT_YET_HERE); 161 response.StatusMessage == ApplicationConstants.RESPONSE_JOB_RESULT_NOT_YET_HERE) 162 ); 159 163 } 160 164 } … … 180 184 public void Abort() { 181 185 abortRequested = true; 182 RequestSnapshot();186 // RequestSnapshot(); 183 187 IExecutionEngineFacade executionEngineFacade = ServiceLocator.CreateExecutionEngineFacade(HiveServerUrl); 184 188 executionEngineFacade.AbortJob(jobId); … … 195 199 196 200 private HeuristicLab.Hive.Contracts.BusinessObjects.SerializedJob CreateJobObj() { 197 HeuristicLab.Hive.Contracts.BusinessObjects.Job jobObj = 201 HeuristicLab.Hive.Contracts.BusinessObjects.Job jobObj = 198 202 new HeuristicLab.Hive.Contracts.BusinessObjects.Job(); 199 203 -
trunk/sources/HeuristicLab.Hive.Engine/3.2/Job.cs
r2089 r2111 55 55 56 56 void engine_Finished(object sender, EventArgs e) { 57 if (Engine.Canceled) this.progress = 0.0; 58 else this.progress = 1.0; 57 59 if (JobStopped != null) 58 60 JobStopped(this, new EventArgs()); … … 69 71 } 70 72 73 private double progress; 71 74 public double Progress { 72 75 get { 73 76 DoubleData progress = Engine.GlobalScope.GetVariableValue<DoubleData>("Progress", false, 74 77 false); 75 return progress == null ? 0.0: progress.Data;78 return progress == null ? this.progress : progress.Data; 76 79 } 77 80 set { throw new NotSupportedException(); } … … 105 108 XmlAttribute idAttr = document.CreateAttribute("JobId"); 106 109 idAttr.Value = XmlConvert.ToString(JobId); 110 XmlAttribute progressAttr = document.CreateAttribute("Progress"); 111 progressAttr.Value = XmlConvert.ToString(progress); 107 112 node.Attributes.Append(idAttr); 113 node.Attributes.Append(progressAttr); 108 114 node.AppendChild(PersistenceManager.Persist("Engine", Engine, document, persistedObjects)); 109 115 return node; … … 112 118 base.Populate(node, restoredObjects); 113 119 JobId = XmlConvert.ToInt64(node.Attributes["JobId"].Value); 120 progress = XmlConvert.ToDouble(node.Attributes["Progress"].Value); 114 121 DeregisterEvents(); 115 122 engine = (SequentialEngine.SequentialEngine)PersistenceManager.Restore(node.SelectSingleNode("Engine"), restoredObjects);
Note: See TracChangeset
for help on using the changeset viewer.