Update job status and notify the waiting thread.
163684
public synchronized void setStatusAndNotify(final LauncherStatus newStatus) {
    LOG.log(Level.FINEST, "Set status: {0} -> {1}", new Object[] {this.status, newStatus});
    this.status = newStatus;
    this.notify();
  }
402360
async def _on_status_change(self, update):
        """"""

        info = update['payload']
        new_number = info['new_status']
        name = update['service']

        if name not in self.services:
            return

        with self._state_lock:
            is_changed = self.services[name].state != new_number
            self.services[name].state = new_number

        # Notify about this service state change if anyone is listening
        if self._on_change_callback and is_changed:
            self._on_change_callback(name, self.services[name].id, new_number, False, False)
44349
def _update_statuses(self, sub_job_num=None):
        
        # initialize status dictionary
        status_dict = dict()

        for val in CONDOR_JOB_STATUSES.values():
            status_dict[val] = 0

        for node in self.node_set:
            job = node.job
            try:
                job_status = job.status
                status_dict[job_status] += 1
            except (KeyError, HTCondorError):
                status_dict['Unexpanded'] += 1

        return status_dict
462087
void update(JobStatus status) {
    this.status = status;
    try {
      this.counters = running.getCounters();
      this.completed = running.isComplete();
      this.successful = running.isSuccessful();
      this.mapProgress = running.mapProgress();
      this.reduceProgress = running.reduceProgress();
      // running.getTaskCompletionEvents(fromEvent);

    } catch (IOException ioe) {
      ioe.printStackTrace();
    }

    this.completedMaps = (int) (this.totalMaps * this.mapProgress);
    this.completedReduces = (int) (this.totalReduces * this.reduceProgress);
  }
924619
def submit(self, new_queue = None):
    """"""
    self.status = 'submitted'
    self.result = None
    self.machine_name = None
    if new_queue is not None:
      self.queue_name = new_queue
    for array_job in self.array:
      array_job.status = 'submitted'
      array_job.result = None
      array_job.machine_name = None
    self.submit_time = datetime.now()
    self.start_time = None
    self.finish_time = None
278329
def mark_for_update(self):
        '''
            
        '''
        self.pub_statuses.exclude(status=UNPUBLISHED).update(status=NEEDS_UPDATE)
        push_key.delay(self)
719852
function notify (doc) {
  // find queue, find worker...
  if (_.isArray(workers[doc.type]) && !_.isEmpty(workers[doc.type])) {
    var wkr = workers[doc.type].shift();
    // update doc as processing
    db.atomic('dequeue', 'id', doc._id, function (err, body) {
      if (err) {
        log.error(err);
        return wkr.send(ERROR, err);
      }

      var job = _.extend(doc.job, {
        id: doc._id,
        ok: true
      });
      wkr.send(SUCCESS, job);
    });
  }
}
300970
def update_finished(self):
        
        if self.is_updateable:
            javabridge.call(self.jobject, "updateFinished", "()V")
        else:
            logger.critical(classes.get_classname(self.jobject) + " is not updateable!")
503967
def print_update(self, stream=sys.stdout, job_stats=None):
        
        if job_stats is None:
            job_stats = JobStatusVector()
            job_det_list = []
            job_det_list += self._scatter_link.jobs.values()

            for job_dets in job_det_list:
                if job_dets.status == JobStatus.no_job:
                    continue
                job_stats[job_dets.status] += 1

        stream.write("Status :\n  Total  : %i\n  Unknown: %i\n" %
                     (job_stats.n_total, job_stats[JobStatus.unknown]))
        stream.write("  Not Ready: %i\n  Ready: %i\n" %
                     (job_stats[JobStatus.not_ready], job_stats[JobStatus.ready]))
        stream.write("  Pending: %i\n  Running: %i\n" %
                     (job_stats[JobStatus.pending], job_stats[JobStatus.running]))
        stream.write("  Done: %i\n  Failed: %i\n" %
                     (job_stats[JobStatus.done], job_stats[JobStatus.failed]))
527586
def _update_status(self, update):
        """"""
        if isinstance(update, dict):
            self._protocol.status.update(update)
            self._protocol._updateq.put_nowait(self._protocol.status)
1050261
def _StatusUpdateThreadMain(self):
    """"""
    while self._status_update_active:
      # Make a local copy of the PIDs in case the dict is changed by
      # the main thread.
      for pid in list(self._process_information_per_pid.keys()):
        self._CheckStatusWorkerProcess(pid)

      self._UpdateForemanProcessStatus()

      tasks_status = self._task_manager.GetStatusInformation()
      if self._task_queue_profiler:
        self._task_queue_profiler.Sample(tasks_status)

      self._processing_status.UpdateTasksStatus(tasks_status)

      if self._status_update_callback:
        self._status_update_callback(self._processing_status)

      time.sleep(self._STATUS_UPDATE_INTERVAL)
20429
def wait_for_jobs(jobs):
    

    all_running = False
    while not all_running:
        all_running = True
        time.sleep(5)
        for job in jobs:
            job.refresh()
            scheduled = getattr(job, "scheduled_at", None)
            if scheduled is not None:
                logger.info("Waiting for %s on %s [%s]" % (job.uid,
                                                           job.site,
                                                           _date2h(scheduled)))
            all_running = all_running and job.state == "running"
            if job.state == "error":
                raise Exception("The job %s is in error state" % job)
    logger.info("All jobs are Running !")
486947
def _WaitForStatusNotRunning(self):
    """"""
    # We wait slightly longer than the status check sleep time.
    time.sleep(2.0)
    time_slept = 2.0
    while self._status_is_running:
      time.sleep(0.5)
      time_slept += 0.5
      if time_slept >= self._PROCESS_JOIN_TIMEOUT:
        break
892496
def update_connected(self, status):
        """"""
        self._client['connected'] = status
        _LOGGER.info('updated connected status to %s on %s', status, self.friendly_name)
        self.callback()
619897
def wait(self):
        """"""
        logging.info("waiting for {} jobs to complete".format(len(self.submissions)))
        while not self.shutdown:
            time.sleep(1)
869496
def handle_status(self):
        """"""
        status = self.get_status()

        if status:
            # Update main-zone
            self.zones['main'].update_status(status)
499978
async def update_status(self):
        
        if self._operation.async_url:
            self._response = await self.request_status(self._operation.async_url)
            self._operation.set_async_url_if_present(self._response)
            self._operation.get_status_from_async(self._response)
        elif self._operation.location_url:
            self._response = await self.request_status(self._operation.location_url)
            self._operation.set_async_url_if_present(self._response)
            self._operation.get_status_from_location(self._response)
        elif self._operation.method == "PUT":
            initial_url = self._operation.initial_response.request.url
            self._response = await self.request_status(initial_url)
            self._operation.set_async_url_if_present(self._response)
            self._operation.get_status_from_resource(self._response)
        else:
            raise BadResponse("Unable to find status link for polling.")