Change in ovirt-engine[master]: core: Don't clone Guids in VDS.clone()

amureini at redhat.com amureini at redhat.com
Thu Jul 4 17:30:06 UTC 2013


Allon Mureinik has submitted this change and it was merged.

Change subject: core: Don't clone Guids in VDS.clone()
......................................................................


core: Don't clone Guids in VDS.clone()

Since Guids are immutable, there is no need for VDS.clone() to create
new Guid instances, especially not by the expensive string-parsing
method.

This patch changes the new instance created by VDS.clone() to simply
hold references to the old one's Guid, thus improving performance.
As a nice side bonus, this will allow cloning of VDS instances that have
null VDS group or storage pool IDs.

This patch also contains a test to assert this functionality.

Change-Id: I0f7130f76525dda601ac0bc7322fbf96c961c5a6
Signed-off-by: Allon Mureinik <amureini at redhat.com>
---
M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VDS.java
A backend/manager/modules/common/src/test/java/org/ovirt/engine/core/common/businessentities/VDSTest.java
2 files changed, 39 insertions(+), 2 deletions(-)

Approvals:
  Allon Mureinik: Verified; Looks good to me, approved


-- 
To view, visit http://gerrit.ovirt.org/16433
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I0f7130f76525dda601ac0bc7322fbf96c961c5a6
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Allon Mureinik <amureini at redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini at redhat.com>
Gerrit-Reviewer: Laszlo Hornyak <lhornyak at redhat.com>
Gerrit-Reviewer: Tal Nisan <tnisan at redhat.com>
Gerrit-Reviewer: Yair Zaslavsky <yzaslavs at redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server



More information about the Engine-commits mailing list