Evaluates all triggers associated with the notification and updates the job history.
972756
private void _processNotification(Alert alert, History history, List<Metric> metrics, 
			Map<BigInteger, Map<Metric, Long>> triggerFiredTimesAndMetricsByTrigger, Notification notification, Long alertEnqueueTimestamp) {

		//refocus notifier does not need cool down logic, and every evaluation needs to send notification
		boolean isRefocusNotifier = SupportedNotifier.REFOCUS.getName().equals(notification.getNotifierName());

		for(Trigger trigger : notification.getTriggers()) {
			Map<Metric, Long> triggerFiredTimesForMetrics = triggerFiredTimesAndMetricsByTrigger.get(trigger.getId());

			for(Metric m : metrics) {
				if(triggerFiredTimesForMetrics!=null && triggerFiredTimesForMetrics.containsKey(m)) {
					String logMessage = MessageFormat.format("The trigger {0} was evaluated against metric {1} and it is fired.", trigger.getName(), m.getIdentifier());
					history.appendMessageNUpdateHistory(logMessage, null, 0);

					if (isRefocusNotifier) {
						sendNotification(trigger, m, history, notification, alert, triggerFiredTimesForMetrics.get(m), alertEnqueueTimestamp);
						continue;
					}

					if(!notification.onCooldown(trigger, m)) {
						_updateNotificationSetActiveStatus(trigger, m, history, notification);
						sendNotification(trigger, m, history, notification, alert, triggerFiredTimesForMetrics.get(m), alertEnqueueTimestamp);
					} else {
						logMessage = MessageFormat.format("The notification {0} is on cooldown until {1}.", notification.getName(), getDateMMDDYYYY(notification.getCooldownExpirationByTriggerAndMetric(trigger, m)));
						history.appendMessageNUpdateHistory(logMessage, null, 0);
					}
				} else {
					String logMessage = MessageFormat.format("The trigger {0} was evaluated against metric {1} and it is not fired.", trigger.getName(), m.getIdentifier());
					history.appendMessageNUpdateHistory(logMessage, null, 0);

					if (isRefocusNotifier) {
						sendClearNotification(trigger, m, history, notification, alert, alertEnqueueTimestamp);
						continue;
					}

					if(notification.isActiveForTriggerAndMetric(trigger, m)) {
						// This is case when the notification was active for the given trigger, metric combination
						// and the metric did not violate triggering condition on current evaluation. Hence we must clear it.
						_updateNotificationClearActiveStatus(trigger, m, notification);
						sendClearNotification(trigger, m, history, notification, alert, alertEnqueueTimestamp);
					}
				}
			}
		}
	}
25421
@Override
  public void triggerJob(String jobKey, JobDataMap data) throws SchedulerException {

    validateState();

    OperableTrigger operableTrigger =
        simpleTriggerBuilder()
            .withIdentity(jobKey + "-trigger")
            .forJob(jobKey)
            .startAt(new Date())
            .build();

    //    OperableTrigger operableTrigger = TriggerBuilder.newTriggerBuilder().withIdentity(jobKey +
    // "-trigger").forJob(jobKey)
    //
    // .withTriggerImplementation(SimpleScheduleBuilder.simpleScheduleBuilderBuilder().instantiate()).startAt(new Date()).build();

    // TODO what does this accomplish??? Seems to sets it's next fire time internally
    operableTrigger.computeFirstFireTime(null);

    if (data != null) {
      operableTrigger.setJobDataMap(data);
    }

    boolean collision = true;
    while (collision) {
      try {
        quartzSchedulerResources.getJobStore().storeTrigger(operableTrigger, false);
        collision = false;
      } catch (ObjectAlreadyExistsException oaee) {
        operableTrigger.setName(newTriggerId());
      }
    }

    notifySchedulerThread(operableTrigger.getNextFireTime().getTime());
    notifySchedulerListenersScheduled(operableTrigger);
  }
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!")
1030362
def _update_data(self, trial_job_id, trial_history):
        
        if trial_job_id not in self.running_history:
            self.running_history[trial_job_id] = []
        self.running_history[trial_job_id].extend(trial_history[len(self.running_history[trial_job_id]):])
