Gilad Chaplik has posted comments on this change. Change subject: core: scheduling: increase NetworkPolicyUnit performance ......................................................................
Patch Set 1: (11 comments) .................................................... File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/policyunits/NetworkPolicyUnit.java Line 43: vmNICs = getVmNetworkInterfaceDao().getAllForVm(vm.getId()); Line 44: } else { Line 45: return null; Line 46: } Line 47: Map<Guid, List<VdsNetworkInterface>> allInterfacesForVdsMap = Done Line 48: getAllInterfacesForVdsGroupMap(hosts.get(0).getVdsGroupId()); Line 49: for (VDS host : hosts) { Line 50: VdcBllMessages returnValue = Line 51: validateRequiredNetworksAvailable(host, Line 79: * @param vdsGroupId Line 80: * @return Line 81: * map key = hostId, value = list of host's interfaces Line 82: */ Line 83: private Map<Guid, List<VdsNetworkInterface>> getAllInterfacesForVdsGroupMap(Guid vdsGroupId) { Done Line 84: Map<Guid, List<VdsNetworkInterface>> map = new HashMap<Guid, List<VdsNetworkInterface>>(); Line 85: List<VdsNetworkInterface> allInterfacesForVdsGroup = Line 86: getInterfaceDAO().getAllInterfacesForVdsGroup(vdsGroupId); Line 87: for (VdsNetworkInterface vdsNetworkInterface : allInterfacesForVdsGroup) { Line 80: * @return Line 81: * map key = hostId, value = list of host's interfaces Line 82: */ Line 83: private Map<Guid, List<VdsNetworkInterface>> getAllInterfacesForVdsGroupMap(Guid vdsGroupId) { Line 84: Map<Guid, List<VdsNetworkInterface>> map = new HashMap<Guid, List<VdsNetworkInterface>>(); Done Line 85: List<VdsNetworkInterface> allInterfacesForVdsGroup = Line 86: getInterfaceDAO().getAllInterfacesForVdsGroup(vdsGroupId); Line 87: for (VdsNetworkInterface vdsNetworkInterface : allInterfacesForVdsGroup) { Line 88: Guid vdsId = vdsNetworkInterface.getVdsId(); Line 81: * map key = hostId, value = list of host's interfaces Line 82: */ Line 83: private Map<Guid, List<VdsNetworkInterface>> getAllInterfacesForVdsGroupMap(Guid vdsGroupId) { Line 84: Map<Guid, List<VdsNetworkInterface>> map = new HashMap<Guid, List<VdsNetworkInterface>>(); Line 85: List<VdsNetworkInterface> allInterfacesForVdsGroup = Done Line 86: getInterfaceDAO().getAllInterfacesForVdsGroup(vdsGroupId); Line 87: for (VdsNetworkInterface vdsNetworkInterface : allInterfacesForVdsGroup) { Line 88: Guid vdsId = vdsNetworkInterface.getVdsId(); Line 89: if (map.get(vdsId) == null) { Line 83: private Map<Guid, List<VdsNetworkInterface>> getAllInterfacesForVdsGroupMap(Guid vdsGroupId) { Line 84: Map<Guid, List<VdsNetworkInterface>> map = new HashMap<Guid, List<VdsNetworkInterface>>(); Line 85: List<VdsNetworkInterface> allInterfacesForVdsGroup = Line 86: getInterfaceDAO().getAllInterfacesForVdsGroup(vdsGroupId); Line 87: for (VdsNetworkInterface vdsNetworkInterface : allInterfacesForVdsGroup) { Done Line 88: Guid vdsId = vdsNetworkInterface.getVdsId(); Line 89: if (map.get(vdsId) == null) { Line 90: map.put(vdsId, new ArrayList<VdsNetworkInterface>()); Line 91: } Line 85: List<VdsNetworkInterface> allInterfacesForVdsGroup = Line 86: getInterfaceDAO().getAllInterfacesForVdsGroup(vdsGroupId); Line 87: for (VdsNetworkInterface vdsNetworkInterface : allInterfacesForVdsGroup) { Line 88: Guid vdsId = vdsNetworkInterface.getVdsId(); Line 89: if (map.get(vdsId) == null) { Done Line 90: map.put(vdsId, new ArrayList<VdsNetworkInterface>()); Line 91: } Line 92: map.get(vdsId).add(vdsNetworkInterface); Line 93: } Line 113: VM vm, Line 114: List<VmNetworkInterface> vmNICs, Line 115: List<Network> clusterNetworks, Line 116: Map<String, Network> networksByName, Line 117: List<VdsNetworkInterface> allInterfacesForVds) { Done Line 118: Line 119: boolean onlyRequiredNetworks = Line 120: Config.<Boolean> getValue(ConfigValues.OnlyRequiredNetworksMandatoryForVdsSelection); Line 121: for (final VmNetworkInterface vmIf : vmNICs) { .................................................... File backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/network/InterfaceDao.java Line 74: * @param id Line 75: * the cluster id Line 76: * @return the list of interfaces Line 77: */ Line 78: List<VdsNetworkInterface> getAllInterfacesForVdsGroup(Guid vdsGroupId); Done Line 79: Line 80: /** Line 81: * Retrieves all interfaces for the given VDS id with optional filtering. Line 82: * .................................................... File backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/network/InterfaceDaoDbFacadeImpl.java Line 169: Line 170: @Override Line 171: public List<VdsNetworkInterface> getAllInterfacesForVdsGroup(Guid vdsGroupId) { Line 172: MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource() Line 173: .addValue("vds_group_id", vdsGroupId); Done Line 174: Line 175: return getCallsHandler().executeReadList("Getinterface_viewByVdsGroupId", Line 176: vdsNetworkInterfaceRowMapper, Line 177: parameterSource); Line 171: public List<VdsNetworkInterface> getAllInterfacesForVdsGroup(Guid vdsGroupId) { Line 172: MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource() Line 173: .addValue("vds_group_id", vdsGroupId); Line 174: Line 175: return getCallsHandler().executeReadList("Getinterface_viewByVdsGroupId", Done Line 176: vdsNetworkInterfaceRowMapper, Line 177: parameterSource); Line 178: } Line 179: .................................................... File packaging/dbscripts/network_sp.sql Line 356: WHERE user_id = v_user_id AND entity_id = v_vds_id)); Line 357: Line 358: END; $procedure$ Line 359: LANGUAGE plpgsql; Line 360: Done Line 361: Create or replace FUNCTION Getinterface_viewByVdsGroupId(v_vds_group_id UUID) Line 362: RETURNS SETOF vds_interface_view STABLE Line 363: AS $procedure$ Line 364: BEGIN -- To view, visit http://gerrit.ovirt.org/22463 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1b394b5d50abcbf58c63cb2d2af3867197ddb788 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Gilad Chaplik <gchap...@redhat.com> Gerrit-Reviewer: Gilad Chaplik <gchap...@redhat.com> Gerrit-Reviewer: Liran Zelkha <lzel...@redhat.com> Gerrit-Reviewer: Moti Asayag <masa...@redhat.com> 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