Juan Hernandez has posted comments on this change.

Change subject: restapi: provide management network link upon cluster retrieval
......................................................................


Patch Set 1: Code-Review+1

(1 comment)

Looks good, but I have a minor performance related comment. Nothing serious, 
just take a look and comment before merging.

https://gerrit.ovirt.org/#/c/38627/1/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendClustersResource.java
File 
backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendClustersResource.java:

Line 159:                 
getOptionalEntity(org.ovirt.engine.core.common.businessentities.network.Network.class,
Line 160:                         VdcQueryType.GetManagementNetwork,
Line 161:                         new IdQueryParameters(clusterId),
Line 162:                         clusterId.toString(),
Line 163:                         false);
Running the query here means that when n clusters are requested we will run 1+n 
backend queries, one for the cluster itself and then n for the management 
networks. Ideally we should do this kind of things with 1 query (including the 
management network in the backend Cluster entitiy) or with 1+1 queries 
(creating a new backend query that returns the management networks for several 
clusters). However having many clusters isn't a typical use case, so I think 
this is acceptable.
Line 164:         if (network != null) {
Line 165:             final Network managementNetwork = new 
org.ovirt.engine.api.model.Network();
Line 166:             managementNetwork.setCluster(cluster);
Line 167:             managementNetwork.setId(network.getId().toString());


-- 
To view, visit https://gerrit.ovirt.org/38627
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Iad3403dc1ece3d2973054f29f4c7dd2049d39878
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Yevgeny Zaspitsky <[email protected]>
Gerrit-Reviewer: Juan Hernandez <[email protected]>
Gerrit-Reviewer: Yevgeny Zaspitsky <[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