736446
def update(self, obj_id, is_public=NotUpdated, is_protected=NotUpdated):
        """"""

        data = {}
        self._copy_if_updated(data, is_public=is_public,
                              is_protected=is_protected)
        return self._patch('/job-executions/%s' % obj_id, data)
103200
def handle(self, *args, **options):
        
        # retrieve layers
        notifications = self.retrieve_old_notifications()
        count = len(notifications)

        if count > 0:
            self.output('found %d notifications to purge...' % count)
            notifications.delete()
            self.output('%d notifications deleted successfully.' % count)
        else:
            self.output('there are no old notifications to purge')
549539
private void triggerQueuedRequests() {
		if (triggerRequestQueued) {
			triggerRequestQueued = false;

			// trigger the checkpoint from the trigger timer, to finish the work of this thread before
			// starting with the next checkpoint
			if (periodicScheduling) {
				if (currentPeriodicTrigger != null) {
					currentPeriodicTrigger.cancel(false);
				}
				currentPeriodicTrigger = timer.scheduleAtFixedRate(
						new ScheduledTrigger(),
						0L, baseInterval, TimeUnit.MILLISECONDS);
			}
			else {
				timer.execute(new ScheduledTrigger());
			}
		}
	}
504903
function () {
                    HealthLogger.sendAnalyticsData(
                        autoUpdateEventNames.AUTOUPDATE_DOWNLOAD_COMPLETE_USER_CLICK_RESTART,
                        "autoUpdate",
                        "installNotification",
                        "installNow ",
                        "click"
                    );
                    detachUpdateBarBtnHandlers();
                    initiateUpdateProcess(statusObj.installerPath, statusObj.logFilePath, statusObj.installStatusFilePath);
                }
604533
def UpdateUserNotifications(self, username, timestamps, state=None):
    """"""
    if not timestamps:
      return

    for n in self.notifications_by_username.get(username, []):
      if n.timestamp in timestamps:
        n.state = state
1178256
protected void update() {
    //Making more granual locking so that clusterStatus can be fetched from Jobtracker.
    ClusterStatus clusterStatus = taskTrackerManager.getClusterStatus();
    // Recompute locality delay from JobTracker heartbeat interval if enabled.
    // This will also lock the JT, so do it outside of a fair scheduler lock.
    if (autoComputeLocalityDelay) {
      JobTracker jobTracker = (JobTracker) taskTrackerManager;
      localityDelayNodeLocal = Math.min(MAX_AUTOCOMPUTED_LOCALITY_DELAY,
           (long) (1.5 * jobTracker.getNextHeartbeatInterval()));
      localityDelayRackLocal = localityDelayNodeLocal;
    }
    // Got clusterStatus hence acquiring scheduler lock now
    // Remove non-running jobs
    synchronized(this){

      // Reload allocations file if it hasn't been loaded in a while
      if (poolMgr.reloadAllocsIfNecessary()) {
        // Check if the cluster have enough slots for reserving
        poolMgr.checkMinimumSlotsAvailable(clusterStatus, TaskType.MAP);
        poolMgr.checkMinimumSlotsAvailable(clusterStatus, TaskType.REDUCE);
      }

      List<JobInProgress> toRemove = new ArrayList<JobInProgress>();
      for (JobInProgress job: infos.keySet()) {
        int runState = job.getStatus().getRunState();
        if (runState == JobStatus.SUCCEEDED || runState == JobStatus.FAILED
          || runState == JobStatus.KILLED) {
            toRemove.add(job);
        }
      }
      for (JobInProgress job: toRemove) {
        infos.remove(job);
        poolMgr.removeJob(job);
      }
      // Update running jobs with deficits since last update, and compute new
      // slot allocations, weight, shares and task counts
      long now = clock.getTime();
      long timeDelta = now - lastUpdateTime;
      updateDeficits(timeDelta);
      updateRunnability();
      updateTaskCounts();
      updateWeights();
      updateMinAndMaxSlots();
      updateFairShares(clusterStatus);
      if (preemptionEnabled) {
        updatePreemptionVariables();
      }
      sortJobs();
      updatePoolMetrics();
      dumpStatus(now);
      lastUpdateTime = now;
    }
  }
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);
  }
