Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add per-assignment cleanup of target eval cache
Here we introduce per-assignment selective cleanup of assignment target evaluation cache. It is needed because some of the assignments can bring target-related policy rules. Although such assignment targets can be idempotent, their idempotency is limited to a single assignment evaluation. See also MID-5827.
- Loading branch information
Showing
7 changed files
with
170 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
...ain/java/com/evolveum/midpoint/model/impl/lens/AssignmentTargetEvaluationInformation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* Copyright (c) 2019 Evolveum and contributors | ||
* | ||
* This work is dual-licensed under the Apache License 2.0 | ||
* and European Union Public License. See LICENSE file for details. | ||
*/ | ||
|
||
package com.evolveum.midpoint.model.impl.lens; | ||
|
||
/** | ||
* Information about assignment target evaluation that is stored in the evaluated assignment target cache. | ||
*/ | ||
|
||
class AssignmentTargetEvaluationInformation { | ||
|
||
/** | ||
* True if the assignment target contributes (provides) some "target" policy rules. This means that we should not | ||
* cache its evaluation for the whole focus processing, because the policy rules should be applied separately to all | ||
* the evaluated focus assignments. | ||
* | ||
* Therefore, when starting evaluation of next focus assignment, we should remove all existing cache entries that have | ||
* this value set to true. | ||
* | ||
* See also MID-5827. | ||
* | ||
* The default of "true" is safer -- it is better to errorneously evict an entry from the cache than to omit some | ||
* necessary target policy rules. | ||
*/ | ||
private boolean bringsTargetPolicyRules = true; | ||
|
||
void setBringsTargetPolicyRules(boolean bringsTargetPolicyRules) { | ||
this.bringsTargetPolicyRules = bringsTargetPolicyRules; | ||
} | ||
|
||
/** | ||
* @return true if this target evaluation should be cached for single assignment evaluation only. | ||
* | ||
* Currently we decide only based on whether it brings any target policy rules. | ||
*/ | ||
boolean isAssignmentScoped() { | ||
return bringsTargetPolicyRules; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters