org.ovirt.engine.core.compat.Version.getValue()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(7.0k)|赞(0)|评价(0)|浏览(88)

本文整理了Java中org.ovirt.engine.core.compat.Version.getValue()方法的一些代码示例,展示了Version.getValue()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Version.getValue()方法的具体详情如下:
包路径:org.ovirt.engine.core.compat.Version
类名称:Version
方法名:getValue

Version.getValue介绍

暂无

代码示例

代码示例来源:origin: oVirt/ovirt-engine

@Override
public String toString() {
  return this.getValue();
}

代码示例来源:origin: oVirt/ovirt-engine

public void setCompatibilityVersion(Version value) {
  compatibilityVersion = value.getValue();
  compatVersion = value;
}

代码示例来源:origin: oVirt/ovirt-engine

public boolean isGetImageTicketSupported(Version clusterVersion) {
  return (Boolean) getConfigValuePreConverted(ConfigValues.GetImageTicketSupported, clusterVersion.getValue());
}

代码示例来源:origin: oVirt/ovirt-engine

/**
 * Returns device custom properties definition for specified version. It exists for testing purposes only.
 *
 * @param version
 *            specified version
 * @return device custom properties definition for specified version
 */
String getCustomDeviceProperties(Version version) {
  return Config.getValue(ConfigValues.CustomDeviceProperties, version.getValue());
}

代码示例来源:origin: oVirt/ovirt-engine

public Boolean isCopyPreallocatedFileBasedDiskSupported(Version dataCenterVersion) {
  return (Boolean) getConfigValuePreConverted(
      ConfigValues.CopyPreallocatedFileBasedDiskSupported, dataCenterVersion.getValue());
}

代码示例来源:origin: oVirt/ovirt-engine

public boolean isVgpuPlacementSupported(Version version) {
    return (Boolean) getConfigValuePreConverted(ConfigValues.VgpuPlacementSupported, version.getValue());
  }
}

代码示例来源:origin: oVirt/ovirt-engine

public String getUserDefinedVMProperties(Version version) {
  return Config.getValue(ConfigValues.UserDefinedVMProperties, version.getValue());
}

代码示例来源:origin: oVirt/ovirt-engine

public static boolean supportedInConfig(ConfigValues feature, Version version) {
  return Config.<Boolean> getValue(feature, version.getValue());
}

代码示例来源:origin: oVirt/ovirt-engine

public boolean isDestroyRebootSupported(Version compatibilityVersion) {
  return (Boolean) getConfigValuePreConverted(ConfigValues.DestroyOnRebootSupported,
      compatibilityVersion.getValue());
}

代码示例来源:origin: oVirt/ovirt-engine

public boolean isManagedBlockDomainSupported(Version dataCenterVersion) {
  return (Boolean) getConfigValuePreConverted(
      ConfigValues.ManagedBlockDomainSupported, dataCenterVersion.getValue());
}

代码示例来源:origin: oVirt/ovirt-engine

public String getPredefinedVMProperties(Version version) {
  return Config.getValue(ConfigValues.PredefinedVMProperties, version.getValue());
}

代码示例来源:origin: oVirt/ovirt-engine

/**
 * Return total maximum possible memory size for the given VM, including hotplugged memory.
 *
 * <p>Note: backend only</p>
 *
 * @param osId id of operating system
 * @param compatibilityVersion version of config value to query
 * @return the total possible memory size with hotplug
 */
public static int maxMemorySizeWithHotplugInMb(int osId, Version compatibilityVersion) {
  final ConfigValues configValue = getMaxMemConfigValueByOsId(osId);
  return Config.<Integer>getValue(
    configValue,
    compatibilityVersion != null ? compatibilityVersion.getValue() : Version.getLast().getValue()
  );
}

代码示例来源:origin: oVirt/ovirt-engine

public static boolean supportedInConfig(ConfigValues feature, Version version, ArchitectureType arch) {
  Map<String, String> archOptions = Config.<Map>getValue(feature, version.getValue());
  String value = archOptions.get(arch.name());
  if (value == null) {
    value = archOptions.get(arch.getFamily().name());
  }
  return Boolean.parseBoolean(value);
}

