Maor Lipchuk has posted comments on this change. Change subject: core: Use the latest OVF_STORE files ......................................................................
Patch Set 5: (4 comments) http://gerrit.ovirt.org/#/c/32747/5/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/AttachStorageDomainToPoolCommand.java File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/AttachStorageDomainToPoolCommand.java: Line 192: } Line 193: } Line 194: } Line 195: Line 196: protected List<OvfEntityData> getEntitiesFromStorageOvfDisk() { > this method name is no longer correct, you also save data here. Changed the name to initiateOvfStoreDiskRegistration, also added a java doc comment Line 197: List<OvfEntityData> ovfEntitiesFromTar = Collections.emptyList(); Line 198: // Get all unregistered disks. Line 199: List<Disk> unregisteredDisks = getBackend().runInternalQuery(VdcQueryType.GetUnregisteredDisks, Line 200: new GetUnregisteredDisksQueryParameters(getParameters().getStorageDomainId(), Line 203: List<DiskImage> ovfStoreDiskImages = getAllOVFDisks(unregisteredDisks); Line 204: if (!ovfStoreDiskImages.isEmpty()) { Line 205: registerAllOvfDisks(ovfStoreDiskImages); Line 206: boolean entitiesRetrieved = false; Line 207: while (!ovfStoreDiskImages.isEmpty()) { > you need here a for-each loop instead, there's no need to remove from that we can't do for loop here, since every time we get the best match OVF_STORE disk until it is succeeded. The alternative will be much more worst performance wize Line 208: Pair<DiskImage, Long> ovfDiskAndSize = getLatestOVFDisk(ovfStoreDiskImages); Line 209: DiskImage ovfDisk = ovfDiskAndSize.getFirst(); Line 210: if (ovfDisk != null) { Line 211: if (!entitiesRetrieved) { Line 258: null, Line 259: ovfDisk.getId(), Line 260: StorageDomainOvfInfoStatus.OUTDATED, Line 261: null); Line 262: getDbFacade().getStorageDomainOvfInfoDao().save(storageDomainOvfInfo); > have you looked into transactivity of that new addition with the rest of th I will call getEntitiesFromStorageOvfDisk as part of the transaction at line 159. Line 263: } Line 264: Line 265: private void registerAllOvfDisks(List<DiskImage> ovfStoreDiskImages) { Line 266: for (DiskImage ovfStoreDiskImage : ovfStoreDiskImages) { Line 276: } catch (Exception e) { Line 277: result = "failed"; Line 278: log.error(e); Line 279: } Line 280: log.infoFormat("Register new floating OVF_STORE disk with disk id {0} for storage domain {1} has {2}", > seems to belong to a different patch Yes, moved back to the correct patch Line 281: ovfStoreDiskImage.getId(), Line 282: getParameters().getStorageDomainId(), Line 283: result); Line 284: } -- To view, visit http://gerrit.ovirt.org/32747 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8252281f295df49a28c3c131d9a98fef9af8f35e Gerrit-PatchSet: 5 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Maor Lipchuk <[email protected]> Gerrit-Reviewer: Allon Mureinik <[email protected]> Gerrit-Reviewer: Daniel Erez <[email protected]> Gerrit-Reviewer: Liron Aravot <[email protected]> Gerrit-Reviewer: Maor Lipchuk <[email protected]> Gerrit-Reviewer: [email protected] Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
