Change in ovirt-engine[master]: core: change asyncRunningVms to be Set

ahadas at redhat.com ahadas at redhat.com
Thu Feb 20 15:20:02 UTC 2014


Arik Hadas has submitted this change and it was merged.

Change subject: core: change asyncRunningVms to be Set
......................................................................


core: change asyncRunningVms to be Set

ResourceManager#_asyncRunningVms used to be of type ConcurrentHashMap
but provided functionality of Set. Since Java 1.6 there is an easy
way to create thread-safe Set which is based on ConcurrentHashMap. By
setting the asyncRunningVms collection to such Set, our code becomes
more expressive and easier to read, and we don't change the correctness
since we are using the same underlying implementation (one difference
though is that the implementation now uses put instead of putIfAbsent,
but it does not matter because we are always using the same value).

This patch also contains minor refactoring in ResourceManager.

Change-Id: I807936d76ee7298a126e7dd61d75cbb345e06829
Signed-off-by: Arik Hadas <ahadas at redhat.com>
---
M backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/ResourceManager.java
1 file changed, 24 insertions(+), 27 deletions(-)

Approvals:
  Roy Golan: Looks good to me, approved
  Arik Hadas: Verified; Looks good to me, approved



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

Gerrit-MessageType: merged
Gerrit-Change-Id: I807936d76ee7298a126e7dd61d75cbb345e06829
Gerrit-PatchSet: 6
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Arik Hadas <ahadas at redhat.com>
Gerrit-Reviewer: Arik Hadas <ahadas at redhat.com>
Gerrit-Reviewer: Omer Frenkel <ofrenkel at redhat.com>
Gerrit-Reviewer: Roy Golan <rgolan 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