Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/25/09 18:28:38 (15 years ago)
Author:
gkronber
Message:

Implemented discrimination of snapshots vs. end results in HiveEngine and Job. #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

    r2105 r2111  
    4343    private const int SNAPSHOT_POLLING_INTERVAL_MS = 1000;
    4444    private const int RESULT_POLLING_INTERVAL_MS = 10000;
     45    private const int MAX_SNAPSHOT_RETRIES = 20;
    4546    private Guid jobId;
    4647    private Job job;
     
    117118              HiveLogger.Debug("HiveEngine: Results-polling - Got result!");
    118119              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));
    120121            }
    121122          }
    122         } while (restoredJob == null || restoredJob.Engine.Canceled);
     123        } while (restoredJob == null || (restoredJob.Progress < 1.0));
    123124
    124125        job = restoredJob;
     
    133134    public void RequestSnapshot() {
    134135      IExecutionEngineFacade executionEngineFacade = ServiceLocator.CreateExecutionEngineFacade(HiveServerUrl);
    135 
     136      int retryCount = 0;
    136137      ResponseObject<SerializedJobResult> response;
    137138      lock (locker) {
     
    151152            response = executionEngineFacade.GetLastSerializedResult(jobId, true);
    152153            HiveLogger.Debug("HiveEngine: Abort - Server: " + response.StatusMessage + " success: " + response.Success);
     154            retryCount++;
    153155            // loop while
    154156            // 1. problem with communication with server
    155157            // 2. job result not yet ready
    156158          } while (
     159            (retryCount < MAX_SNAPSHOT_RETRIES) && (
    157160            !response.Success ||
    158             response.StatusMessage == ApplicationConstants.RESPONSE_JOB_RESULT_NOT_YET_HERE);
     161            response.StatusMessage == ApplicationConstants.RESPONSE_JOB_RESULT_NOT_YET_HERE)
     162            );
    159163        }
    160164      }
     
    180184    public void Abort() {
    181185      abortRequested = true;
    182       RequestSnapshot();
     186      // RequestSnapshot();
    183187      IExecutionEngineFacade executionEngineFacade = ServiceLocator.CreateExecutionEngineFacade(HiveServerUrl);
    184188      executionEngineFacade.AbortJob(jobId);
     
    195199
    196200    private HeuristicLab.Hive.Contracts.BusinessObjects.SerializedJob CreateJobObj() {
    197       HeuristicLab.Hive.Contracts.BusinessObjects.Job jobObj = 
     201      HeuristicLab.Hive.Contracts.BusinessObjects.Job jobObj =
    198202        new HeuristicLab.Hive.Contracts.BusinessObjects.Job();
    199203
Note: See TracChangeset for help on using the changeset viewer.