Search in sources :

Example 1 with Weight

use of org.ovirt.engine.api.model.Weight in project ovirt-engine by oVirt.

the class BackendWeightsResource method list.

@Override
public Weights list() {
    ClusterPolicy clusterPolicy = getClusterPolicy();
    Weights weights = new Weights();
    if (clusterPolicy.getFunctions() != null) {
        for (Pair<Guid, Integer> weightPair : clusterPolicy.getFunctions()) {
            Weight weight = new Weight();
            weight.setId(weightPair.getFirst().toString());
            weight.setFactor(weightPair.getSecond());
            weights.getWeights().add(addLinks(map(clusterPolicy, weight)));
        }
    }
    return weights;
}
Also used : Weights(org.ovirt.engine.api.model.Weights) Guid(org.ovirt.engine.core.compat.Guid) ClusterPolicy(org.ovirt.engine.core.common.scheduling.ClusterPolicy) Weight(org.ovirt.engine.api.model.Weight)

Example 2 with Weight

use of org.ovirt.engine.api.model.Weight in project ovirt-engine by oVirt.

the class SchedulingWeightMapperTest method getModel.

@Override
protected Weight getModel(Weight Weight) {
    Weight = new Weight();
    Weight.setId(ID);
    Weight.setFactor(FACTOR);
    return Weight;
}
Also used : Weight(org.ovirt.engine.api.model.Weight)

Aggregations

Weight (org.ovirt.engine.api.model.Weight)2 Weights (org.ovirt.engine.api.model.Weights)1 ClusterPolicy (org.ovirt.engine.core.common.scheduling.ClusterPolicy)1 Guid (org.ovirt.engine.core.compat.Guid)1