Search in sources :

Example 1 with PolicyUnitType

use of org.ovirt.engine.core.common.scheduling.PolicyUnitType in project ovirt-engine by oVirt.

the class SchedulingManager method loadClusterPolicies.

private void loadClusterPolicies() {
    // Load internal cluster policies
    policyMap.putAll(InternalClusterPolicies.getClusterPolicies());
    Map<Guid, PolicyUnitType> internalTypes = new HashMap<>();
    for (PolicyUnitImpl unit : policyUnits.values()) {
        internalTypes.put(unit.getGuid(), unit.getType());
    }
    // Get all user provided cluster policies
    List<ClusterPolicy> allClusterPolicies = clusterPolicyDao.getAll(Collections.unmodifiableMap(internalTypes));
    for (ClusterPolicy clusterPolicy : allClusterPolicies) {
        policyMap.put(clusterPolicy.getId(), clusterPolicy);
    }
}
Also used : PolicyUnitType(org.ovirt.engine.core.common.scheduling.PolicyUnitType) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap) Guid(org.ovirt.engine.core.compat.Guid) ClusterPolicy(org.ovirt.engine.core.common.scheduling.ClusterPolicy)

Aggregations

HashMap (java.util.HashMap)1 LinkedHashMap (java.util.LinkedHashMap)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1 ClusterPolicy (org.ovirt.engine.core.common.scheduling.ClusterPolicy)1 PolicyUnitType (org.ovirt.engine.core.common.scheduling.PolicyUnitType)1 Guid (org.ovirt.engine.core.compat.Guid)1