Free cookie consent management tool by TermsFeed Policy Generator

Changeset 4135


Ignore:
Timestamp:
08/03/10 11:18:39 (14 years ago)
Author:
cneumuel
Message:

added HeuristicLab.Hive.Tracing (#1092)

Location:
branches/3.3-HiveMigration/sources/HeuristicLab.Hive
Files:
4 added
6 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Experiment/3.3/HiveExperiment.cs

    r4133 r4135  
    270270    }
    271271
     272    public void Stop() {
     273      this.ExecutionState = Core.ExecutionState.Stopped;
     274      foreach (JobItem jobItem in jobItems) {
     275        AbortJob(jobItem.JobDto.Id);
     276      }
     277      OnStopped();
     278    }
     279
    272280    private void CreateResultPollingThreads() {
    273281      foreach(JobItem jobItem in JobItems) {
    274         resultPollingThreads.Add(jobItem.JobDto.Id, CreateResultPollingThread(jobItem.JobDto));
     282        if (!resultPollingThreads.ContainsKey(jobItem.JobDto.Id)) {
     283          resultPollingThreads.Add(jobItem.JobDto.Id, CreateResultPollingThread(jobItem.JobDto));
     284        }
    275285      }
    276286    }
     
    280290      CreateResultPollingThreads();
    281291      foreach (Thread pollingThread in resultPollingThreads.Values) {
    282         pollingThread.Start();
     292        if (pollingThread.ThreadState != System.Threading.ThreadState.Running) {
     293          pollingThread.Start();
     294        }
    283295      }
    284296      this.IsPollingResults = true;
     
    317329    }
    318330
    319     public void Stop() {
    320       foreach(JobItem jobItem in jobItems) {
    321         AbortJob(jobItem.JobDto.Id);
    322       }
    323     }
    324 
    325331    public void AbortJob(Guid jobId) {
    326332      IExecutionEngineFacade executionEngineFacade = GetExecutionEngineFacade();
    327       executionEngineFacade.AbortJob(jobId);
    328       resultPollingThreads[jobId].Interrupt();
    329       GetJobItemById(jobId).LogMessage("Aborting Job");
    330     }
     333      Response response = executionEngineFacade.AbortJob(jobId);
     334      GetJobItemById(jobId).LogMessage("Aborting Job: " + response.StatusMessage);
     335    }
     336
    331337    #endregion
    332338
     
    387393            GetJobItemById(job.Id).LogMessage("Response: " + response.StatusMessage);
    388394
    389             if (response.Obj != null) {
    390               UpdateJobItem(response.Obj);
    391             }
     395            UpdateJobItem(response.Obj);
     396
     397            if (response.Obj.State == State.Abort) {
     398              // job is aborted, don't poll for results anymore
     399              GetJobItemById(job.Id).LogMessage("Job successfully aborted");
     400              return;
     401            }           
    392402
    393403            // loop while
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Experiment/3.3/JobItem.cs

    r4133 r4135  
    1818    public override Image ItemImage {
    1919      get {
    20         if (jobDto.State == State.Offline) return HeuristicLab.Common.Resources.VS2008ImageLibrary.ExecutableStopped;
     20        if (jobDto.State == State.Offline) return HeuristicLab.Common.Resources.VS2008ImageLibrary.ExecutablePrepared;
    2121        else if (jobDto.State == State.Idle) return HeuristicLab.Common.Resources.VS2008ImageLibrary.ExecutableStopped;
    2222        else if (jobDto.State == State.Calculating) return HeuristicLab.Common.Resources.VS2008ImageLibrary.ExecutableStarted;
    2323        else if (jobDto.State == State.Offline) return HeuristicLab.Common.Resources.VS2008ImageLibrary.ExecutableStopped;
     24        else if (jobDto.State == State.Abort) return HeuristicLab.Common.Resources.VS2008ImageLibrary.ExecutableStopped;
    2425        else return HeuristicLab.Common.Resources.VS2008ImageLibrary.Event;
    2526      }
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.Core/3.3/ClientCommunicator.cs

    r4133 r4135  
    318318    /// <summary>
    319319    /// Process the Job progress sent by a client
     320    /// [chn] this method needs to be refactored, because its a performance hog
     321    ///
     322    /// what it does:
     323    /// (1) find out if the jobs that should be calculated by this client (from db) and compare if they are consistent with what the joblist the client sent
     324    /// (2) find out if every job from the joblist really should be calculated by this client
     325    /// (3) checks if a job should be aborted and issues Message
     326    /// (4) update job-progress and write to db
     327    /// (5) if snapshot is requested, issue Message
     328    ///
     329    /// (6) for each job from DB, check if there is a job from client (again).
     330    /// (7) if job matches, it is removed from newAssigneJobs
     331    /// (8) if job !matches, job's TTL is reduced by 1,
     332    /// (9) if TTL==0, job is set to Abort (save to DB), and Message to Abort job is issued to client
     333    ///
     334    ///
     335    ///
     336    /// quirks:
     337    /// (1) the response-object is modified during the foreach-loop (only last element counts)
     338    /// (2) state Abort results in Finished. This should be: AbortRequested, Aborted.
    320339    /// </summary>
    321340    /// <param name="hbData"></param>
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.LINQDataAccess/3.3/HeuristicLab.Hive.Server.LINQDataAccess-3.3.csproj

    r4133 r4135  
    152152  </ItemGroup>
    153153  <ItemGroup>
    154     <Content Include="HiveDataContext.xml" />
     154    <Content Include="HiveDataContext.xml">
     155      <SubType>Designer</SubType>
     156    </Content>
    155157  </ItemGroup>
    156158  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
Note: See TracChangeset for help on using the changeset viewer.