Liron Aravot has posted comments on this change.

Change subject: core: Add unregistered entities to the ovf tar file
......................................................................


Patch Set 8:

(1 comment)

http://gerrit.ovirt.org/#/c/32745/8/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ProcessOvfUpdateForStorageDomainCommand.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ProcessOvfUpdateForStorageDomainCommand.java:

Line 188:     private void addUnregisteredEntities(List<Pair<Guid, String>> 
ovfs, List<Guid> idsToProcess) {
Line 189:         List<OvfEntityData> ovfList = 
getUnregisteredOVFDataDao().getAllForStorageDomainByEntityType(
Line 190:                 getParameters().getStorageDomainId(), null);
Line 191:         for (OvfEntityData ovfEntityData : ovfList) {
Line 192:             if (idsToProcess.contains(ovfEntityData.getEntityId())) {
1. the if should have !, right now the unregistered data won't be added..

2. the performance here won't be good, as for each element we'll almost always 
scan the whole list.
what you should do is to change the type of 'ovfs' in line 173 to map, and 
check here if it contains the id.
Line 193:                 Pair<Guid, String> ovfData = new 
Pair<>(ovfEntityData.getEntityId(), ovfEntityData.getOvfData());
Line 194:                 ovfs.add(ovfData);
Line 195:             }
Line 196:         }


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Icc5fc1c1b704ecbb49fe3d4c2561ec1836093369
Gerrit-PatchSet: 8
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Maor Lipchuk <mlipc...@redhat.com>
Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com>
Gerrit-Reviewer: Daniel Erez <de...@redhat.com>
Gerrit-Reviewer: Liron Aravot <lara...@redhat.com>
Gerrit-Reviewer: Maor Lipchuk <mlipc...@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