Mike Kolesnik has posted comments on this change.
Change subject: core: Add QoS member to Network and VdsNetworkInterface
......................................................................
Patch Set 5:
(4 comments)
....................................................
Commit Message
Line 5: CommitDate: 2013-12-22 12:36:55 +0200
Line 6:
Line 7: core: Add QoS member to Network and VdsNetworkInterface
Line 8:
Line 9: Added a NetworkQoS member to both these entities. The QoS member of
Please add this info to javadoc on the fields.
Line 10: the Network entity refers to the QoS that should be configured on host
Line 11: interfaces to which the network is attached, while that of the
Line 12: VdsNetworkInterface entity refers to the QoS reported by VDSM on a
Line 13: host.
....................................................
File
backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/network/InterfaceDaoDbFacadeImpl.java
Line 57: .addValue("vds_id", entity.getVdsId())
Line 58: .addValue("vlan_id", entity.getVlanId())
Line 59: .addValue("mtu", entity.getMtu())
Line 60: .addValue("bridged", entity.isBridged())
Line 61: .addValue("qos_id", entity.getQos() == null ?
null : entity.getQos().getId());
This can be extracted to a function instead of copy/pasted..
Line 62: return paramValue;
Line 63: }
Line 64: });
Line 65: }
Line 254: entity.setId(getGuidDefaultEmpty(rs, "id"));
Line 255:
entity.setBootProtocol(NetworkBootProtocol.forValue(rs.getInt("boot_protocol")));
Line 256: entity.setMtu(rs.getInt("mtu"));
Line 257: entity.setBridged(rs.getBoolean("bridged"));
Line 258:
entity.setQos(DbFacade.getInstance().getQosDao().get(getGuid(rs, "qos_id")));
It's not a recommended practice to call another DAO from inside a DAO, instead
you should populate this field only when necessary and not always.
Line 259: return entity;
Line 260: }
Line 261:
Line 262: /**
....................................................
File
backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/network/NetworkDaoDbFacadeImpl.java
Line 165: entity.setProvidedBy(new ProviderNetwork(
Line 166: providerId,
Line 167:
rs.getString("provider_network_external_id")));
Line 168: }
Line 169:
entity.setQos(DbFacade.getInstance().getQosDao().get(getGuid(rs, "qos_id")));
Same here regarding the DAO calling a DAO
Line 170:
Line 171: return entity;
Line 172: }
Line 173:
--
To view, visit http://gerrit.ovirt.org/22599
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I63776837d41c620258fa53b9a1335b76a5971cea
Gerrit-PatchSet: 5
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Lior Vernia <[email protected]>
Gerrit-Reviewer: Lior Vernia <[email protected]>
Gerrit-Reviewer: Mike Kolesnik <[email protected]>
Gerrit-Reviewer: Moti Asayag <[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