Liron Aravot has posted comments on this change.

Change subject: core: add disk profile to disk's commands
......................................................................


Patch Set 18:

(3 comments)

http://gerrit.ovirt.org/#/c/29038/18/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/profiles/DiskProfileHelper.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/profiles/DiskProfileHelper.java:

Line 40:                 if 
(!storageDiskProfilesMap.containsKey(storageDomainId)) {
Line 41:                     storageDiskProfilesMap.put(storageDomainId,
Line 42:                             
getDiskProfileDao().getAllForStorageDomain(storageDomainId));
Line 43:                 }
Line 44:                 List<DiskProfile> diskProfilesList = 
storageDiskProfilesMap.get(storageDomainId);
just get once instead contains/get
Line 45:                 if (diskProfilesList.size() == 1) {
Line 46:                     diskProfile = diskProfilesList.get(0);
Line 47:                     diskImage.setDiskProfileId(diskProfile.getId());
Line 48:                 }


Line 49:             } else {
Line 50:                 diskProfile = 
getDiskProfileDao().get(diskImage.getDiskProfileId());
Line 51:             }
Line 52: 
Line 53:             if (validDiskProfileForStorageDomainId.get(diskProfile) != 
storageDomainId) {
fix
Line 54:                 ValidationResult result = new 
DiskProfileValidator(diskProfile).isStorageDomainValid(storageDomainId);
Line 55:                 validDiskProfileForStorageDomainId.put(diskProfile, 
storageDomainId);
Line 56:                 if (result != ValidationResult.VALID) {
Line 57:                     return result;


Line 51:             }
Line 52: 
Line 53:             if (validDiskProfileForStorageDomainId.get(diskProfile) != 
storageDomainId) {
Line 54:                 ValidationResult result = new 
DiskProfileValidator(diskProfile).isStorageDomainValid(storageDomainId);
Line 55:                 validDiskProfileForStorageDomainId.put(diskProfile, 
storageDomainId);
switch order
Line 56:                 if (result != ValidationResult.VALID) {
Line 57:                     return result;
Line 58:                 }
Line 59:             }


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ie7b6d977243cffc0bde772665ebaca47340075c6
Gerrit-PatchSet: 18
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Gilad Chaplik <gchap...@redhat.com>
Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com>
Gerrit-Reviewer: Arik Hadas <aha...@redhat.com>
Gerrit-Reviewer: Daniel Erez <de...@redhat.com>
Gerrit-Reviewer: Doron Fediuck <dfedi...@redhat.com>
Gerrit-Reviewer: Gilad Chaplik <gchap...@redhat.com>
Gerrit-Reviewer: Liron Aravot <lara...@redhat.com>
Gerrit-Reviewer: Tal Nisan <tni...@redhat.com>
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to