104165
def _save_traceback_history(self, status, trace, job_exc):
        
        failure_date = datetime.datetime.utcnow()

        new_history = {
            "date": failure_date,
            "status": status,
            "exceptiontype": job_exc.__name__
        }

        traces = trace.split("---- Original exception: -----")
        if len(traces) > 1:
            new_history["original_traceback"] = traces[1]
        worker = context.get_current_worker()
        if worker:
            new_history["worker"] = worker.id
        new_history["traceback"] = traces[0]
        self.collection.update({
            "_id": self.id
        }, {"$push": {"traceback_history": new_history}})
1199505
private void updateJobStats(Phase phase, ProcessingRates oldRates, 
      ProcessingRates newRates) {
    DataStatistics stats = job.getRunningTaskStatistics(phase);
    stats.updateStatistics(oldRates.getRate(phase), newRates.getRate(phase));
  }
667455
private void updateDomainAxisRange()
    {
        int count = dataSet.getSeries(0).getItemCount();
        if (count < SHOW_FIXED_GENERATIONS)
        {
            domainAxis.setRangeWithMargins(0, SHOW_FIXED_GENERATIONS);
        }
        else if (allDataButton.isSelected())
        {
            domainAxis.setRangeWithMargins(0, Math.max(SHOW_FIXED_GENERATIONS, count));
        }
        else
        {
            domainAxis.setRangeWithMargins(count - SHOW_FIXED_GENERATIONS, count);
        }
    }
194135
def _trigger(self):
        
        self._completed.set()
        for callback in self._callbacks:
            callback(self)
1328573
private void jobComplete() {
    final JobTrackerInstrumentation metrics = jobtracker.getInstrumentation();
    //
    // All tasks are complete, then the job is done!
    //
    if (this.status.getRunState() == JobStatus.RUNNING ||
        this.status.getRunState() == JobStatus.PREP) {
      changeStateTo(JobStatus.SUCCEEDED);
      this.status.setCleanupProgress(1.0f);
      if (maps.length == 0) {
        this.status.setMapProgress(1.0f);
      }
      if (reduces.length == 0) {
        this.status.setReduceProgress(1.0f);
      }
      this.finishTime = JobTracker.getClock().getTime();
      LOG.info("Job " + this.status.getJobID() +
               " has completed successfully.");

      // Log the job summary (this should be done prior to logging to
      // job-history to ensure job-counters are in-sync
      JobSummary.logJobSummary(this, jobtracker.getClusterStatus(false));

      Counters counters = getCounters();
      // Log job-history
      JobHistory.JobInfo.logFinished(this.status.getJobID(), finishTime,
                                     this.finishedMapTasks,
                                     this.finishedReduceTasks, failedMapTasks,
                                     failedReduceTasks, killedMapTasks,
                                     killedReduceTasks, getMapCounters(),
                                     getReduceCounters(), counters);
      // Note that finalize will close the job history handles which garbage collect
      // might try to finalize
      garbageCollect();

      metrics.completeJob(this.conf, this.status.getJobID());
    }
  }
944515
private synchronized void updateLocal() throws ScheduleManagerException {
    final List<Schedule> updates = this.loader.loadUpdatedSchedules();
    for (final Schedule s : updates) {
      if (s.getStatus().equals(TriggerStatus.EXPIRED.toString())) {
        onScheduleExpire(s);
      } else {
        internalSchedule(s);
      }
    }
  }