org.jclouds.compute.domain.Hardware.getRam()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(7.4k)|赞(0)|评价(0)|浏览(122)

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

Hardware.getRam介绍

[英]Amount of RAM provided in MB (256M, 1740)
[中]以MB为单位提供的RAM数量(256M,1740)

代码示例

代码示例来源:origin: jclouds/legacy-jclouds

@Override
public boolean apply(Hardware input) {
  return input.getRam() >= TemplateBuilderImpl.this.minRam;
}

代码示例来源:origin: org.apache.jclouds/jclouds-compute

@Override
public boolean apply(Hardware input) {
  return input.getRam() >= TemplateBuilderImpl.this.minRam;
}

代码示例来源:origin: io.cloudsoft.jclouds/jclouds-compute

public int compare(Hardware left, Hardware right) {
   return ComparisonChain.start().compare(getCores(left), getCores(right)).compare(left.getRam(), right.getRam())
      .compare(getSpace(left), getSpace(right)).result();
 }
};

代码示例来源:origin: jclouds/legacy-jclouds

public int compare(Hardware left, Hardware right) {
   return ComparisonChain.start().compare(getCores(left), getCores(right)).compare(left.getRam(), right.getRam())
      .compare(getSpace(left), getSpace(right)).result();
 }
};

代码示例来源:origin: jclouds/legacy-jclouds

@Override
 public boolean apply(Hardware input) {
   return input.getRam() == Integer.parseInt(instance.getRam().getName().replaceAll("[^0-9]", ""));
 }
}

代码示例来源:origin: org.apache.jclouds/jclouds-compute

public int compare(Hardware left, Hardware right) {
   return ComparisonChain.start().compare(getCores(left), getCores(right)).compare(left.getRam(), right.getRam())
      .compare(getSpace(left), getSpace(right)).result();
 }
};

代码示例来源:origin: com.amysta.jclouds.provider/gogrid

@Override
 public boolean apply(Hardware input) {
   return input.getRam() == Integer.parseInt(instance.getRam().getName().replaceAll("[^0-9]", ""));
 }
}

代码示例来源:origin: org.jclouds.provider/gogrid

@Override
 public boolean apply(Hardware input) {
   return input.getRam() == Integer.parseInt(instance.getRam().getName().replaceAll("[^0-9]", ""));
 }
}

代码示例来源:origin: jclouds/legacy-jclouds

@Override
  public String apply(Hardware hardware) {
   if (hardware.getRam() >= 8 * 1024 || getCores(hardware) >= 6 || getSpace(hardware) >= 450)
     return "8GB";
   if (hardware.getRam() >= 4 * 1024 || getCores(hardware) >= 3 || getSpace(hardware) >= 230)
     return "4GB";
   if (hardware.getRam() >= 2 * 1024 || getSpace(hardware) >= 110)
     return "2GB";
   if (hardware.getRam() >= 1024 || getSpace(hardware) >= 55)
     return "1GB";
   return "512MB"; /* smallest */
  }
};

代码示例来源:origin: jclouds/legacy-jclouds

/**
* {@inheritDoc}
*/
@Override
public int compareTo(ResourceMetadata<ComputeType> that) {
 if (that instanceof Hardware) {
   Hardware thatHardware = Hardware.class.cast(that);
   return ComparisonChain.start().compare(getCores(this), getCores(thatHardware)).compare(this.getRam(), thatHardware.getRam())
      .compare(getSpace(this), getSpace(thatHardware)).result();
 } else {
   return super.compareTo(that);
 }
}

代码示例来源:origin: jclouds/legacy-jclouds

@Override
  public InstantiateVAppTemplateOptions apply(Template from) {
   InstantiateVAppTemplateOptions options = processorCount(Double.valueOf(getCores(from.getHardware())).intValue())
      .memory(from.getHardware().getRam());
   if (!from.getOptions().shouldBlockUntilRunning())
     options.block(false);
   String sshKeyFingerprint = TerremarkVCloudTemplateOptions.class.cast(from.getOptions()).getSshKeyFingerprint();
   if (sshKeyFingerprint != null)
     options.sshKeyFingerprint(sshKeyFingerprint);
   return options;
  }
}

代码示例来源:origin: org.jclouds.labs/joyent-sdc

@Override
  public boolean apply(Hardware input) {
   return input.getRam() == machineInDatacenter.get().getMemorySizeMb()
      && getSpace(input) == machineInDatacenter.get().getDiskSizeGb()
      && input.getLocation().getId().equals(machineInDatacenter.getDatacenter());
  }
}).orNull();

