Gilad Chaplik has posted comments on this change.

Change subject: db: aggregate qos and storage qos impl
......................................................................


Patch Set 6:

(3 comments)

http://gerrit.ovirt.org/#/c/27094/6/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/qos/BaseQosDaoFacadeImpl.java
File 
backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/qos/BaseQosDaoFacadeImpl.java:

Line 12: import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
Line 13: 
Line 14: public abstract class BaseQosDaoFacadeImpl<T extends BaseQos> extends 
DefaultGenericDaoDbFacade<T, Guid> implements QosDao<T> {
Line 15:     private final QosType qosType;
Line 16:     RowMapper<T> mapper = createEntityRowMapper();
> so let me see if i get this right:
Moti,

I know that it's hard to track me :-) you're not the first one.

to which toString() are you referring? remember that we're not the only guys 
reading this comments. so lets look at each case separately.

Mapper is a mapper, i.e it's not an DT, only reference (pointer) to some 
method. so it's on JAVA compiler to make it efficient. having said that, I 
think that readability of the code is much more important since the efficiency 
is negligible.

> 2. You're fine with creating new instance of RawMapper every dao call.
maybe you're confused a bit, the mapper is a field and created when class is 
created.

hope you'll agree with me.

btw, I'm missing protected access modifier.
Line 17: 
Line 18:     public BaseQosDaoFacadeImpl(QosType qosType) {
Line 19:         super("qos");
Line 20:         this.qosType = qosType;


http://gerrit.ovirt.org/#/c/27094/6/packaging/dbscripts/qos_sp.sql
File packaging/dbscripts/qos_sp.sql:

Line 65: BEGIN
Line 66: RETURN QUERY SELECT *
Line 67:    FROM qos
Line 68:    WHERE storage_pool_id = v_storage_pool_id
Line 69:    AND (v_qos_type IS NULL OR qos_type = v_qos_type);
> +1 on Moti's comment.
we started with scoring :)

Yair, you're more than welcome to write this DAO, I will review and merge it 
for you :-)
Line 70: END; $procedure$
Line 71: LANGUAGE plpgsql;


http://gerrit.ovirt.org/#/c/27094/6/packaging/dbscripts/upgrade/03_05_0330_qos_and_storage_impl.sql
File packaging/dbscripts/upgrade/03_05_0330_qos_and_storage_impl.sql:

Line 27: -- add index on storage_pool_id
Line 28: CREATE INDEX IDX_qos_storage_pool_id ON qos (storage_pool_id);
Line 29: 
Line 30: -- add index on qos_type
Line 31: CREATE INDEX IDX_qos_type ON qos (qos_type);
> I agree with Moti here. Since the context of qos type is per data center, t
I need to see if multiple indexes is a DB convention. if it's I have no problem 
changing that.

@ELI?


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I1a9af59277b5055453159f002f19046c0051d63b
Gerrit-PatchSet: 6
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Gilad Chaplik <gchap...@redhat.com>
Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com>
Gerrit-Reviewer: Doron Fediuck <dfedi...@redhat.com>
Gerrit-Reviewer: Eli Mesika <emes...@redhat.com>
Gerrit-Reviewer: Gilad Chaplik <gchap...@redhat.com>
Gerrit-Reviewer: Kobi Ianko <k...@redhat.com>
Gerrit-Reviewer: Lior Vernia <lver...@redhat.com>
Gerrit-Reviewer: Liron Ar <lara...@redhat.com>
Gerrit-Reviewer: Moti Asayag <masa...@redhat.com>
Gerrit-Reviewer: Yair Zaslavsky <yzasl...@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

Reply via email to