Allow filters to be run only once per request if their data doesn't change

Registered by Phil Day

Currently all scheduler filters are run for each instance in a request, but for many filters the data doesn’t change during a request.

For example the AZ filter is pretty static, but expensive to run on a large system. Similarly the ServiceGroup information used by the compute filter is cached as part of the host status, and doesn’t need to be evaluated more than once per request.

This blueprint introduces a new attribute that allows filters to declare that they only need to be run once per request. The default behaviour is left as being run for each instance.

In addition the function that does the check is defined in the filter base class so that a filter that wants to run (for example) once for every 10 instances in a request can override the function and implement its own behaviour.

Blueprint information

Status:
Complete
Approver:
Russell Bryant
Priority:
Low
Drafter:
Phil Day
Direction:
Approved
Assignee:
Phil Day
Definition:
Approved
Series goal:
Accepted for havana
Implementation:
Implemented
Milestone target:
milestone icon 2013.2
Started by
Phil Day
Completed by
Russell Bryant

Related branches

Sprints

Whiteboard

Gerrit topic: https://review.openstack.org/#q,topic:bug/1189557,n,z

Addressed by: https://review.openstack.org/33720
    Allow filters to only run once per request if their data is static

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.