Michael Kublin has posted comments on this change. Change subject: core:WIP: introducing OvfAutoUpdate ......................................................................
Patch Set 10: (8 inline comments) .................................................... File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/OvfDataUpdater.java Line 43: import org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl; Line 44: Line 45: public final class OvfDataUpdater { Line 46: private static final Log log = LogFactory.getLog(OvfDataUpdater.class); Line 47: private static final OvfDataUpdater INSTANCE = new OvfDataUpdater(); Add hard-coded max for number of guids for db update Line 48: private static final int ITEMS_COUNT_PER_UPDATE = Config.<Integer> GetValue(ConfigValues.OvfItemsCountPerUpdate); Line 49: Line 50: Line 51: private final Map<Guid, KeyValuePairCompat<String, List<Guid>>> vmsAndTemplateMetadata; Line 47: private static final OvfDataUpdater INSTANCE = new OvfDataUpdater(); Line 48: private static final int ITEMS_COUNT_PER_UPDATE = Config.<Integer> GetValue(ConfigValues.OvfItemsCountPerUpdate); Line 49: Line 50: Line 51: private final Map<Guid, KeyValuePairCompat<String, List<Guid>>> vmsAndTemplateMetadata; vmsAndTemplateMetadata - should not be as class variable Line 52: private final List<Guid> proccessedIdsInfo; Line 53: private final List<Long> proccessedOvfGenerationsInfo; Line 54: OvfManager ovfManager; Line 55: Line 115: // get vm ids that needs to be updated. Line 116: List<Guid> vmsIdsForUpdate = getVmAndTemplatesGenerationsDao().getVmsIdsForOvfUpdate(poolId); Line 117: int i = 0; Line 118: while (i < vmsIdsForUpdate.size()) { Line 119: int delta = vmsIdsForUpdate.size() - i; please separate to if Line 120: int size = delta >= ITEMS_COUNT_PER_UPDATE ? ITEMS_COUNT_PER_UPDATE : delta; Line 121: List<Guid> idsToProcess = vmsIdsForUpdate.subList(i, i+size); Line 122: i+= size; Line 123: Line 116: List<Guid> vmsIdsForUpdate = getVmAndTemplatesGenerationsDao().getVmsIdsForOvfUpdate(poolId); Line 117: int i = 0; Line 118: while (i < vmsIdsForUpdate.size()) { Line 119: int delta = vmsIdsForUpdate.size() - i; Line 120: int size = delta >= ITEMS_COUNT_PER_UPDATE ? ITEMS_COUNT_PER_UPDATE : delta; these is Math.min() Line 121: List<Guid> idsToProcess = vmsIdsForUpdate.subList(i, i+size); Line 122: i+= size; Line 123: Line 124: populateVmsMetadataForOvfUpdate(idsToProcess); Line 186: List<Guid> templateIdsForUpdate = getVmAndTemplatesGenerationsDao(). Line 187: getVmTemplatesIdsForOvfUpdate(poolId); Line 188: int i = 0; Line 189: while (i < templateIdsForUpdate.size()) { Line 190: int delta = templateIdsForUpdate.size() - i; Math.min() Line 191: int size = delta >= ITEMS_COUNT_PER_UPDATE ? ITEMS_COUNT_PER_UPDATE : delta; Line 192: List<Guid> idsToProcess = templateIdsForUpdate.subList(i, i+size); Line 193: i+= size; Line 194: Line 241: String templateMeta = ovfManager.ExportTemplate(template, allTemplateImages); Line 242: metaDictionary.put(template.getId(), new KeyValuePairCompat<String, List<Guid>>( Line 243: templateMeta, LinqUtils.foreach(allTemplateImages, new Function<DiskImage, Guid>() { Line 244: @Override Line 245: public Guid eval(DiskImage diskImage) { change to getId(), getimage_group_id() - is deprecated Line 246: return diskImage.getimage_group_id().getValue(); Line 247: } Line 248: }))); Line 249: } Line 257: Line 258: protected void loadVmData(VM vm) { Line 259: if (vm.getInterfaces().isEmpty()) { Line 260: vm.setInterfaces(DbFacade.getInstance().getVmNetworkInterfaceDao().getAllForVm(vm.getId())); Line 261: } && !Guid.Empty.equals((vm.getvmt_guid()) Line 262: if (StringUtils.isEmpty(vm.getvmt_name())) { Line 263: VmTemplate t = DbFacade.getInstance().getVmTemplateDao().get(vm.getvmt_guid()); Line 264: vm.setvmt_name(t.getname()); Line 265: } .................................................... File backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/irsbroker/UpdateVMVDSCommand.java Line 53: VdcBllErrors returnStatus = GetReturnValueFromStatus(getReturnStatus()); Line 54: if (returnStatus != VdcBllErrors.Done) { Line 55: getVDSReturnValue().setSucceeded(false); Line 56: InitializeVdsError(returnStatus); Line 57: } change exception Line 58: } Line 59: Line 60: @Override Line 61: protected VDSExceptionBase createDefaultConcreteException(String errorMessage) { -- To view, visit http://gerrit.ovirt.org/9328 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9b5132300fb1f1fd94f771cab15efe5246dbeca8 Gerrit-PatchSet: 10 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Liron Aravot <lara...@redhat.com> Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com> Gerrit-Reviewer: Arik Hadas <aha...@redhat.com> Gerrit-Reviewer: Ayal Baron <aba...@redhat.com> Gerrit-Reviewer: Liron Aravot <lara...@redhat.com> Gerrit-Reviewer: Maor Lipchuk <mlipc...@redhat.com> Gerrit-Reviewer: Michael Kublin <mkub...@redhat.com> Gerrit-Reviewer: Tal Nisan <tni...@redhat.com> Gerrit-Reviewer: Vered Volansky <vvola...@redhat.com> Gerrit-Reviewer: Yair Zaslavsky <yzasl...@redhat.com> Gerrit-Reviewer: liron aravot <liron.ara...@gmail.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches