Change in ovirt-engine[master]: core: Introducing DisksFilter.filterImageDisks
tnisan at redhat.com
tnisan at redhat.com
Wed Sep 14 14:51:40 UTC 2016
Tal Nisan has submitted this change and it was merged.
Change subject: core: Introducing DisksFilter.filterImageDisks
......................................................................
core: Introducing DisksFilter.filterImageDisks
Introducing the DisksFilter class which currently holds filterImageDisks
with Java 8 predicates implemenations and comes to replace
ImagesHandler::filterImageDisks
The motivations behind that change:
- Using filterImageDisks(disk, true, false, true) is barely readable,
replacing it with filterImageDisks(disk. SNAPABLE_DISKS_ONLY) makes it
way more clear what exactly are we filtering
- Higher usability as those predicates can be used in other filtering
methods instead of repeating an endless unreadable series of ifs
- It's optional to add specific predicates to the filtering method by
writing a Predicate function on the fly
- Slight performance improvement as most of the usages in the code are
filtering 1-2 conditions so we save redundant checks of the parameters
Change-Id: I452385410fcefcc8a786235117608674ec933c50
Signed-off-by: Tal Nisan <tnisan at redhat.com>
---
A backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/disk/image/DisksFilter.java
A backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/disk/image/DisksFilterTest.java
2 files changed, 155 insertions(+), 0 deletions(-)
Approvals:
Tal Nisan: Verified
Jenkins CI: Passed CI tests
Allon Mureinik: Looks good to me, approved
Idan Shaby: Looks good to me, but someone else must approve
--
To view, visit https://gerrit.ovirt.org/62851
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I452385410fcefcc8a786235117608674ec933c50
Gerrit-PatchSet: 6
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Tal Nisan <tnisan at redhat.com>
Gerrit-Reviewer: Ala Hino <ahino at redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini at redhat.com>
Gerrit-Reviewer: Amit Aviram <aaviram at redhat.com>
Gerrit-Reviewer: Freddy Rolland <frolland at redhat.com>
Gerrit-Reviewer: Idan Shaby <ishaby at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Tal Nisan <tnisan at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>
More information about the Engine-commits
mailing list