Allon Mureinik has submitted this change and it was merged.
Change subject: core: Remove StorageDomainFilter
......................................................................
core: Remove StorageDomainFilter
StorageDomainFilter was a wrapper for two methods - an abstract method
returning a Predicate and a filterStorageDomains method that applied
that filtered a List<StorageDomain> by that predicate. Since in Java 8's
filtering a list is so easy, there's really no reason to have this in a
dedicated class. This patch removes the StorageDomainFilter class and
just keeps the Predicates and moves the filtering to
MemoryStorageHandler.
A side effect of this patch is a slightly improved performance of the
filtering. Even though the current implementation potentially still has to
perform M (filters) * N (domains) evaluations, it collects the result
only once, instead of having to construct a list M times.
Change-Id: I3795e2f81919fbb6ed92636343d04ed913de937f
Signed-off-by: Allon Mureinik <amureini(a)redhat.com>
---
M
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/memory/MemoryStorageHandler.java
D
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/memory/sdfilters/StorageDomainFilter.java
M
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/memory/sdfilters/StorageDomainSpaceRequirementsFilter.java
M
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/memory/sdfilters/StorageDomainStatusFilter.java
M
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/memory/sdfilters/StorageDomainTypeFilter.java
M
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/memory/MemoryStorageHandlerTest.java
D
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/memory/sdfilters/StorageDomainFilterTest.java
M
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/memory/sdfilters/StorageDomainSpaceRequirementsFilterTest.java
M
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/memory/sdfilters/StorageDomainStatusFilterTest.java
M
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/memory/sdfilters/StorageDomainTypeFilterTest.java
10 files changed, 37 insertions(+), 111 deletions(-)
Approvals:
Tal Nisan: Looks good to me, approved
Allon Mureinik: Verified; Passed CI tests
Idan Shaby: Looks good to me, but someone else must approve
--
To view, visit
https://gerrit.ovirt.org/60684
To unsubscribe, visit
https://gerrit.ovirt.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I3795e2f81919fbb6ed92636343d04ed913de937f
Gerrit-PatchSet: 6
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Allon Mureinik <amureini(a)redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini(a)redhat.com>
Gerrit-Reviewer: Idan Shaby <ishaby(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Tal Nisan <tnisan(a)redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>