ganeti

Safe HaskellSafe-Infered

Ganeti.JQScheduler.Filtering

Description

Filtering of jobs for the Ganeti job queue.

Synopsis

Documentation

userOf :: QueuedJob -> String -> StringSource

evaluateFilterComparator :: Ord field => Filter field -> (Comparator -> field -> FilterValue -> Maybe Bool) -> BoolSource

matchPredicateSource

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 -> BoolSource

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

applyingFilter :: Set FilterRule -> QueuedJob -> Maybe FilterRuleSource

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).