Eli Mesika has posted comments on this change.

Change subject: core: Add QoS to to DB and entities
......................................................................


Patch Set 10: (9 inline comments)

....................................................
File 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/AuditLogType.java
Line 749:     //watchdog
Line 750:     WATCHDOG_EVENT(9901),
Line 751: 
Line 752:     //network Qos
Line 753:     USER_ADDED_NETWORK_QOS(9920),
I prefer that you set a more specific range like 10100 and on for example
Line 754:     USER_FAILED_TO_ADD_NETWORK_QOS(9921),
Line 755:     USER_REMOVED_NETWORK_QOS(9922),
Line 756:     USER_FAILED_TO_REMOVE_NETWORK_QOS(9923),
Line 757:     USER_UPDATED_NETWORK_QOS(9924),


....................................................
File 
backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/network/NetworkQoSDaoImpl.java
Line 49:         return string == null ? null : Integer.parseInt(string);
Line 50:     }
Line 51: 
Line 52:     @Override
Line 53:     public NetworkQoS get(Guid id) {
You can get it by free from parent objects if you follow naming conventions in 
DefaultGenericDaoDbFacade and DefaultReadDaoDbFacade
Line 54:         MapSqlParameterSource parameterSource = 
getCustomMapSqlParameterSource().addValue("id", id.getUuid());
Line 55:         return getCallsHandler().executeRead("Get_network_qos_by_id", 
mapper, parameterSource);
Line 56:     }
Line 57: 


Line 55:         return getCallsHandler().executeRead("Get_network_qos_by_id", 
mapper, parameterSource);
Line 56:     }
Line 57: 
Line 58:     @Override
Line 59:     public void save(NetworkQoS networkQoS) {
You can get it by free from parent objects if you follow naming conventions in 
DefaultGenericDaoDbFacade and DefaultReadDaoDbFacade
Line 60:         MapSqlParameterSource parameterSource = 
getCustomMapSqlParameterSource()
Line 61:                 .addValue("id", networkQoS.getId())
Line 62:                 .addValue("name", networkQoS.getName())
Line 63:                 .addValue("storage_pool_id", 
networkQoS.getStoragePoolId())


Line 71:         getCallsHandler().executeModification("Insert_network_qos", 
parameterSource);
Line 72:     }
Line 73: 
Line 74:     @Override
Line 75:     public void update(NetworkQoS networkQoS) {
You can get it by free from parent objects if you follow naming conventions in 
DefaultGenericDaoDbFacade and DefaultReadDaoDbFacade
Line 76:         getCallsHandler().executeModification("Update_network_qos", 
createFullParametersMapper(networkQoS));
Line 77:     }
Line 78: 
Line 79:     @Override


Line 76:         getCallsHandler().executeModification("Update_network_qos", 
createFullParametersMapper(networkQoS));
Line 77:     }
Line 78: 
Line 79:     @Override
Line 80:     public void remove(Guid id) {
You can get it by free from parent objects if you follow naming conventions in 
DefaultGenericDaoDbFacade and DefaultReadDaoDbFacade
Line 81:         getCallsHandler().executeModification("Delete_network_qos", 
createIdParameterMapper(id));
Line 82:     }
Line 83: 
Line 84:     @Override


Line 81:         getCallsHandler().executeModification("Delete_network_qos", 
createIdParameterMapper(id));
Line 82:     }
Line 83: 
Line 84:     @Override
Line 85:     public List<NetworkQoS> getAll() {
You can get it by free from parent objects if you follow naming conventions in 
DefaultGenericDaoDbFacade and DefaultReadDaoDbFacade
Line 86:         return 
getCallsHandler().executeReadList("Get_all_network_qos", mapper, 
getCustomMapSqlParameterSource());
Line 87:     }
Line 88: 
Line 89:     @Override


....................................................
File packaging/dbscripts/network_qos_sp.sql
Line 14: RETURNS VOID
Line 15:    AS $procedure$
Line 16: BEGIN
Line 17: INSERT INTO network_qos(id, name, storage_pool_id, inbound_average, 
inbound_peak, inbound_burst, outbound_average, outbound_peak, outbound_burst)
Line 18:        VALUES(v_id, v_name, v_storage_pool_id, v_inbound_average, 
v_inbound_peak, v_inbound_burst, v_outbound_average, v_outbound_peak, 
v_outbound_burst);
Please remove TAB
Line 19: END; $procedure$
Line 20: LANGUAGE plpgsql;
Line 21: 
Line 22: 


Line 19: END; $procedure$
Line 20: LANGUAGE plpgsql;
Line 21: 
Line 22: 
Line 23: Create or replace FUNCTION update_network_qos(v_id uuid,
See my comments on DAO how to use naming conventions and benefit from the DAOs 
you are inheriting
Line 24:   v_name VARCHAR(50),
Line 25:   v_storage_pool_id uuid,
Line 26:   v_inbound_average INTEGER,
Line 27:   v_inbound_peak INTEGER,


....................................................
File packaging/dbscripts/upgrade/03_03_0460_add_network_qos_tabel.sql
Line 18:   CONSTRAINT PK_network_qos_id PRIMARY KEY (id)
Line 19: ) WITH OIDS;
Line 20: 
Line 21: ALTER TABLE network_qos ADD CONSTRAINT network_qos_storage_pool_fk
Line 22: FOREIGN KEY(storage_pool_id) REFERENCES storage_pool(id) ON DELETE 
CASCADE;
Please add an index on storage_pool_id  since some of your sps using it in the 
where clause


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

Gerrit-MessageType: comment
Gerrit-Change-Id: If39d20b77d06165e4adcc27e6b6dc5458cac93d3
Gerrit-PatchSet: 10
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: ofri masad <oma...@redhat.com>
Gerrit-Reviewer: Doron Fediuck <dfedi...@redhat.com>
Gerrit-Reviewer: Eli Mesika <elimes...@gmail.com>
Gerrit-Reviewer: Eli Mesika <emes...@redhat.com>
Gerrit-Reviewer: Gilad Chaplik <gchap...@redhat.com>
Gerrit-Reviewer: Moti Asayag <masa...@redhat.com>
Gerrit-Reviewer: Oved Ourfali <oourf...@redhat.com>
Gerrit-Reviewer: Yair Zaslavsky <yzasl...@redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-Reviewer: ofri masad <oma...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to