Change in ovirt-engine[master]: webadmin: AbstractUserPortalListModel#onVmAndPoolLoad

Code Review gerrit at ovirt.org
Thu May 4 13:59:57 UTC 2017


>From Allon Mureinik <amureini at redhat.com>:

Allon Mureinik has submitted this change and it was merged.

Change subject: webadmin: AbstractUserPortalListModel#onVmAndPoolLoad
......................................................................


webadmin: AbstractUserPortalListModel#onVmAndPoolLoad

In the original implementation, for N VMs and M pools this method
filtered the pools by using an O(M*N) nested loop and running over
all the VMs for each pool.
A more efficient approach could be to run over all the VMs and
collect them into a map that counts the number of VMs per pool (an
O(N) operation), and then running over all the pools and checking if
each pool hasn't reached it maximum VMs per user (an O(M) operation),
for a total of O(M+N) time-complexity.

Change-Id: I35ee323e073e2c9dcf68897fdaf745d65334c2b0
Signed-off-by: Allon Mureinik <amureini at redhat.com>
---
M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/userportal/AbstractUserPortalListModel.java
1 file changed, 10 insertions(+), 15 deletions(-)

Approvals:
  Tal Nisan: Looks good to me, approved
  Jenkins CI: Passed CI tests
  Allon Mureinik: Verified



-- 
To view, visit https://gerrit.ovirt.org/76443
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I35ee323e073e2c9dcf68897fdaf745d65334c2b0
Gerrit-PatchSet: 4
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: Jakub Niedermertl <jniederm at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Martin Betak <mbetak at redhat.com>
Gerrit-Reviewer: Tal Nisan <tnisan at redhat.com>
Gerrit-Reviewer: Tomas Jelinek <tjelinek at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>


More information about the Engine-commits mailing list