Tal Nisan has posted comments on this change. Change subject: core: Added a query to fetch storage types in a storage pool ......................................................................
Patch Set 2: (4 comments) http://gerrit.ovirt.org/#/c/26981/2/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/StoragePoolDAO.java File backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/StoragePoolDAO.java: Line 137: * @param storagePoolId Line 138: * the storage pool ID. Line 139: * @return the list storage types that are existing in the pool. Line 140: */ Line 141: List<StorageType> getStorageTypesInPool(Guid storagePoolId); > Should be a Set - by contract, the values are distinct, and the order doesn As we discussed face to face - No ;) http://gerrit.ovirt.org/#/c/26981/2/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/StoragePoolDAODbFacadeImpl.java File backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/StoragePoolDAODbFacadeImpl.java: Line 238: getCustomMapSqlParameterSource().addValue("external_id", externalId)); Line 239: } Line 240: Line 241: @Override Line 242: public List<StorageType> getStorageTypesInPool(Guid storagePoolId) { > should be Set - see comment on the interface. As we discussed face to face - No ;) Line 243: MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource() Line 244: .addValue("storage_pool_id", storagePoolId); Line 245: Line 246: return getCallsHandler().executeReadList("GetStorageTypesInPoolByPoolId", storageTypeRowMapper, parameterSource); http://gerrit.ovirt.org/#/c/26981/2/backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/StoragePoolDAOTest.java File backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/StoragePoolDAOTest.java: Line 323: Guid poolId = FixturesTool.STORAGE_POOL_NFS_2; Line 324: List<StorageType> storageTypes = dao.getStorageTypesInPool(poolId); Line 325: assertEquals("Expected one storage type in the pool", 1, storageTypes.size()); Line 326: assertTrue("Expected storage type in the pool to be of type NFS", storageTypes.contains(StorageType.NFS)); Line 327: } > How about a test for a mixed storage pool? And for an SP that doesn't exist Done http://gerrit.ovirt.org/#/c/26981/2/packaging/dbscripts/storages_sp.sql File packaging/dbscripts/storages_sp.sql: Line 834: RETURN QUERY Line 835: SELECT DISTINCT storage_type Line 836: FROM storage_domains Line 837: WHERE storage_pool_id = v_storage_pool_id Line 838: AND storage_domain_type in (0,1); -- 0 = MASTER, 1 = DATA > s/in/IN - it's a reserved word. Done Line 839: END; $procedure$ -- To view, visit http://gerrit.ovirt.org/26981 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I97447e0fc3e087958101156947bded12c1fb9418 Gerrit-PatchSet: 2 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Tal Nisan <tni...@redhat.com> Gerrit-Reviewer: Allon Mureinik <amure...@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