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;
}
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;
}
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;
}
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;
}
Aggregations