Gilad Chaplik has posted comments on this change.

Change subject: core, db: add getQosByDiskProfile
......................................................................


Patch Set 4:

(4 comments)

http://gerrit.ovirt.org/#/c/29814/4/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/qos/StorageQosDao.java
File 
backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/qos/StorageQosDao.java:

Line 11:      * @param diskProfileId
Line 12:      *            the disk profile id
Line 13:      * @return qos
Line 14:      */
Line 15:     StorageQos GetQosByDiskProfileId(Guid diskProfileId);
> /s/G/g
Done


http://gerrit.ovirt.org/#/c/29814/4/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/qos/StorageQosDaoDbFacadeImpl.java
File 
backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/qos/StorageQosDaoDbFacadeImpl.java:

Line 16: 
Line 17:     @Override
Line 18:     public StorageQos GetQosByDiskProfileId(Guid diskProfileId) {
Line 19:         MapSqlParameterSource parameterSource = 
getCustomMapSqlParameterSource()
Line 20:                 .addValue("disk_profile_id", diskProfileId.getUuid());
> - no need for disk.getUuid...passing the guid should be enough
Done
Line 21:         return getCallsHandler().executeRead("GetQosByDiskProfile",
Line 22:                 createEntityRowMapper(),
Line 23:                 parameterSource);
Line 24:     }


http://gerrit.ovirt.org/#/c/29814/4/backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/qos/StorageQosDaoTest.java
File 
backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/qos/StorageQosDaoTest.java:

Line 100:     @Test
Line 101:     public void getQosByDiskProfileId() {
Line 102:         StorageQos qos = 
dao.GetQosByDiskProfileId(FixturesTool.DISK_PROFILE_1);
Line 103:         assertNotNull(qos);
Line 104:         assertEquals(FixturesTool.QOS_ID_1, qos.getId());
> consider to get the qos and verify that it's the correct profile.
didn't get you ..
Line 105:     }
Line 106: 


http://gerrit.ovirt.org/#/c/29814/4/packaging/dbscripts/qos_sp.sql
File packaging/dbscripts/qos_sp.sql:

Line 86: RETURN QUERY SELECT qos.*
Line 87:    FROM qos
Line 88:    JOIN disk_profiles ON
Line 89:       (qos.id = disk_profiles.qos_id AND
Line 90:       disk_profiles.id = v_disk_profile_id);
> the second condition is better suit for a WHERE clause and not for the join
* Are this incorrect?
* if so, are you sure it's better in term of performance?
Line 91: END; $procedure$
Line 92: LANGUAGE plpgsql;


-- 
To view, visit http://gerrit.ovirt.org/29814
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: If8e9b246172497412b3dc13d46af85fd155713cf
Gerrit-PatchSet: 4
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Gilad Chaplik <[email protected]>
Gerrit-Reviewer: Arik Hadas <[email protected]>
Gerrit-Reviewer: Gilad Chaplik <[email protected]>
Gerrit-Reviewer: Liron Aravot <[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

Reply via email to