ofri masad has posted comments on this change.
Change subject: core: no quota refresh when vm stopped
......................................................................
Patch Set 6: (3 inline comments)
....................................................
File backend/manager/dbscripts/create_functions.sql
Line 512: DROP TYPE IF EXISTS vds_group_usage_rs CASCADE;
Line 513: CREATE TYPE vds_group_usage_rs AS
Line 514: ( virtual_cpu_usage INTEGER,mem_size_mb_usage BIGINT);
Line 515:
Line 516: -- returns a set of integers representing vm statuses on which the vm
should
should not be used for calculation
Line 517: -- be used for quota calculation
Line 518: CREATE OR REPLACE FUNCTION getNonCountableQutoaVmStatuses()
Line 519: RETURNS SETOF INTEGER
Line 520: AS $BODY$
Line 519: RETURNS SETOF INTEGER
Line 520: AS $BODY$
Line 521: BEGIN
Line 522: RETURN query select 0 union select 13 union select 14 union
select 15 union select 16;
Line 523: --(Down(0), Suspended(13), ImageIllegal(14), ImageLocked(15),
PoweringDown(16))
please check if 16 need to be here
Line 524: END; $BODY$
Line 525: LANGUAGE plpgsql;
Line 526:
Line 527:
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/quota/QuotaManager.java
Line 1016: if (nonCountableQutoaVmStatusesMap.size() == 0) {
Line 1017: synchronized (nonCountableQutoaVmStatusesMap) {
Line 1018: List<Integer> list =
DbFacade.getInstance().getQuotaDao().getNonCountableQutoaVmStatuses();
Line 1019: for (int i = 0; i < list.size(); i++) {
Line 1020: nonCountableQutoaVmStatusesMap.put(list.get(i),
null);
Why do we need a map? The list of NonCountableQutoaVmStatuses is of size 5!!!
even if it will get to size 10 it is still redundant.
you can just use List.contains(Object)....
Line 1021: }
Line 1022: }
Line 1023: }
Line 1024: return nonCountableQutoaVmStatusesMap.get(status.getValue())
== null;
--
To view, visit http://gerrit.ovirt.org/12014
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie2bd42a8431325ddbe552363b299fb80dbd7f3c5
Gerrit-PatchSet: 6
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Gilad Chaplik <[email protected]>
Gerrit-Reviewer: Doron Fediuck <[email protected]>
Gerrit-Reviewer: Eli Mesika <[email protected]>
Gerrit-Reviewer: Gilad Chaplik <[email protected]>
Gerrit-Reviewer: ofri masad <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches