Check whether the tree satisfies: parent guarantees >= sum(children guarantees) TODO(mzhu): Add limit check.
| 127 | // |
| 128 | // TODO(mzhu): Add limit check. |
| 129 | Option<Error> validate() const |
| 130 | { |
| 131 | // Don't check the root node because it does not have quota set. |
| 132 | foreachvalue (const unique_ptr<Node>& child, root->children) { |
| 133 | Option<Error> error = child->validate(); |
| 134 | if (error.isSome()) { |
| 135 | return error; |
| 136 | } |
| 137 | } |
| 138 | |
| 139 | return None(); |
| 140 | } |
| 141 | |
| 142 | // Returns the total guaranteed resource quantities requested by |
| 143 | // all quotas in the tree. Since a role's guarantees must be greater |
no test coverage detected