-
Notifications
You must be signed in to change notification settings - Fork 188
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Eliminate repeated delta/object recomputations
Each time current or summary delta (including relative and absolute ODO) were obtained from LensElementContext, full re-creation of these deltas from primary and secondary deltas occurred. This accounted for large portion of time spent in the clockwork for some use cases. This commit partly eliminates these recomputations: the computable parts of the element state (mainly: current/summary delta, new object) are cached, with invalidation bound to the changes in "source" data. Work in progress. The performance can be improved further by updating current/summary delta "on the fly", along with updates to secondary deltas. It is also questionable if it is better to recompute new object when accessed (and invalid), or to use original approach based on LensElementContext#recompute method, or to update it "on the fly" along with current/summary delta. However, even this partial work saved 10-15% clockwork time for scenarios with 100 assignments, and 30-35% time for 500 assignments. Unrelated minor changes: 1. ConsolidationProcessor no longer drops primary and secondary deltas for projections that were deleted. 2. Synchronization intent was moved from LensElementContext to LensProjectionContext. Related to MID-7053.
- Loading branch information
Showing
68 changed files
with
2,306 additions
and
1,465 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
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
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
116 changes: 65 additions & 51 deletions
116
...del-api/src/main/java/com/evolveum/midpoint/model/api/context/ModelProjectionContext.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 |
---|---|---|
@@ -1,51 +1,65 @@ | ||
/* | ||
* Copyright (c) 2010-2017 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.api.context; | ||
|
||
import com.evolveum.midpoint.prism.delta.ObjectDelta; | ||
import com.evolveum.midpoint.schema.ResourceShadowDiscriminator; | ||
import com.evolveum.midpoint.util.exception.SchemaException; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType; | ||
|
||
/** | ||
* @author semancik | ||
* | ||
*/ | ||
public interface ModelProjectionContext extends ModelElementContext<ShadowType> { | ||
|
||
/** | ||
* Returns synchronization delta. | ||
* | ||
* Synchronization delta describes changes that have recently happened. MidPoint reacts to these | ||
* changes by "pulling them in" (e.g. using them in inbound mappings). | ||
*/ | ||
ObjectDelta<ShadowType> getSyncDelta(); | ||
|
||
void setSyncDelta(ObjectDelta<ShadowType> syncDelta); | ||
|
||
ResourceShadowDiscriminator getResourceShadowDiscriminator(); | ||
|
||
/** | ||
* Decision regarding the account. It describes the overall situation of the account e.g. whether account | ||
* is added, is to be deleted, unliked, etc. | ||
* | ||
* If set to null no decision was made yet. Null is also a typical value when the context is created. | ||
* | ||
* @see SynchronizationPolicyDecision | ||
*/ | ||
SynchronizationPolicyDecision getSynchronizationPolicyDecision(); | ||
|
||
ObjectDelta<ShadowType> getExecutableDelta() throws SchemaException; | ||
|
||
boolean isFullShadow(); | ||
|
||
Boolean isLegal(); | ||
|
||
boolean isExists(); | ||
|
||
boolean isTombstone(); | ||
} | ||
/* | ||
* Copyright (c) 2010-2017 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.api.context; | ||
|
||
import com.evolveum.midpoint.prism.delta.ObjectDelta; | ||
import com.evolveum.midpoint.schema.ResourceShadowDiscriminator; | ||
import com.evolveum.midpoint.util.exception.SchemaException; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType; | ||
|
||
/** | ||
* @author semancik | ||
* | ||
*/ | ||
public interface ModelProjectionContext extends ModelElementContext<ShadowType> { | ||
|
||
/** | ||
* Returns synchronization delta. | ||
* | ||
* Synchronization delta describes changes that have recently happened. MidPoint reacts to these | ||
* changes by "pulling them in" (e.g. using them in inbound mappings). | ||
*/ | ||
ObjectDelta<ShadowType> getSyncDelta(); | ||
|
||
void setSyncDelta(ObjectDelta<ShadowType> syncDelta); | ||
|
||
ResourceShadowDiscriminator getResourceShadowDiscriminator(); | ||
|
||
/** | ||
* Initial intent regarding the account. It indicates what the initiator of the operation | ||
* _wants to do_ with the context. | ||
* | ||
* If set to null then the decision is left to "the engine". Null is also a typical value | ||
* when the context is created. It may be pre-set under some circumstances, e.g. if an account is being unlinked. | ||
*/ | ||
SynchronizationIntent getSynchronizationIntent(); | ||
|
||
/** | ||
* Decision regarding the account. It describes the overall situation of the account e.g. whether account | ||
* is added, is to be deleted, unliked, etc. | ||
* | ||
* If set to null no decision was made yet. Null is also a typical value when the context is created. | ||
* | ||
* @see SynchronizationPolicyDecision | ||
*/ | ||
SynchronizationPolicyDecision getSynchronizationPolicyDecision(); | ||
|
||
/** | ||
* Returns delta suitable for execution. The primary and secondary deltas may not make complete sense all by themselves. | ||
* E.g. they may both be MODIFY deltas even in case that the account should be created. The deltas begin to make sense | ||
* only if combined with sync decision. This method provides the deltas all combined and ready for execution. | ||
*/ | ||
ObjectDelta<ShadowType> getExecutableDelta() throws SchemaException; | ||
|
||
boolean isFullShadow(); | ||
|
||
Boolean isLegal(); | ||
|
||
boolean isExists(); | ||
|
||
boolean isTombstone(); | ||
} |
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
Oops, something went wrong.