public Cluster() { migrateOnError = MigrateOnErrorOptions.YES; name = ""; virtService = true; optimizationType = OptimizationType.NONE; additionalRngSources = new HashSet<>(); fencingPolicy = new FencingPolicy(); addtionalFeaturesSupported = new HashSet<>(); ksmMergeAcrossNumaNodes = true; migrationBandwidthLimitType = MigrationBandwidthLimitType.DEFAULT; requiredSwitchTypeForCluster = SwitchType.LEGACY; logMaxMemoryUsedThresholdType = LogMaxMemoryUsedThresholdType.PERCENTAGE; description = ""; comment = ""; cpuName = ""; vncEncryptionEnabled = true; }
@Mapping(from = FencingPolicy.class, to = org.ovirt.engine.core.common.businessentities.FencingPolicy.class) public static org.ovirt.engine.core.common.businessentities.FencingPolicy map(FencingPolicy model, org.ovirt.engine.core.common.businessentities.FencingPolicy template) { org.ovirt.engine.core.common.businessentities.FencingPolicy entity = template != null ? template : new org.ovirt.engine.core.common.businessentities.FencingPolicy(); if(model.isSetEnabled()) { entity.setFencingEnabled(model.isEnabled()); } if (model.isSetSkipIfSdActive()) { entity.setSkipFencingIfSDActive(model.getSkipIfSdActive().isEnabled()); } if (model.isSetSkipIfConnectivityBroken()) { entity.setSkipFencingIfConnectivityBroken(model.getSkipIfConnectivityBroken().isEnabled()); if (model.getSkipIfConnectivityBroken().getThreshold() != null) { entity.setHostsWithBrokenConnectivityThreshold(model.getSkipIfConnectivityBroken().getThreshold()); } else { entity.setHostsWithBrokenConnectivityThreshold(50); } } if (model.isSetSkipIfGlusterBricksUp()) { entity.setSkipFencingIfGlusterBricksUp(model.isSkipIfGlusterBricksUp()); } if (model.isSetSkipIfGlusterQuorumNotMet()) { entity.setSkipFencingIfGlusterQuorumNotMet(model.isSkipIfGlusterQuorumNotMet()); } return entity; }
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; }