Ori Liel has posted comments on this change.
Change subject: restapi: Improve Performance in mapper tests
......................................................................
Patch Set 1:
(1 comment)
....................................................
File
backend/manager/modules/restapi/types/src/test/java/org/ovirt/engine/api/restapi/types/VmMapperTest.java
Line 81: from.getCpu().setCpuTune(cpuTune);
Line 82: from.setTimezone("Australia/Darwin");
Line 83: from.setPlacementPolicy(new VmPlacementPolicy());
Line 84: from.getPlacementPolicy().setHost(new Host());
Line 85:
from.getPlacementPolicy().getHost().setId(Guid.Empty.toString());
The purpose of this patch is to improve performance of the mapper tests. The
new logic says: When populating an entity recursively, if you're not in level 1
of the recursion. don't populate elements that exist as members in the root
object.
VM (the root object in this test) has a reference to its Host.
When Host entity is encountered again later at: VM-->PlacementPolicy-->Host,
it's not populated, due to the new rule (VM has a reference to host, and this
is level 2 of the recursion).
But in this specific case we actually do want the host id to be populated. So
to deal with this only exceptional case of its kind, I manually set the host id
inside the placement policy.
Line 86: return from;
Line 87: }
Line 88:
Line 89: @Override
--
To view, visit http://gerrit.ovirt.org/19670
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I29908ea9d5cf232a3079f28927b70ad0ce37a010
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Ori Liel <[email protected]>
Gerrit-Reviewer: Michael Pasternak <[email protected]>
Gerrit-Reviewer: Ori Liel <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches