Safe HaskellNone



Filtering of jobs for the Ganeti job queue.



matchPredicate Source #


:: QueuedJob 
-> JobId

the watermark to compare against if the predicate references it

-> FilterPredicate 
-> Bool 

Whether a FilterPredicate is true for a job.

matches :: QueuedJob -> FilterRule -> Bool Source #

Whether all predicates of the filter rule are true for the job.

applyingFilter :: Set FilterRule -> QueuedJob -> Maybe FilterRule Source #

Finds the first filter whose predicates all match the job and whose action is not Continue. This is the applying filter.

jobFiltering :: Queue -> Set FilterRule -> [JobWithStat] -> [JobWithStat] Source #

Implements job filtering as specified in `doc/design-optables.rst`.

Importantly, the filter that *applies* is the first one of which all predicates match; this is implemented in applyingFilter.

The initial FilterChainState is currently not cached across selectJobsToRun invocations because the number of running jobs is typically small (< 100).