Michael Kublin has submitted this change and it was merged.
Change subject: engine: Replacing getVds() query by getVdsStatic() query in VDSCommands
......................................................................
engine: Replacing getVds() query by getVdsStatic() query in VDSCommands
The following patch will replace a getVds() query by getVdsStatic() query in almost all
vds (not spm) commands.
THe reasons are:
1. A getVds() query - is a query to view, which is based on JOIN from at least 7 tables,
getVdsStatic() it is a query
to single table, meaning much more faster.
2. VDSStatic object is smaller than VDS object, less resources spent on retrievening it
from DB, allocatin memory, etc...
3. VDSStatic object almost never changed, it is means that when it will be cached, we will
not perfrom any query during
vds commands, the VDS object contains VDSDynamic part, which is changed very frequently,
so caching of VDS object is more
difficult and possible not efficient.
4. No reason to use VDS object , when we can use VDSStatic object
Also patch includes a following fixes and improvements:
1. FullListVDSCommand will never perform a query to vds object, it will be passed via
parameters
2. A part of code moved from GetCapabilitiesVDSCommand to CollectVdsNetworkDataVDSCommand,
this code is not relevant
for GetCapabilitiesVDSCommand and only relevant for CollectVdsNetworkDataVDSCommand
3. Code clean up
Also, after applying a patch, a query for VDSStatic will be made only if it is required to
log command, and not always in
constractor
Change-Id: Iff6fa35e25bcd895c25359ece6ba4d5ce9c8e8cf
Signed-off-by: Michael Kublin <mkublin(a)redhat.com>
---
M
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/vdscommands/FullListVDSCommandParameters.java
M
backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VdsUpdateRunTimeInfo.java
M
backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/CollectVdsNetworkDataVDSCommand.java
M
backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/CreateVGVDSCommand.java
M
backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/GetCapabilitiesVDSCommand.java
M
backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/SetVmTicketVDSCommand.java
M
backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/SpmStartVDSCommand.java
M
backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/SpmStatusVDSCommand.java
M
backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/SpmStopVDSCommand.java
M
backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VdsBrokerCommand.java
M
backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VmStatsVdsBrokerCommand.java
M
backend/manager/modules/vdsbroker/src/test/java/org/ovirt/engine/core/vdsbroker/vdsbroker/SetupNetworksVDSCommandTest.java
12 files changed, 45 insertions(+), 40 deletions(-)
Approvals:
Michael Kublin: Verified; Looks good to me, approved
--
To view, visit
http://gerrit.ovirt.org/14321
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Iff6fa35e25bcd895c25359ece6ba4d5ce9c8e8cf
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Michael Kublin <mkublin(a)redhat.com>
Gerrit-Reviewer: Barak Azulay <bazulay(a)redhat.com>
Gerrit-Reviewer: Eli Mesika <emesika(a)redhat.com>
Gerrit-Reviewer: Michael Kublin <mkublin(a)redhat.com>
Gerrit-Reviewer: Yair Zaslavsky <yzaslavs(a)redhat.com>