private String getDefaultCpuTypeLabel() { Cluster cluster = getModel().getSelectedCluster(); String newClusterCpuModel = constants.clusterDefaultOption(); if (cluster != null) { String cpuName = (cluster.getCpuName() == null) ? "" : cluster.getCpuName(); //$NON-NLS-1$ newClusterCpuModel += "(" + cpuName + ")"; //$NON-NLS-1$ //$NON-NLS-2$ } return newClusterCpuModel; }
protected void updateCustomCpu() { Cluster cluster = getModel().getSelectedCluster(); if (cluster == null || cluster.getCpuName() == null || "".equals(cluster.getCpuName())) { return; } AsyncDataProvider.getInstance().getSupportedCpuList(new AsyncQuery<>( returnValue -> { if (returnValue != null) { List<String> cpuList = new ArrayList<>(); cpuList.add(""); //$NON-NLS-1$ for (ServerCpu cpu : returnValue) { cpuList.add(cpu.getVdsVerbData()); } String oldVal = getModel().getCustomCpu().getSelectedItem(); getModel().getCustomCpu().setItems(cpuList); getModel().getCustomCpu().setSelectedItem(oldVal); } }), cluster.getCpuName()); }
private void initCPU() { if (!isCPUinitialized && getIsEdit()) { isCPUinitialized = true; getCPU().setSelectedItem(null); for (ServerCpu a : getCPU().getItems()) { if (Objects.equals(a.getCpuName(), getEntity().getCpuName())) { getCPU().setSelectedItem(a); break; } } } }
if (cluster != null) { if (cluster.getCpuName() != null && !"".equals(cluster.getCpuName())) { AsyncDataProvider.getInstance().getSupportedCpuList(new AsyncQuery<>( returnValue -> { }), cluster.getCpuName());
/** * @return it may return `null` */ private CpuVendor getCurrentCpuVendor() { if (getCluster().getSelectedItem() == null) { return null; } final Cluster selectedCluster = getCluster().getSelectedItem(); final ServerCpu clustersCpu = AsyncDataProvider.getInstance() .getCpuByName(selectedCluster.getCpuName(), selectedCluster.getCompatibilityVersion()); if (clustersCpu == null) { // in case CPU of cluster was not yet set return null; } return clustersCpu.getVendor(); }
cpu.setCpuName(cluster.getCpuName()); cpu.setCpuName(cluster.getCpuName());
private void updateProperties() { Cluster cluster = getEntity(); setName(cluster.getName()); setDescription(cluster.getDescription()); setCpuType(cluster.getCpuName()); setDataCenterName(cluster.getStoragePoolName()); setMemoryOverCommit(cluster.getMaxVdsMemoryOverCommit()); setCpuThreads(cluster.getCountThreadsAsCores()); setResiliencePolicy(cluster.getMigrateOnError()); setEmulatedMachine(cluster.getEmulatedMachine()); setCompatibilityVersion(cluster.getCompatibilityVersion().getValue()); generateClusterType(cluster.supportsGlusterService(), cluster.supportsVirtService()); AsyncDataProvider.getInstance().getNumberOfVmsInCluster(new AsyncQuery<>( (QueryReturnValue returnValue) -> setNumberOfVms((Integer) returnValue.getReturnValue())), cluster.getId()); }
private static Cluster cloneCluster(Cluster instance) { Cluster obj = new Cluster(); obj.setId(instance.getId()); obj.setName(instance.getName()); obj.setDescription(instance.getDescription()); obj.setComment(instance.getComment()); obj.setCpuName(instance.getCpuName()); obj.setClusterCompatibilityLevelUpgradeNeeded(instance.isClusterCompatibilityLevelUpgradeNeeded()); obj.setCompatibilityVersion(instance.getCompatibilityVersion()); obj.setMigrateOnError(instance.getMigrateOnError()); obj.setTransparentHugepages(instance.getTransparentHugepages()); obj.setStoragePoolId(instance.getStoragePoolId()); obj.setMaxVdsMemoryOverCommit(instance.getMaxVdsMemoryOverCommit()); obj.setCountThreadsAsCores(instance.getCountThreadsAsCores()); obj.setEmulatedMachine(instance.getEmulatedMachine()); obj.setDetectEmulatedMachine(instance.isDetectEmulatedMachine()); obj.setArchitecture(instance.getArchitecture()); obj.setSerialNumberPolicy(instance.getSerialNumberPolicy()); obj.setCustomSerialNumber(instance.getCustomSerialNumber()); obj.setFencingPolicy(new FencingPolicy(instance.getFencingPolicy())); obj.setAutoConverge(instance.getAutoConverge()); obj.setMigrateCompressed(instance.getMigrateCompressed()); return obj; }
model.setLogMaxMemoryUsedThreshold(entity.getLogMaxMemoryUsedThreshold()); if (entity.getCpuName() != null) { Cpu cpu = new Cpu(); cpu.setType(entity.getCpuName());
.addValue("free_text_comment", cluster.getComment()) .addValue("cluster_id", cluster.getId()) .addValue("cpu_name", cluster.getCpuName()) .addValue("storage_pool_id", cluster.getStoragePoolId()) .addValue("max_vds_memory_over_commit",