Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/08/11 16:38:28 (13 years ago)
Author:
ascheibe
Message:

#1233 more renaming for more consistency

File:
1 moved

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.3/TaskDownloader.cs

    r6721 r6725  
    2727
    2828namespace HeuristicLab.Clients.Hive {
    29   public class HiveJobDownloader {
    30     private IEnumerable<Guid> jobIds;
    31     private ConcurrentJobDownloader<ItemJob> jobDownloader;
    32     private IDictionary<Guid, HiveJob> results;
     29  public class TaskDownloader {
     30    private IEnumerable<Guid> taskIds;
     31    private ConcurrentTaskDownloader<ItemTask> taskDownloader;
     32    private IDictionary<Guid, HiveTask> results;
    3333    private bool exceptionOccured = false;
    3434    private Exception currentException;
     
    3636    public bool IsFinished {
    3737      get {
    38         return results.Count == jobIds.Count();
     38        return results.Count == taskIds.Count();
    3939      }
    4040    }
     
    5858    }
    5959
    60     public IDictionary<Guid, HiveJob> Results {
     60    public IDictionary<Guid, HiveTask> Results {
    6161      get {
    6262        return results;
     
    6464    }
    6565
    66     public HiveJobDownloader(IEnumerable<Guid> jobIds) {
    67       this.jobIds = jobIds;
    68       this.jobDownloader = new ConcurrentJobDownloader<ItemJob>(2, 2);
    69       this.jobDownloader.ExceptionOccured += new EventHandler<EventArgs<Exception>>(jobDownloader_ExceptionOccured);
    70       this.results = new Dictionary<Guid, HiveJob>();
     66    public TaskDownloader(IEnumerable<Guid> jobIds) {
     67      this.taskIds = jobIds;
     68      this.taskDownloader = new ConcurrentTaskDownloader<ItemTask>(2, 2);
     69      this.taskDownloader.ExceptionOccured += new EventHandler<EventArgs<Exception>>(taskDownloader_ExceptionOccured);
     70      this.results = new Dictionary<Guid, HiveTask>();
    7171    }
    7272   
    7373    public void StartAsync() {
    74       foreach (Guid jobId in jobIds) {
     74      foreach (Guid jobId in taskIds) {
    7575        Task job = ServiceLocator.Instance.CallHiveService(s => s.GetJob(jobId));
    7676
    77         jobDownloader.DownloadJob(job,
     77        taskDownloader.DownloadJob(job,
    7878          (localJob, itemJob) => {
    7979            if (localJob != null && itemJob != null) {
    80               HiveJob hiveJob;
    81               if (itemJob is OptimizerJob) {
    82                 hiveJob = new OptimizerHiveJob((OptimizerJob)itemJob);
     80              HiveTask hiveJob;
     81              if (itemJob is OptimizerTask) {
     82                hiveJob = new OptimizerHiveTask((OptimizerTask)itemJob);
    8383              } else {
    84                 hiveJob = new HiveJob(itemJob, true);
     84                hiveJob = new HiveTask(itemJob, true);
    8585              }
    86               hiveJob.Job = localJob;
     86              hiveJob.Task = localJob;
    8787              this.results.Add(localJob.Id, hiveJob);
    8888            }
     
    9191    }
    9292
    93     private void jobDownloader_ExceptionOccured(object sender, EventArgs<Exception> e) {
     93    private void taskDownloader_ExceptionOccured(object sender, EventArgs<Exception> e) {
    9494      OnExceptionOccured(e.Value);
    9595    }
Note: See TracChangeset for help on using the changeset viewer.