Search in sources :

Example 1 with NumaNode

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

the class BackendHostNumaNodesResource method list.

@Override
public NumaNodes list() {
    NumaNodes ret = new NumaNodes();
    List<VdsNumaNode> nodes = getCollection();
    for (VdsNumaNode node : nodes) {
        NumaNode numanode = populate(map(node, null), node);
        ret.getNumaNodes().add(addLinks(numanode));
    }
    return ret;
}
Also used : VdsNumaNode(org.ovirt.engine.core.common.businessentities.VdsNumaNode) NumaNodes(org.ovirt.engine.api.model.NumaNodes) NumaNode(org.ovirt.engine.api.model.NumaNode) VdsNumaNode(org.ovirt.engine.core.common.businessentities.VdsNumaNode)

Example 2 with NumaNode

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

the class V3NumaNodeInAdapter method adapt.

@Override
public NumaNode adapt(V3NumaNode from) {
    NumaNode to = new NumaNode();
    if (from.isSetLinks()) {
        to.getLinks().addAll(adaptIn(from.getLinks()));
    }
    if (from.isSetActions()) {
        to.setActions(adaptIn(from.getActions()));
    }
    if (from.isSetComment()) {
        to.setComment(from.getComment());
    }
    if (from.isSetCpu()) {
        to.setCpu(adaptIn(from.getCpu()));
    }
    if (from.isSetDescription()) {
        to.setDescription(from.getDescription());
    }
    if (from.isSetHost()) {
        to.setHost(adaptIn(from.getHost()));
    }
    if (from.isSetId()) {
        to.setId(from.getId());
    }
    if (from.isSetHref()) {
        to.setHref(from.getHref());
    }
    if (from.isSetIndex()) {
        to.setIndex(from.getIndex());
    }
    if (from.isSetMemory()) {
        to.setMemory(from.getMemory());
    }
    if (from.isSetName()) {
        to.setName(from.getName());
    }
    if (from.isSetNodeDistance()) {
        to.setNodeDistance(from.getNodeDistance());
    }
    if (from.isSetStatistics()) {
        to.setStatistics(new Statistics());
        to.getStatistics().getStatistics().addAll(adaptIn(from.getStatistics().getStatistics()));
    }
    return to;
}
Also used : NumaNode(org.ovirt.engine.api.model.NumaNode) V3NumaNode(org.ovirt.engine.api.v3.types.V3NumaNode) Statistics(org.ovirt.engine.api.model.Statistics)

Example 3 with NumaNode

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

the class NumaStatisticalQuery method clone.

private NumaNode clone(NumaNode parent) {
    NumaNode node = new NumaNode();
    node.setId(parent.getId());
    node.setHost(new Host());
    node.getHost().setId(parent.getHost().getId());
    return node;
}
Also used : Host(org.ovirt.engine.api.model.Host) NumaNode(org.ovirt.engine.api.model.NumaNode) VdsNumaNode(org.ovirt.engine.core.common.businessentities.VdsNumaNode)

Example 4 with NumaNode

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

the class NumaMapper method map.

@Mapping(from = VdsNumaNode.class, to = NumaNode.class)
public static NumaNode map(VdsNumaNode entity, NumaNode template) {
    NumaNode model = template != null ? template : new NumaNode();
    if (entity.getId() != null) {
        model.setId(entity.getId().toString());
    }
    model.setIndex(entity.getIndex());
    model.setMemory(entity.getMemTotal());
    if (entity.getCpuIds() != null && entity.getCpuIds().size() > 0) {
        Cpu cpu = new Cpu();
        Cores cores = new Cores();
        for (int id : entity.getCpuIds()) {
            Core core = new Core();
            core.setIndex(id);
            cores.getCores().add(core);
        }
        cpu.setCores(cores);
        model.setCpu(cpu);
    }
    if (entity.getNumaNodeDistances() != null && entity.getNumaNodeDistances().size() > 0) {
        model.setNodeDistance(StringUtils.join(entity.getNumaNodeDistances().values(), " "));
    }
    return model;
}
Also used : Cores(org.ovirt.engine.api.model.Cores) Cpu(org.ovirt.engine.api.model.Cpu) VmNumaNode(org.ovirt.engine.core.common.businessentities.VmNumaNode) NumaNode(org.ovirt.engine.api.model.NumaNode) VdsNumaNode(org.ovirt.engine.core.common.businessentities.VdsNumaNode) VirtualNumaNode(org.ovirt.engine.api.model.VirtualNumaNode) Core(org.ovirt.engine.api.model.Core)

Aggregations

NumaNode (org.ovirt.engine.api.model.NumaNode)4 VdsNumaNode (org.ovirt.engine.core.common.businessentities.VdsNumaNode)3 Core (org.ovirt.engine.api.model.Core)1 Cores (org.ovirt.engine.api.model.Cores)1 Cpu (org.ovirt.engine.api.model.Cpu)1 Host (org.ovirt.engine.api.model.Host)1 NumaNodes (org.ovirt.engine.api.model.NumaNodes)1 Statistics (org.ovirt.engine.api.model.Statistics)1 VirtualNumaNode (org.ovirt.engine.api.model.VirtualNumaNode)1 V3NumaNode (org.ovirt.engine.api.v3.types.V3NumaNode)1 VmNumaNode (org.ovirt.engine.core.common.businessentities.VmNumaNode)1