代码示例来源:origin: jclouds/legacy-jclouds

/**
* {@inheritDoc}
*/
@Override
public TemplateBuilder fromHardware(Hardware hardware) {
 if (currentLocationWiderThan(hardware.getLocation()))
   this.location = hardware.getLocation();
 this.minCores = getCores(hardware);
 this.minRam = hardware.getRam();
 this.minDisk = getSpace(hardware);
 this.hypervisor = hardware.getHypervisor();
 return this;
}

代码示例来源:origin: jclouds/legacy-jclouds

public void testListSizes() throws Exception {
 for (Hardware hardware : client.listHardwareProfiles()) {
   assert hardware.getProviderId() != null : hardware;
   assert getCores(hardware) > 0 : hardware;
   assert hardware.getVolumes().size() >= 0 : hardware;
   assert hardware.getRam() > 0 : hardware;
   assertEquals(hardware.getType(), ComputeType.HARDWARE);
 }
}

代码示例来源:origin: org.jclouds/jclouds-vcloud

@Override
public NodeMetadata addNodeWithTag(String tag, String name, Template template) {
 InstantiateVAppTemplateOptions options = processorCount((int) getCores(template.getHardware())).memory(
    template.getHardware().getRam()).disk(
    (long) ((template.getHardware().getVolumes().get(0).getSize()) * 1024 * 1024l));
 if (!template.getOptions().shouldBlockUntilRunning())
   options.block(false);
 VCloudExpressVApp vApp = computeClient.start(URI.create(template.getLocation().getId()),
    URI.create(template.getImage().getId()), name, options, template.getOptions().getInboundPorts());
 return vAppToNodeMetadata.apply(vApp);
}

代码示例来源:origin: jclouds/legacy-jclouds

@Test
public void testFastestTemplateBuilder() throws IOException {
 Template template = view.getComputeService().templateBuilder().fastest().build();
 assertEquals(getCores(template.getHardware()), 16.0d);
 assertEquals(template.getHardware().getRam(), 1);
 assertEquals(getSpace(template.getHardware()), 25.0d);
 assertEquals(template.getHardware().getVolumes().get(0).getType(), Volume.Type.LOCAL);
}

代码示例来源:origin: jclouds/legacy-jclouds

@Test
public void testBiggestTemplateBuilder() throws IOException {
 Template template = view.getComputeService().templateBuilder().biggest().build();
 assertEquals(getCores(template.getHardware()), 16.0d);
 assertEquals(template.getHardware().getRam(), 16);
 assertEquals(getSpace(template.getHardware()), 100.0d);
 assertEquals(template.getHardware().getVolumes().get(0).getType(), Volume.Type.LOCAL);
}

代码示例来源:origin: jclouds/legacy-jclouds

@SuppressWarnings("unchecked")
  public static HardwareBuilder fromHardware(Hardware in) {
   return new HardwareBuilder().id(in.getId()).providerId(in.getProviderId()).location(in.getLocation()).name(
        in.getName()).uri(in.getUri()).userMetadata(in.getUserMetadata()).tags(in.getTags()).processors(
        List.class.cast(in.getProcessors())).ram(in.getRam()).volumes(List.class.cast(in.getVolumes()))
        .supportsImage(in.supportsImage()).hypervisor(in.getHypervisor());
  }
}

代码示例来源:origin: org.apache.jclouds/jclouds-compute

@SuppressWarnings("unchecked")
  public static HardwareBuilder fromHardware(Hardware in) {
   return new HardwareBuilder().id(in.getId()).providerId(in.getProviderId()).location(in.getLocation()).name(
        in.getName()).uri(in.getUri()).userMetadata(in.getUserMetadata()).tags(in.getTags()).processors(
        List.class.cast(in.getProcessors())).ram(in.getRam()).volumes(List.class.cast(in.getVolumes()))
        .supportsImage(in.supportsImage()).hypervisor(in.getHypervisor());
  }
}

代码示例来源:origin: io.cloudsoft.jclouds/jclouds-compute

@SuppressWarnings("unchecked")
  public static HardwareBuilder fromHardware(Hardware in) {
   return new HardwareBuilder().id(in.getId()).providerId(in.getProviderId()).location(in.getLocation()).name(
        in.getName()).uri(in.getUri()).userMetadata(in.getUserMetadata()).tags(in.getTags()).processors(
        List.class.cast(in.getProcessors())).ram(in.getRam()).volumes(List.class.cast(in.getVolumes()))
        .supportsImage(in.supportsImage()).hypervisor(in.getHypervisor());
  }
}

相关文章