Martin Sivák has posted comments on this change.

Change subject: Added affinity Group collision test to canDoAction
......................................................................


Patch Set 3:

(3 comments)

https://gerrit.ovirt.org/#/c/41805/3/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/commands/AffinityGroupCRUDCommand.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/commands/AffinityGroupCRUDCommand.java:

Line 71: /**
I think there is a more readable algorithm eating about the same amount of 
memory:

# Compute a list of linked VMs for each VM
uag = Map<VM, Set<VM>>

# Initial UAG from affinity groups
for each positive hard affinity group pos_ag:
  for each vm in pos_ag:
    uag[vm] += pos_ag.allVms()

# Transitional closure of the incidence matrix
# (add all transitionally reachable VMs)
do {
  changed = False
  for each vm in uag.keys():
    for each other_vm in uag[vm]:
      uag[vm] += uag[other_vm]
    if uag[vm] size changed:
      changed = True
} while (changed)

# Check for positive vs. negative conflict
for each negative hard affinity group neg_ag:
  for each vm in neg_ag:
    if neg_ag.allVms() intersection with uag[vm] > 1:
      fail


Line 87: :
Do you put all positive and negative groups to the uag here? What is the reason 
for doing that?


Line 132: ag
Why are you doing this after the conflict check? It has no influence on the 
result.


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I56c483023ed14e238c8a67ec0890812158ecd0b2
Gerrit-PatchSet: 3
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Tomer Saban <tsa...@redhat.com>
Gerrit-Reviewer: Gilad Chaplik <gchap...@redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Martin Sivák <msi...@redhat.com>
Gerrit-Reviewer: Roy Golan <rgo...@redhat.com>
Gerrit-Reviewer: Tomer Saban <tsa...@redhat.com>
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to