Daniel Erez has posted comments on this change. Change subject: core: introduce GetUnregisteredCinderDisksByStorageDomainIdQuery ......................................................................
Patch Set 2: (3 comments) https://gerrit.ovirt.org/#/c/39650/2/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/CinderBroker.java File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/CinderBroker.java: Line 172: cinderDisk.setImageStatus(ImageStatus.OK); Line 173: cinderDisk.setvolumeFormat(VolumeFormat.RAW); Line 174: cinderDisk.setDiskInterface(DiskInterface.VirtIO); Line 175: try { Line 176: cinderDisk.setCreationDate(new SimpleDateFormat(DATE_FORMAT).parse(volume.getCreatedAt())); > Can an exception be thrown here, or is it just a mandatory for using this A theoretically yes, if the format of the date is invalid Line 177: } catch (ParseException e) { Line 178: cinderDisk.setCreationDate(null); Line 179: } Line 180: return cinderDisk; Line 173: cinderDisk.setvolumeFormat(VolumeFormat.RAW); Line 174: cinderDisk.setDiskInterface(DiskInterface.VirtIO); Line 175: try { Line 176: cinderDisk.setCreationDate(new SimpleDateFormat(DATE_FORMAT).parse(volume.getCreatedAt())); Line 177: } catch (ParseException e) { > Please add a log here Done Line 178: cinderDisk.setCreationDate(null); Line 179: } Line 180: return cinderDisk; Line 181: } https://gerrit.ovirt.org/#/c/39650/2/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/GetUnregisteredCinderDisksByStorageDomainIdQuery.java File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/GetUnregisteredCinderDisksByStorageDomainIdQuery.java: Line 21: @Override Line 22: protected void executeQueryCommand() { Line 23: final List<Volume> allVolumes = getVolumeProviderProxy().getVolumes(); Line 24: final List<Disk> registeredDisks = Line 25: getDbFacade().getDiskDao().getAllWithQuery(String.format("SELECT * FROM all_disks where disk_storage_type = '%d'", > This is not the way to do filtering form the DB, you should add a new store Done Line 26: DiskStorageType.CINDER.getValue())); Line 27: Line 28: List<Volume> unregisteredVolumes = LinqUtils.filter(allVolumes, new Predicate<Volume>() { Line 29: @Override -- To view, visit https://gerrit.ovirt.org/39650 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I38c61f1763c4841101c199721414371acf101d59 Gerrit-PatchSet: 2 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Daniel Erez <[email protected]> Gerrit-Reviewer: Daniel Erez <[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
