Gilad Chaplik has posted comments on this change.

Change subject: engine: consolidate userPortal vm and pool queries
......................................................................


Patch Set 1: (5 inline comments)

....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/GetAllVmsAndVmPoolsQuery.java
Line 13: public class GetAllVmsAndVmPoolsQuery<P extends 
VdcQueryParametersBase> extends QueriesCommandBase<P> {
Line 14:     public GetAllVmsAndVmPoolsQuery(P parameters) {
Line 15:         super(parameters);
Line 16:     }
Line 17: 
1. yes, both of the queries are called simultaneously every 5sec (worst case), 
and are unseparable, the single query enhance performance in server, network, 
and mainly in client side.
2. because this is a 'client query' that convey the combined elements in a 
single grid, I'd prefer having it in one list.
Line 18:     @Override
Line 19:     protected void executeQueryCommand() {
Line 20:         boolean isSucceeded = true;
Line 21:         List<Object> retValList = new ArrayList<Object>();


Line 17: 
Line 18:     @Override
Line 19:     protected void executeQueryCommand() {
Line 20:         boolean isSucceeded = true;
Line 21:         List<Object> retValList = new ArrayList<Object>();
after reading about it a little, I'd prefer to leave it that way.
you can raise a Q to engine-devel.
Line 22:         VdcQueryReturnValue queryResult = 
Backend.getInstance().runInternalQuery(VdcQueryType.GetAllVms, getParameters());
Line 23:         if (queryResult != null && queryResult.getSucceeded()) {
Line 24:             retValList.addAll((List<VM>) queryResult.getReturnValue());
Line 25:         } else {


....................................................
File 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/userportal/UserPortalBasicListModel.java
Line 129:                 new AsyncQuery(this, new INewAsyncCallback() {
Line 130: 
Line 131:                     @Override
Line 132:                     public void OnSuccess(Object model, Object 
returnValue) {
Line 133:                         UserPortalBasicListModel 
userPortalBasicListModel = (UserPortalBasicListModel) model;
We can do it a later patch to avoid regressions. this is not the main purpose 
of this fix.
Line 134:                         ArrayList<VM> vms = new ArrayList<VM>();
Line 135:                         ArrayList<vm_pools> pools = new 
ArrayList<vm_pools>();
Line 136: 
Line 137:                         VdcQueryReturnValue retValue = 
(VdcQueryReturnValue) returnValue;


Line 136: 
Line 137:                         VdcQueryReturnValue retValue = 
(VdcQueryReturnValue) returnValue;
Line 138:                         if (retValue != null && 
retValue.getSucceeded()) {
Line 139:                             List<Object> list = (ArrayList<Object>) 
retValue.getReturnValue();
Line 140:                             for (Object object : list) {
Done
Line 141:                                 if (object instanceof VM) {
Line 142:                                     vms.add((VM) object);
Line 143:                                 } else if (object instanceof 
vm_pools) {
Line 144:                                     pools.add((vm_pools) object);


....................................................
File 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/userportal/UserPortalListModel.java
Line 355: 
Line 356:                         VdcQueryReturnValue retValue = 
(VdcQueryReturnValue) returnValue;
Line 357:                         if (retValue != null && 
retValue.getSucceeded()) {
Line 358:                             List<Object> list = (ArrayList<Object>) 
retValue.getReturnValue();
Line 359:                             for (Object object : list) {
Done
Line 360:                                 if (object instanceof VM) {
Line 361:                                     vms.add((VM) object);
Line 362:                                 } else if (object instanceof 
vm_pools) {
Line 363:                                     pools.add((vm_pools) object);


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I59346bc9f1cf6d948c4401ddbd7bb365c67b5b05
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Gilad Chaplik <[email protected]>
Gerrit-Reviewer: Alona Kaplan <[email protected]>
Gerrit-Reviewer: Doron Fediuck <[email protected]>
Gerrit-Reviewer: Einav Cohen <[email protected]>
Gerrit-Reviewer: Gilad Chaplik <[email protected]>
Gerrit-Reviewer: Liron Aravot <[email protected]>
Gerrit-Reviewer: Vojtech Szocs <[email protected]>
Gerrit-Reviewer: ofri masad <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to