Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/27/10 18:36:36 (14 years ago)
Author:
cneumuel
Message:

worked on HiveExperiment (#1115)

File:
1 edited

Legend:

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

    r4092 r4116  
    8282
    8383        foreach (ClientDto client in allClients) {
    84           if (client.State != State.offline && client.State != State.nullState) {
     84          if (client.State != State.Offline && client.State != State.NullState) {
    8585            heartbeatLock.EnterUpgradeableReadLock();
    8686
     
    8888              Logger.Info("Client " + client.Id +
    8989                              " wasn't offline but hasn't sent heartbeats - setting offline");
    90               client.State = State.offline;
     90              client.State = State.Offline;
    9191              DaoLocator.ClientDao.Update(client);
    9292              Logger.Info("Client " + client.Id +
     
    113113                Logger.Debug("setting client offline");
    114114                // client must be set offline
    115                 client.State = State.offline;
     115                client.State = State.Offline;
    116116
    117117                //clientAdapter.Update(client);
     
    146146
    147147    private void CheckForPendingJobs() {
    148       IList<JobDto> pendingJobsInDB = new List<JobDto>(DaoLocator.JobDao.GetJobsByState(State.pending));
     148      IList<JobDto> pendingJobsInDB = new List<JobDto>(DaoLocator.JobDao.GetJobsByState(State.Pending));
    149149
    150150      foreach (JobDto currJob in pendingJobsInDB) {
     
    152152          if (pendingJobs.ContainsKey(currJob.Id)) {
    153153            if (pendingJobs[currJob.Id] <= 0) {
    154               currJob.State = State.offline;
     154              currJob.State = State.Offline;
    155155              DaoLocator.JobDao.Update(currJob);
    156156            } else {
     
    185185      //Really set offline?
    186186      //Reconnect issues with the currently calculating jobs
    187       clientInfo.State = State.idle;
     187      clientInfo.State = State.Idle;
    188188      clientInfo.CalendarSyncStatus = dbClient != null ? dbClient.CalendarSyncStatus : CalendarState.NotAllowedToFetch;
    189189
     
    258258      Logger.Debug("END Finished Client Fetching");
    259259      // check if the client is logged in
    260       if (client.State == State.offline || client.State == State.nullState) {
     260      if (client.State == State.Offline || client.State == State.NullState) {
    261261        response.Success = false;
    262262        response.StatusMessage = ApplicationConstants.RESPONSE_COMMUNICATOR_USER_NOT_LOGGED_IN;
     
    341341            response.StatusMessage = ApplicationConstants.RESPONSE_COMMUNICATOR_JOB_IS_NOT_BEEING_CALCULATED;
    342342            Logger.Error("There is no job calculated by this user " + hbData.ClientId + " Job: " + curJob);
    343           } else if (curJob.State == State.abort) {
     343          } else if (curJob.State == State.Abort) {
    344344            // a request to abort the job has been set
    345345            response.ActionRequest.Add(new MessageContainer(MessageContainer.MessageType.AbortJob, curJob.Id));
    346             curJob.State = State.finished;
     346            curJob.State = State.Finished;
    347347          } else {
    348348            // save job progress
    349349            curJob.Percentage = jobProgress.Value;
    350350
    351             if (curJob.State == State.requestSnapshot) {
     351            if (curJob.State == State.RequestSnapshot) {
    352352              // a request for a snapshot has been set
    353353              response.ActionRequest.Add(new MessageContainer(MessageContainer.MessageType.RequestSnapshot, curJob.Id));
    354               curJob.State = State.requestSnapshotSent;
     354              curJob.State = State.RequestSnapshotSent;
    355355            }
    356356          }
     
    376376                Logger.Error("Job TTL reached Zero, Job gets removed: " + currJob + " and set back to offline. User that sucks: " + currJob.Client);
    377377
    378                 currJob.State = State.offline;
     378                currJob.State = State.Offline;
    379379                DaoLocator.JobDao.Update(currJob);
    380380
     
    385385            } else {
    386386              Logger.Error("Job ID wasn't with the heartbeats:  " + currJob);
    387               currJob.State = State.offline;
     387              currJob.State = State.Offline;
    388388              DaoLocator.JobDao.Update(currJob);
    389389            }
     
    516516        return response;
    517517      }
    518       if (job.JobInfo.State == State.abort) {
     518      if (job.JobInfo.State == State.Abort) {
    519519        response.Success = false;
    520520        response.StatusMessage = ApplicationConstants.RESPONSE_COMMUNICATOR_JOB_WAS_ABORTED;
     
    545545        return response;
    546546      }
    547       if (job.JobInfo.State == State.finished) {
     547      if (job.JobInfo.State == State.Finished) {
    548548        response.Success = true;
    549549        response.StatusMessage = ApplicationConstants.RESPONSE_COMMUNICATOR_JOBRESULT_RECEIVED;
     
    556556      }
    557557      //Todo: RequestsnapshotSent => calculating?
    558       if (job.JobInfo.State == State.requestSnapshotSent) {
    559         job.JobInfo.State = State.calculating;
    560       }
    561       if (job.JobInfo.State != State.calculating &&
    562         job.JobInfo.State != State.pending) {
     558      if (job.JobInfo.State == State.RequestSnapshotSent) {
     559        job.JobInfo.State = State.Calculating;
     560      }
     561      if (job.JobInfo.State != State.Calculating &&
     562        job.JobInfo.State != State.Pending) {
    563563        response.Success = false;
    564564        response.StatusMessage = ApplicationConstants.RESPONSE_COMMUNICATOR_WRONG_JOB_STATE;
     
    573573
    574574      if (finished) {
    575         job.JobInfo.State = State.finished;
     575        job.JobInfo.State = State.Finished;
    576576        job.JobInfo.DateFinished = DateTime.Now;
    577577      }
     
    637637        return response;
    638638      }
    639       if (client.State == State.calculating) {
     639      if (client.State == State.Calculating) {
    640640        // check wich job the client was calculating and reset it
    641641        IEnumerable<JobDto> jobsOfClient = DaoLocator.JobDao.FindActiveJobsOfClient(client);
    642642        foreach (JobDto job in jobsOfClient) {
    643           if (job.State != State.finished)
     643          if (job.State != State.Finished)
    644644            DaoLocator.JobDao.SetJobOffline(job);
    645645        }
    646646      }
    647647
    648       client.State = State.offline;
     648      client.State = State.Offline;
    649649      DaoLocator.ClientDao.Update(client);
    650650
     
    670670        return response;
    671671      }
    672       if (job.State == State.finished) {
     672      if (job.State == State.Finished) {
    673673        response.Success = true;
    674674        response.StatusMessage = ApplicationConstants.RESPONSE_COMMUNICATOR_JOB_ALLREADY_FINISHED;
     
    676676        return response;
    677677      }
    678       job.State = State.pending;
     678      job.State = State.Pending;
    679679      lock (pendingJobs) {
    680680        pendingJobs.Add(job.Id, PENDING_TIMEOUT);
Note: See TracChangeset for help on using the changeset viewer.