Closed chillenious closed 10 years ago
I would say that adding it shouldn't be that big of a deal, pretty much similar to what Quartz has in other stores:
if (job.isConcurrentExectionDisallowed()) {
if (acquiredJobKeysForNoConcurrentExec.contains(jobKey)) {
excludedTriggers.add(tw);
continue; // go to next trigger in store.
} else {
acquiredJobKeysForNoConcurrentExec.add(jobKey);
}
// ...
if (job.isConcurrentExectionDisallowed()) {
ArrayList<TriggerWrapper> trigs = getTriggerWrappersForJob(job
.getKey());
Iterator<TriggerWrapper> itr = trigs.iterator();
while (itr.hasNext()) {
TriggerWrapper ttw = itr.next();
if (ttw.state == TriggerWrapper.STATE_WAITING) {
ttw.state = TriggerWrapper.STATE_BLOCKED;
}
if (ttw.state == TriggerWrapper.STATE_PAUSED) {
ttw.state = TriggerWrapper.STATE_PAUSED_BLOCKED;
}
timeTriggers.remove(ttw);
}
blockedJobs.add(job.getKey());
} else if (tw.trigger.getNextFireTime() != null) {
synchronized (lock) {
timeTriggers.add(tw);
}
}
/// etc
There is a plan to support pretty much everything that other stores support. I'll take a look, and check if I could do it perhaps in the end of next week. Maybe @michaelklishin is faster than I am.
But pull requests are always welcomed!
We want to make the store as feature complete as we can. Feel free to submit a pull request that adds this feature.
Cheers, will try. Though I'm not sure when I'll have time to dive into doing that tbh, as I'd need to get familiar more with Quartz' internals.
any news on the job execution disallowed?
If someone still needs this feature, feel free to submit pull requests.
Haven't had the need for it
I need this while I'm using axonframework with mongodb. Can someone help to add this feature in?
@liougehooa you can contribute a feature you need. That's how open source works.
Am thinking that this should be simpler than suggested by just using an additional lock for the job.
Also updating the insertion of the trigger lock to use FSYNCED (deleting the lock is OK left at JOURNAL_SAFE). This is required to guarantee the lock is 100% effective.
Am currently testing an implementation for this.
Hi,
Any chance you'll be supporting concurrentExectionDisallowed any time soon?