Mike Kolesnik has posted comments on this change.
Change subject: engine: Introduce GetNetworkLabelsByDataCenterIdQuery
......................................................................
Patch Set 5:
(4 comments)
....................................................
File
backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/network/InterfaceDao.java
Line 164: * @param id
Line 165: * the data-center id
Line 166: * @return all labels defined for the data-center's networks
Line 167: */
Line 168: Set<String> getAllNetworkLabelsForDataCenter(Guid id);
Is this method used somewhere outside the DAL? If not, I wouldn't expose it.
Line 169:
Line 170: /**
Line 171: * Retrieves all interfaces within a specific data-center
Line 172: *
....................................................
File
backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/network/InterfaceDaoDbFacadeImpl.java
Line 210:
Line 211: @Override
Line 212: public Set<String> getAllNetworkLabelsForDataCenter(Guid
dataCenterId) {
Line 213: Set<String> labels = new HashSet<>();
Line 214: for (VdsNetworkInterface nic :
getAllInterfacesByDataCenterId(dataCenterId)) {
Not sure why do you do this logic applicatively, and not offload it to the
database?
Line 215: if (nic.getLabels() != null) {
Line 216: labels.addAll(nic.getLabels());
Line 217: }
Line 218: }
....................................................
File
backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/network/InterfaceDaoTest.java
Line 337: }
Line 338: }
Line 339:
Line 340: @Test
Line 341: public void getAllNetworkLabelsForDataCenter() {
Did you mean to name it testGetAllInterfacesByDataCenterId ?
Line 342: List<VdsNetworkInterface> interfaces =
dao.getAllInterfacesByDataCenterId(FixturesTool.DATA_CENTER);
Line 343: assertNotNull(interfaces);
Line 344: assertFalse(interfaces.isEmpty());
Line 345: }
Line 343: assertNotNull(interfaces);
Line 344: assertFalse(interfaces.isEmpty());
Line 345: }
Line 346:
Line 347: public void testGetAllNetworkLabelsForDataCenter() {
This is not marked as @Test
Line 348: Set<String> result =
dao.getAllNetworkLabelsForDataCenter(FixturesTool.DATA_CENTER);
Line 349: assertNotNull(result);
Line 350: assertFalse(result.isEmpty());
Line 351: }
--
To view, visit http://gerrit.ovirt.org/22869
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I66a3f6b38c97d401ee4d7c59517b1e10ad8efb08
Gerrit-PatchSet: 5
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Moti Asayag <[email protected]>
Gerrit-Reviewer: Mike Kolesnik <[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