Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Ganeti.JQScheduler.Filtering
Contents
Description
Filtering of jobs for the Ganeti job queue.
Synopsis
- applyingFilter :: Set FilterRule -> QueuedJob -> Maybe FilterRule
- jobFiltering :: Queue -> Set FilterRule -> [JobWithStat] -> [JobWithStat]
- matchPredicate :: QueuedJob -> JobId -> FilterPredicate -> Bool
- matches :: QueuedJob -> FilterRule -> Bool
Documentation
applyingFilter :: Set FilterRule -> QueuedJob -> Maybe FilterRule #
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] #
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).
For testing only
Arguments
:: 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 #
Whether all predicates of the filter rule are true for the job.