Search in sources :

Example 1 with MemoryOverCommit

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

the class V3MemoryOverCommitInAdapter method adapt.

@Override
public MemoryOverCommit adapt(V3MemoryOverCommit from) {
    MemoryOverCommit to = new MemoryOverCommit();
    to.setPercent(from.getPercent());
    return to;
}
Also used : V3MemoryOverCommit(org.ovirt.engine.api.v3.types.V3MemoryOverCommit) MemoryOverCommit(org.ovirt.engine.api.model.MemoryOverCommit)

Example 2 with MemoryOverCommit

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

the class ClusterMapper method map.

@Mapping(from = Cluster.class, to = MemoryPolicy.class)
public static MemoryPolicy map(Cluster entity, MemoryPolicy template) {
    MemoryPolicy model = template != null ? template : new MemoryPolicy();
    model.setOverCommit(new MemoryOverCommit());
    model.getOverCommit().setPercent(entity.getMaxVdsMemoryOverCommit());
    model.setTransparentHugepages(new TransparentHugePages());
    model.getTransparentHugepages().setEnabled(entity.getTransparentHugepages());
    return model;
}
Also used : MemoryOverCommit(org.ovirt.engine.api.model.MemoryOverCommit) MemoryPolicy(org.ovirt.engine.api.model.MemoryPolicy) TransparentHugePages(org.ovirt.engine.api.model.TransparentHugePages)

Aggregations

MemoryOverCommit (org.ovirt.engine.api.model.MemoryOverCommit)2 MemoryPolicy (org.ovirt.engine.api.model.MemoryPolicy)1 TransparentHugePages (org.ovirt.engine.api.model.TransparentHugePages)1 V3MemoryOverCommit (org.ovirt.engine.api.v3.types.V3MemoryOverCommit)1