Added in 1507250
I've added support for the leader evaluation which is optional. So this scheduler still runs in systems without the discovery api - in that case the flag to restrict a job on running on the leader is ignored.
If the discovery api is available, the leader information is evaluated. To avoid registering/unregistering jobs when the leader changes (and keeping track of them etc.), all jobs are scheduled, however if a job should only run on a leader and it is scheduled on a non leader, then the its scheduled but not executed.