Tal Nisan has posted comments on this change. Change subject: core: Added a query to fetch the number of images in a storage domain ......................................................................
Patch Set 1: (5 comments) http://gerrit.ovirt.org/#/c/28958/1/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/StorageDomainDAO.java File backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/StorageDomainDAO.java: Line 199: * Retrieves the number of images in the specified storage domain. Line 200: * Line 201: * @param storageId Line 202: * The storage domain ID Line 203: * @return the number of images in the specified storage domain > Need to also document that a non-existing domain returns 0 Done Line 204: */ Line 205: long getNumberOfImagesInStorageDomain(Guid storageDomainId); http://gerrit.ovirt.org/#/c/28958/1/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/StorageDomainDAODbFacadeImpl.java File backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/StorageDomainDAODbFacadeImpl.java: Line 206: } Line 207: Line 208: @Override Line 209: public long getNumberOfImagesInStorageDomain(Guid storageDomainId) { Line 210: MapSqlParameterSource params = getCustomMapSqlParameterSource().addValue("storage_domain_id", storageDomainId); > I'd inline this to conform with the rest of the class. Done Line 211: return getCallsHandler().executeRead("GetNumberOfImagesInStorageDomain", getLongMapper(), params); Line 212: } Line 213: Line 214: /** Line 226: } Line 227: return returnValue; Line 228: } Line 229: Line 230: > Unrelated to the patch Done http://gerrit.ovirt.org/#/c/28958/1/backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/StorageDomainDAOTest.java File backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/StorageDomainDAOTest.java: Line 428: Line 429: @Test Line 430: public void testGetNumberOfImagesInExistingDomain() { Line 431: long numOfImages = dao.getNumberOfImagesInStorageDomain(EXISTING_DOMAIN_ID); Line 432: assertEquals("Number of images on storage domain different than expected", NUMBER_OF_IMAGES_ON_EXISTING_DOMAIN, numOfImages); > Does this test include snapshots (i.e., images with active=false)? Yes, 42058975-3d5e-484a-80c1-01c31207f579 Line 433: } Line 434: Line 435: @Test Line 436: public void testGetNumberOfImagesInNonExistingDomain() { http://gerrit.ovirt.org/#/c/28958/1/packaging/dbscripts/storages_sp.sql File packaging/dbscripts/storages_sp.sql: Line 895: SELECT COUNT(*) Line 896: FROM images i Line 897: JOIN image_storage_domain_map isdm Line 898: ON i.image_guid = isdm.image_id Line 899: WHERE isdm.storage_domain_id = v_storage_domain_id; > Actually, why do you need the join? Done Line 900: END; $procedure$ -- To view, visit http://gerrit.ovirt.org/28958 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id771444bc7d8916faa5e98fd54afb3d43157da15 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Tal Nisan <tni...@redhat.com> Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com> Gerrit-Reviewer: Daniel Erez <de...@redhat.com> Gerrit-Reviewer: Eli Mesika <elimes...@gmail.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