refactor(graph): refactor the Knowledge Graph to include configs check, while eligibility analysis (#4687)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Amisha Prabhat
2024-05-21 19:44:45 +05:30
committed by GitHub
parent 70612e4c6f
commit a917776bb8
19 changed files with 541 additions and 34 deletions

View File

@ -13,6 +13,7 @@ use crate::{
},
};
#[derive(Debug)]
struct CheckNodeContext<'a, V: ValueNode, C: CheckingContext<Value = V>> {
ctx: &'a C,
node: &'a Node<V>,
@ -24,6 +25,7 @@ struct CheckNodeContext<'a, V: ValueNode, C: CheckingContext<Value = V>> {
domains: Option<&'a [DomainId]>,
}
#[derive(Debug)]
pub struct ConstraintGraph<'a, V: ValueNode> {
pub domain: DenseMap<DomainId, DomainInfo<'a>>,
pub domain_identifier_map: FxHashMap<DomainIdentifier<'a>, DomainId>,
@ -139,6 +141,7 @@ where
ctx,
domains,
};
match &node.node_type {
NodeType::AllAggregator => self.validate_all_aggregator(check_node_context),
@ -206,6 +209,7 @@ where
} else {
vald.memo
.insert((vald.node_id, vald.relation, vald.strength), Ok(()));
Ok(())
}
}