Add MetadataProducerFactory for predicates

Signed-off-by: Aldo Culquicondor <acondor@google.com>
This commit is contained in:
Aldo Culquicondor
2019-11-08 15:38:07 -05:00
parent b2fb0f77ad
commit 6a98c93f3c
34 changed files with 220 additions and 184 deletions

View File

@@ -57,18 +57,18 @@ func ErrorToFrameworkStatus(err error) *framework.Status {
return nil
}
// PredicatesStateData is a pointer to PredicateMetadata. In the normal case, StateData is supposed to
// PredicatesStateData is a pointer to Metadata. In the normal case, StateData is supposed to
// be generated and stored in CycleState by a framework plugin (like a PreFilter pre-computing data for
// its corresponding Filter). However, during migration, the scheduler will inject a pointer to
// PredicateMetadata into CycleState. This "hack" is necessary because during migration Filters that implement
// Metadata into CycleState. This "hack" is necessary because during migration Filters that implement
// predicates functionality will be calling into the existing predicate functions, and need
// to pass PredicateMetadata.
// to pass Metadata.
type PredicatesStateData struct {
Reference interface{}
}
// Clone is supposed to make a copy of the data, but since this is just a pointer, we are practically
// just copying the pointer. This is ok because the actual reference to the PredicateMetadata
// just copying the pointer. This is ok because the actual reference to the Metadata
// copy that is made by generic_scheduler during preemption cycle will be injected again outside
// the framework.
func (p *PredicatesStateData) Clone() framework.StateData {