Change in ovirt-engine[master]: core: MacPoolManager strategy, alternative implementation

mkolesni at redhat.com mkolesni at redhat.com
Tue Jun 17 12:54:46 UTC 2014


Mike Kolesnik has submitted this change and it was merged.

Change subject: core: MacPoolManager strategy, alternative implementation
......................................................................


core: MacPoolManager strategy, alternative implementation

* introduced new alternative implentation of MacPoolManager
which is less eager browsing its internal structures and
less in need of RAM. There is still need of counting how many
times is each MAC used, but duplicate MAC address is something which
is not expected to occur very often. BitSet is used to store whether
is MAC used or not, and if it has usage higher than 1, pair
MAC<-->count is stored in Map. Counts of user specified MAC outside
from that MAC range are
still stored in HashMap, but modifiable int wrappers are used
instead of java.lang.Integer to cut down calls to HashMap.
*user can input multiple MAC ranges and original implementation
dealt with duplicates using HashSet, which means potentially lot
of unnecessary effort and copying data in RAM from one place to
another. New class RangesWithoutOverlaps was introduced, which
takes user input and transfors it into N intervals
(as few as possible) without overlaps.
*MacPoolManager is singleton; only 'getInstance()' has to be
static other methods should be instance methods. Having them
static is mixing concepts.

Change-Id: I69a5c1b3b43966e49fa6039597c06966ce514618
Bug-Url: https://bugzilla.redhat.com/1063064
Signed-off-by: Martin Mucha <mmucha at redhat.com>
---
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/MacPoolManager.java
D backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/MacPoolManagerOriginal.java
A backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/MacPoolManagerRanges.java
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/MacPoolManagerStrategy.java
A backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/MacsStorage.java
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/ObjectCounter.java
A backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/Range.java
A backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/network/RangeTest.java
M backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/MacAddressRangeUtils.java
M backend/manager/modules/utils/src/test/java/org/ovirt/engine/core/utils/MacAddressRangeUtilsTest.java
10 files changed, 682 insertions(+), 401 deletions(-)

Approvals:
  Mike Kolesnik: Verified; Looks good to me, approved



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

Gerrit-MessageType: merged
Gerrit-Change-Id: I69a5c1b3b43966e49fa6039597c06966ce514618
Gerrit-PatchSet: 32
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Martin Mucha <mmucha at redhat.com>
Gerrit-Reviewer: Martin Mucha <mmucha at redhat.com>
Gerrit-Reviewer: Mike Kolesnik <mkolesni at redhat.com>
Gerrit-Reviewer: Moti Asayag <masayag at redhat.com>
Gerrit-Reviewer: Yevgeny Zaspitsky <yzaspits at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server



More information about the Engine-commits mailing list