Free cookie consent management tool by TermsFeed Policy Generator

Changeset 1773


Ignore:
Timestamp:
05/08/09 14:29:06 (16 years ago)
Author:
gkronber
Message:

worked on snapshotting functionality of HiveEngine. #545 (Engine which can be executed in the Hive)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Hive.Engine/3.2/HiveEngine.cs

    r1754 r1773  
    125125      IExecutionEngineFacade executionEngineFacade = ServiceLocator.CreateExecutionEngineFacade(HiveServerUrl);
    126126
    127       //Requests the last result.
    128       //false: There will always be a result that is been sent back
    129       //true: if you hit "requestsnapshot" before - it won't send you the job back if
    130       //      the snapshot hasn't been submitted to the server (because the client needs
    131       //      more time).
    132       var result = executionEngineFacade.GetLastResult(jobId, false);
    133       if (result.Success) {
    134         JobResult jobResult = result.Obj;
     127      // request snapshot
     128      executionEngineFacade.RequestSnapshot(jobId);
     129
     130      // poll until snapshot is ready
     131      ResponseObject<JobResult> response;
     132      do {
     133        response = executionEngineFacade.GetLastResult(jobId, true);
     134        if (response.Success && response.StatusMessage == ApplicationConstants.RESPONSE_JOB_RESULT_NOT_YET_HERE) {
     135          Thread.Sleep(1000);
     136        }
     137      } while (response.Success && response.StatusMessage == ApplicationConstants.RESPONSE_JOB_RESULT_NOT_YET_HERE);
     138
     139      if (response.Success) {
     140        JobResult jobResult = response.Obj;
    135141        if (jobResult != null) {
    136142          job = (Job)PersistenceManager.RestoreFromGZip(jobResult.Result);
     
    138144        }
    139145      } else {
    140         Exception ex = new Exception(result.Obj.Exception.Message);
     146        Exception ex = new Exception(response.Obj.Exception.Message);
    141147        ThreadPool.QueueUserWorkItem(delegate(object state) { OnExceptionOccurred(ex); });
    142148      }
Note: See TracChangeset for help on using the changeset viewer.