Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/28/10 17:48:10 (14 years ago)
Author:
cneumuel
Message:

HiveExperiment is now able to send IOptimizers of an Experiment and receive the calculated result (#1115)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Client.Communication/3.3/WcfService.cs

    r4107 r4119  
    262262        Logger.Debug("STARTED: Sending back the finished job results");
    263263        Logger.Debug("Building stream");
    264         Stream stream =
    265           GetStreamedJobResult(clientId, jobId, result, percentage, exception);
     264        Stream stream = GetStreamedJobResult(clientId, jobId, result, percentage, exception);
    266265        Logger.Debug("Builded stream");
    267266        Logger.Debug("Making the call");
     
    269268      }
    270269    }
     270
    271271    private void proxy_StoreFinishedJobResultStreamedCompleted(object sender, StoreFinishedJobResultStreamedCompletedEventArgs e) {
    272272      Logger.Debug("Finished storing the job");
    273       Stream stream =
    274         (Stream)e.UserState;
     273      Stream stream = (Stream)e.UserState;
    275274      if (stream != null) {
    276275        Logger.Debug("Stream not null, disposing it");
     
    278277      }
    279278      if (e.Error == null) {
    280         StoreFinishedJobResultCompletedEventArgs args =
    281           new StoreFinishedJobResultCompletedEventArgs(
    282             new object[] { e.Result }, e.Error, e.Cancelled, e.UserState);
     279        StoreFinishedJobResultCompletedEventArgs args = new StoreFinishedJobResultCompletedEventArgs(new object[] { e.Result }, e.Error, e.Cancelled, e.UserState);
    283280        Logger.Debug("calling the Finished Job Event");
    284281        StoreFinishedJobResultCompleted(sender, args);
    285282        Logger.Debug("ENDED: Sending back the finished job results");
    286       } else
     283      } else {
    287284        HandleNetworkError(e.Error);
     285      }
    288286    }
    289287
     
    300298      }
    301299    }
     300
    302301    void proxy_ProcessSnapshotStreamedCompleted(object sender, ProcessSnapshotStreamedCompletedEventArgs e) {
    303302      Stream stream =
     
    350349    /// </summary>
    351350    private Stream GetStreamedJobResult(Guid clientId, Guid jobId, byte[] result, double percentage, Exception exception) {
    352       JobResult jobResult =
    353           new JobResult();
     351      JobResult jobResult = new JobResult();
    354352      jobResult.ClientId = clientId;
    355353      jobResult.JobId = jobId;
     
    357355      jobResult.Exception = exception;
    358356
    359       MultiStream stream =
    360               new MultiStream();
     357      MultiStream stream = new MultiStream();
    361358
    362359      //first send result
    363       stream.AddStream(
    364         new StreamedObject<JobResult>(jobResult));
     360      stream.AddStream(new StreamedObject<JobResult>(jobResult));
    365361
    366362      //second stream the job binary data
    367       MemoryStream memStream =
    368         new MemoryStream(result, false);
     363      MemoryStream memStream = new MemoryStream(result, false);
    369364      stream.AddStream(memStream);
    370365
     
    373368
    374369    public ResponseResultReceived StoreFinishedJobResultsSync(Guid clientId, Guid jobId, byte[] result, double percentage, Exception exception, bool finished) {
    375       return proxy.StoreFinishedJobResultStreamed(
    376         GetStreamedJobResult(clientId, jobId, result, percentage, exception));
     370      return proxy.StoreFinishedJobResultStreamed(GetStreamedJobResult(clientId, jobId, result, percentage, exception));
    377371    }
    378372
     
    387381        return null;
    388382      }
    389 
    390383    }
    391384
    392385    public ResponseResultReceived ProcessSnapshotSync(Guid clientId, Guid jobId, byte[] result, double percentage, Exception exception) {
    393386      try {
    394         return proxy.ProcessSnapshotStreamed(
    395           GetStreamedJobResult(clientId, jobId, result, percentage, exception));
     387        return proxy.ProcessSnapshotStreamed(GetStreamedJobResult(clientId, jobId, result, percentage, exception));
    396388      } catch (Exception e) {
    397389        HandleNetworkError(e);
     
    453445      }
    454446    }
    455 
    456447  }
    457448}
Note: See TracChangeset for help on using the changeset viewer.