Lock the trigger with the given key to the current jobstore instance
@param triggerKey the key of the desired trigger
@param jedis a thread-safe Redis connection
@return true if lock was acquired successfully; false otherwise
330944
protected boolean lockTrigger(TriggerKey triggerKey, T jedis){
        return jedis.set(redisSchema.triggerLockKey(triggerKey), schedulerInstanceId, "NX", "PX", TRIGGER_LOCK_TIMEOUT).equals("OK");
    }
643544
@Override
	public List<? extends Trigger> getTriggers(JobKey jobKey) throws SchedulerException {
		List<Trigger> triggers = new ArrayList<>();
		if (!CollectionUtils.isEmpty(scheduler.getTriggersOfJob(jobKey))) {
			triggers.addAll(scheduler.getTriggersOfJob(jobKey));
			Collections.sort(triggers, new Comparator<Trigger>() {
				@Override
				public int compare(Trigger o1, Trigger o2) {
					return o1.getKey().compareTo(o2.getKey());
				}
			});
		}
		return triggers;
	}
1310855
public <V> V execute(RedisCallback<V> cb) {
        Jedis jedis = jedisPool.getResource();
        boolean success = true;
        try {
            return cb.execute(jedis);
        } catch (JedisException e) {
            success = false;
            if (jedis != null) {
                jedisPool.returnBrokenResource(jedis);
            }
            throw e;
        } finally {
            if (success) {
                jedisPool.returnResource(jedis);
            }
        }
    }
1335688
public Lockable write_lock( Key job_key ) {
    Log.debug(Log.Tag.Sys.LOCKS,"write-lock "+_key+" by job "+job_key);
    return ((PriorWriteLock)new PriorWriteLock(job_key).invoke(_key))._old;
  }
777287
public boolean deleteJob (final JobKey jobKey) throws SchedulerException
  {
    validateState ();

    boolean result = false;

    final ICommonsList <? extends ITrigger> triggers = getTriggersOfJob (jobKey);
    for (final ITrigger trigger : triggers)
    {
      if (!unscheduleJob (trigger.getKey ()))
      {
        final StringBuilder sb = new StringBuilder ().append ("Unable to unschedule trigger [")
                                                     .append (trigger.getKey ())
                                                     .append ("] while deleting job [")
                                                     .append (jobKey)
                                                     .append ("]");
        throw new SchedulerException (sb.toString ());
      }
      result = true;
    }

    result = m_aResources.getJobStore ().removeJob (jobKey) || result;
    if (result)
    {
      notifySchedulerThread (0L);
      notifySchedulerListenersJobDeleted (jobKey);
    }
    return result;
  }
322609
public function triggerJob(Key $jobKey, array $jobDataMap = [])
    {
        $trigger = TriggerBuilder::newTrigger()->forJobKey($jobKey)->build();
        $trigger->setJobDataMap($jobDataMap);
        $trigger->computeFirstFireTime();

        $this->store->storeTrigger($trigger);

        $this->notify(Event::JOB_SCHEDULED, new TriggerEvent($trigger));
    }
1115696
public function pauseTrigger(Key $triggerKey)
    {
        $this->store->pauseTrigger($triggerKey);

        $this->notify(Event::TRIGGER_PAUSED, new KeyEvent($triggerKey));
    }
525576
@Override
    public boolean removeCalendar(String calendarName, Jedis jedis) throws JobPersistenceException {
        final String calendarTriggersSetKey = redisSchema.calendarTriggersSetKey(calendarName);

        if(jedis.scard(calendarTriggersSetKey) > 0){
            throw new JobPersistenceException(String.format("There are triggers pointing to calendar %s, so it cannot be removed.", calendarName));
        }
        final String calendarHashKey = redisSchema.calendarHashKey(calendarName);
        Pipeline pipe = jedis.pipelined();
        Response<Long> deleteResponse = pipe.del(calendarHashKey);
        pipe.srem(redisSchema.calendarsSet(), calendarHashKey);
        pipe.sync();

        return deleteResponse.get() == 1;
    }
410930
protected long getLastTriggersReleaseTime(T jedis){
        final String lastReleaseTime = jedis.get(redisSchema.lastTriggerReleaseTime());
        if(lastReleaseTime == null){
            return 0;
        }
        return Long.parseLong(lastReleaseTime);
    }
475613
private Trigger getTrigger(JobKey jobKey, Properties jobProps) {
    // Build a trigger for the job with the given cron-style schedule
    return TriggerBuilder.newTrigger()
        .withIdentity(jobProps.getProperty(ConfigurationKeys.JOB_NAME_KEY),
            Strings.nullToEmpty(jobProps.getProperty(ConfigurationKeys.JOB_GROUP_KEY)))
        .forJob(jobKey)
        .withSchedule(CronScheduleBuilder.cronSchedule(jobProps.getProperty(ConfigurationKeys.JOB_SCHEDULE_KEY)))
        .build();
  }
454390
protected function doPauseTrigger(Key $triggerKey)
    {
        if (false == $trigger = $this->retrieveTrigger($triggerKey)) {
            return;
        }

        if (false == in_array($trigger->getState(), [Trigger::STATE_WAITING, Trigger::STATE_ACQUIRED], true)) {
            return;
        }

        $trigger->setState(Trigger::STATE_PAUSED);
        $result = $this->res->getTriggerStorage()->update($trigger);

        if (false == $result->isAcknowledged() || false == $result->getModifiedCount()) {
            throw new JobPersistenceException(sprintf('Couldn\'t pause trigger: "%s"', $triggerKey));
        }
    }
1273081
public boolean unscheduleJob (final TriggerKey triggerKey) throws SchedulerException
  {
    validateState ();

    if (m_aResources.getJobStore ().removeTrigger (triggerKey))
    {
      notifySchedulerThread (0L);
      notifySchedulerListenersUnscheduled (triggerKey);
    }
    else
    {
      return false;
    }

    return true;
  }
751490
protected boolean isBlockedJob(String jobHashKey, T jedis) {
        JobKey jobKey = redisSchema.jobKey(jobHashKey);
        return jedis.sismember(redisSchema.blockedJobsSet(), jobHashKey) &&
                isActiveInstance(jedis.get(redisSchema.jobBlockedKey(jobKey)), jedis);
    }
327633
@Override
  public void lock() throws JobLockException {
    try {
      this.lock.acquire();
    } catch (Exception e) {
      throw new JobLockException("Failed to acquire lock " + this.lockPath, e);
    }
  }
586849
public void read_lock( Key<Job> job_key ) { 
    if( _key != null ) {
      Log.debug("shared-read-lock "+_key+" by job "+job_key);
      new ReadLock(job_key).invoke(_key); 
    }
  }
1102717
public ITrigger getTrigger (final TriggerKey triggerKey) throws SchedulerException
  {
    validateState ();

    return m_aResources.getJobStore ().retrieveTrigger (triggerKey);
  }
1338865
public void pauseAll(T jedis) throws JobPersistenceException {
        for (String triggerGroupSet : jedis.smembers(redisSchema.triggerGroupsSet())) {
            pauseTriggers(GroupMatcher.triggerGroupEquals(redisSchema.triggerGroup(triggerGroupSet)), jedis);
        }
    }