Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/06/10 09:20:18 (14 years ago)
Author:
cneumuel
Message:

refactoring of Result-Polling of HiveExperiment, polling is now much faster and code is cleaner (1092#)

Location:
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.Core/3.3
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.Core/3.3

    • Property svn:ignore
      •  

        old new  
        11bin
        22obj
         3HeuristicLab.Hive.Server.Core-3.3.csproj.user
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.Core/3.3/ClientCommunicator.cs

    r4141 r4170  
    469469      //tx = session.BeginTransaction();
    470470
    471       ResponseResultReceived response =
    472         ProcessJobResult(
    473         result.ClientId,
    474         result.JobId,
    475         new byte[] { },
    476         result.Percentage,
    477         result.Exception,
    478         finished);
     471      ResponseResultReceived response = ProcessJobResult(result.ClientId, result.JobId, new byte[] { }, result.Percentage, result.Exception, finished);
    479472
    480473      if (response.Success) {
     
    509502      Guid jobId,
    510503      byte[] result,
    511       double percentage,
    512       Exception exception,
     504      double? percentage,
     505      string exception,
    513506      bool finished) {
    514507
     
    522515      if (job != null) {
    523516        job.JobInfo = DaoLocator.JobDao.FindById(jobId);
    524         job.JobInfo.Client = job.JobInfo.Client = DaoLocator.ClientDao.GetClientForJob(jobId);
    525       }
    526 
    527       if (job == null && job.JobInfo != null) {
     517        if (job.JobInfo != null) {
     518          job.JobInfo.Client = job.JobInfo.Client = DaoLocator.ClientDao.GetClientForJob(jobId);
     519        }
     520      }
     521     
     522      if (job != null && job.JobInfo == null) {
    528523        response.Success = false;
    529524        response.StatusMessage = ApplicationConstants.RESPONSE_COMMUNICATOR_NO_JOB_WITH_THIS_ID;
     
    591586      job.JobInfo.Percentage = percentage;
    592587
    593       if (exception != null) {
     588      if (!string.IsNullOrEmpty(exception)) {
    594589        job.JobInfo.State = State.Failed;
    595         job.JobInfo.Exception = exception.ToString();
     590        job.JobInfo.Exception = exception;
    596591        job.JobInfo.DateFinished = DateTime.Now;
    597592      } else if (finished) {
     
    629624      byte[] result,
    630625      double percentage,
    631       Exception exception) {
     626      string exception) {
    632627
    633628      return ProcessJobResult(clientId, jobId, result, percentage, exception, true);
    634629    }
    635630
    636     public ResponseResultReceived ProcessSnapshot(Guid clientId, Guid jobId, byte[] result, double percentage, Exception exception) {
     631    public ResponseResultReceived ProcessSnapshot(Guid clientId, Guid jobId, byte[] result, double percentage, string exception) {
    637632      return ProcessJobResult(clientId, jobId, result, percentage, exception, false);
    638633    }
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.Core/3.3/Facades/ClientFacade.cs

    r4107 r4170  
    6767    }
    6868
    69     public ResponseResultReceived StoreFinishedJobResult(Guid clientId, Guid jobId, byte[] result, double percentage, Exception exception) {
     69    public ResponseResultReceived StoreFinishedJobResult(Guid clientId, Guid jobId, byte[] result, double percentage, string exception) {
    7070      using (contextFactory.GetContext()) {
    7171        return clientCommunicator.StoreFinishedJobResult(clientId, jobId, result, percentage, exception);
     
    8989    }
    9090
    91     public ResponseResultReceived ProcessSnapshot(Guid clientId, Guid jobId, byte[] result, double percentage, Exception exception) {
     91    public ResponseResultReceived ProcessSnapshot(Guid clientId, Guid jobId, byte[] result, double percentage, string exception) {
    9292      using (contextFactory.GetContext()) {
    9393        return clientCommunicator.ProcessSnapshot(clientId, jobId, result, percentage, exception);
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.Core/3.3/Facades/ExecutionEngineFacade.cs

    r4137 r4170  
    7575      }
    7676    }
     77
     78
     79    public ResponseObject<JobResultList> GetAllJobResults(IEnumerable<Guid> jobIds) {
     80      using (contextFactory.GetContext(false)) {
     81        return jobManager.GetAllJobResults(jobIds);
     82      }
     83    }
    7784    #endregion
     85
     86
    7887  }
    7988}
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.Core/3.3/Facades/ServerConsoleFacade.cs

    r4137 r4170  
    154154    }
    155155
    156     public ResponseList<JobResult> GetAllJobResults(Guid jobId) {
    157       using (contextFactory.GetContext(false)) {
    158         secMan.Authorize("AccessJobResults", sessionID, jobId);
    159         return jobManager.GetAllJobResults(jobId);
     156    public ResponseObject<JobResultList> GetAllJobResults(IEnumerable<Guid> jobIds) {
     157      using (contextFactory.GetContext(false)) {
     158        //secMan.Authorize("AccessJobResults", sessionID, jobId); skip authorization
     159        return jobManager.GetAllJobResults(jobIds);
    160160      }
    161161    }
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.Core/3.3/HeuristicLab.Hive.Server.Core-3.3.csproj

    r4133 r4170  
    165165  </ItemGroup>
    166166  <ItemGroup>
    167     <WCFMetadata Include="Service References\" />
    168   </ItemGroup>
    169   <ItemGroup>
    170167    <ProjectReference Include="..\..\HeuristicLab.DataAccess\3.3\HeuristicLab.DataAccess-3.3.csproj">
    171168      <Project>{9076697B-C151-46CD-95BC-1D059492B478}</Project>
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.Core/3.3/JobManager.cs

    r4121 r4170  
    320320    }
    321321
    322     public ResponseList<JobResult> GetAllJobResults(Guid jobId) {
    323       return new ResponseList<JobResult>();
     322    public ResponseObject<JobResultList> GetAllJobResults(IEnumerable<Guid> jobIds) {
     323      ResponseObject<JobResultList> response = new ResponseObject<JobResultList>();
     324      JobResultList jobResultList = new JobResultList();
     325      IEnumerable<JobDto> jobs = DaoLocator.JobDao.FindJobsById(jobIds);
     326      foreach (JobDto job in jobs) {
     327        jobResultList.Add(new JobResult() {
     328          JobId = job.Id,
     329          State = job.State,
     330          DateCalculated = job.DateCalculated,
     331          DateFinished = job.DateFinished,
     332          Exception = job.Exception,
     333          Percentage = job.Percentage
     334        });       
     335      }
     336      response.Obj = jobResultList;
     337      response.Success = true;
     338      response.StatusMessage = ApplicationConstants.RESPONSE_JOB_ALL_JOBS;
     339      return response;
    324340    }
    325341
Note: See TracChangeset for help on using the changeset viewer.