代码示例来源:origin: oVirt/ovirt-engine

/**
 * Computes the maximum allowed number of vCPUs that can be assigned
 * to a VM according to the specified compatibility level.
 *
 * @param vm The VM for which we want to know the maximum
 * @param compatibilityVersion The compatibility level
 * @param architecture Architecture family of the VM
 * @return The maximum supported number of vCPUs
 */
private static Integer calcMaxVCpu(VmBase vm, Version compatibilityVersion, ArchitectureType architecture) {
  Integer maxSockets = Config.<Integer>getValue(
      ConfigValues.MaxNumOfVmSockets,
      compatibilityVersion.getValue());
  Integer maxVCpus = Config.<Integer>getValue(
      ConfigValues.MaxNumOfVmCpus,
      compatibilityVersion.getValue());
  int threadsPerCore = vm.getThreadsPerCpu();
  int cpuPerSocket = vm.getCpuPerSocket();
  return calcMaxVCpu(architecture, maxSockets, maxVCpus, threadsPerCore, cpuPerSocket);
}

代码示例来源:origin: oVirt/ovirt-engine

public void getCustomBondNameSupported(AsyncQuery<Boolean> aQuery, Version version) {
  aQuery.converterCallback = new DefaultValueConverter<>(Boolean.TRUE);
  getConfigFromCache(
      new GetConfigurationValueParameters(ConfigValues.CustomBondNameSupported,
          version.getValue()),
      aQuery);
}

代码示例来源:origin: oVirt/ovirt-engine

/**
 * Update Model's changeability based on the support of given feature in given version.
 *
 * @param feature {@link ConfigValues} [SomeFeature]Supported value
 * @param version compatibility version to check the feature against
 */
public void updateChangeability(ConfigValues feature, Version version) {
  boolean featureSupported = (Boolean) AsyncDataProvider.getInstance().getConfigValuePreConverted(feature, version.getValue());
  setIsChangeable(featureSupported);
  setChangeProhibitionReason(ConstantsManager.getInstance().getMessages().optionNotSupportedClusterVersionTooOld(version.getValue()));
}

代码示例来源:origin: oVirt/ovirt-engine

private void updateMultiQueues() {
  Version compatibilityVersion = getCompatibilityVersion();
  if (compatibilityVersion == null) {
    return;
  }
  Boolean isMultiQueuesSupported =
      (Boolean) AsyncDataProvider.getInstance().getConfigValuePreConverted(ConfigValues.DomainXML,
          compatibilityVersion.getValue());
  getMultiQueues().setIsAvailable(isMultiQueuesSupported);
}

代码示例来源:origin: oVirt/ovirt-engine

public boolean isHotSetCpuSupported() {
  Cluster selectedCluster = getModel().getSelectedCluster();
  Version compatibilityVersion = getModel().getCompatibilityVersion();
  boolean hotplugCpuSupported = Boolean.parseBoolean(
        ((Map<String, String>) AsyncDataProvider.getInstance().getConfigValuePreConverted(
            ConfigValues.HotPlugCpuSupported,
            compatibilityVersion.getValue()))
        .get(selectedCluster.getArchitecture().name()));
  return getVm().getStatus() == VMStatus.Up && hotplugCpuSupported;
}

代码示例来源:origin: oVirt/ovirt-engine

public static Stream<MockConfigDescriptor<?>> mockConfiguration() {
  return Stream.of(
      MockConfigDescriptor.of(ConfigValues.VdcVersion, Version.getLast().getValue()),
      MockConfigDescriptor.of(ConfigValues.MaxNumOfVmCpus, Version.getLast(), 160),
      MockConfigDescriptor.of(ConfigValues.MaxNumOfVmSockets, Version.getLast(), 4)
  );
}

代码示例来源:origin: oVirt/ovirt-engine

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());
}

相关文章