Package org.jclouds.compute.domain

Examples of org.jclouds.compute.domain.Processor


    cluster = newCluster(1);
  }
 
  private Cluster newCluster(int numberOfWorkers) {
    NodeMetadata node = mock(NodeMetadata.class);
    List<Processor> processors = ImmutableList.of(new Processor(4, 1.0));
    Hardware hardware = new HardwareImpl(null, null, "id", null, null,
        ImmutableMap.<String,String>of(), ImmutableSet.<String>of(), processors,
        1024, ImmutableList.<Volume>of(), null);
    when(node.getHardware()).thenReturn(hardware);
   
View Full Code Here


      builder.providerId(String.valueOf(input.getId()));
      builder.name(input.getName());
      builder.ram(input.getMemory());
      // DigitalOcean does not provide the processor speed. We configure it to
      // make the bigger template the faster.
      builder.processor(new Processor(input.getCpu(), input.getCpu()));

      builder.volume(new VolumeBuilder()
            .size(Float.valueOf(input.getDisk()))
            .type(Type.LOCAL)
            .build());
View Full Code Here

            .operatingSystem(
                  OperatingSystem.builder().name("Ubuntu 14.04 x86_64").description("Ubuntu").family(OsFamily.UBUNTU)
                        .version("10.04").arch("x86_64").is64Bit(true).build()).build());

      hardwares = ImmutableSet.of(new HardwareBuilder().id("2gb").providerId("1").name("mock hardware")
            .processor(new Processor(1.0, 1.0)).ram(2048)
            .volume(new VolumeBuilder().size(20f).type(Type.LOCAL).build()).build());

      locations = ImmutableSet.of(new LocationBuilder()
            .id("1")
            .description("1/mock location")
View Full Code Here

   @Test
   public void testConvertSize() {
      Size size = new Size(1, "Medium", "2gb", 2048, 1, 20, "0.05", "10");
      Hardware expected = new HardwareBuilder().id("2gb").providerId("1").name("Medium")
            .processor(new Processor(1.0, 1.0)).ram(2048)
            .volume(new VolumeBuilder().size(20f).type(Type.LOCAL).build())
            .userMetadata(ImmutableMap.of("costPerHour", "0.05", "costPerMonth", "10")).build();

      SizeToHardware function = new SizeToHardware();
      assertEquals(function.apply(size), expected);
View Full Code Here

              .hostname(container.getContainerConfig().getHostname())
               // TODO Set up hardware
              .hardware(new HardwareBuilder()
                      .id("")
                      .ram(container.getContainerConfig().getMemory())
                      .processor(new Processor(container.getContainerConfig().getCpuShares(), container.getContainerConfig().getCpuShares()))
                      .build());
      builder.status(toPortableStatus.apply(container.getState()));
      builder.imageId(container.getImage());
      builder.loginPort(getLoginPort(container));
      builder.publicAddresses(getPublicIpAddresses());
View Full Code Here

   @Override
   public Iterable<Hardware> listHardwareProfiles() {
      Set<Hardware> hardware = Sets.newLinkedHashSet();
      // todo they are only placeholders at the moment
      hardware.add(new HardwareBuilder().ids("micro").hypervisor("lxc").name("micro").processor(new Processor(1, 1)).ram(512).build());
      hardware.add(new HardwareBuilder().ids("small").hypervisor("lxc").name("small").processor(new Processor(1, 1)).ram(1024).build());
      hardware.add(new HardwareBuilder().ids("medium").hypervisor("lxc").name("medium").processor(new Processor(1, 1)).ram(2048).build());
      hardware.add(new HardwareBuilder().ids("large").hypervisor("lxc").name("large").processor(new Processor(1, 1)).ram(3072).build());
      return hardware;
   }
View Full Code Here

    }

    public EC2HardwareBuilder t1_nano() {
        return new EC2HardwareBuilder("t1.nano")
                .ram(256)
                .processors(ImmutableList.of(new Processor(1, 1)))
                .volumes(ImmutableList.<Volume>of(new VolumeImpl(10.0f, true, true)));
    }
View Full Code Here

    }

    public EC2HardwareBuilder t1_micro() {
        return new EC2HardwareBuilder("t1.micro")
                .ram(512)
                .processors(ImmutableList.of(new Processor(1, 1)))
                .volumes(ImmutableList.<Volume>of(new VolumeImpl(20.0f, true, true)));
    }
View Full Code Here

    }

    public EC2HardwareBuilder t1_milli() {
        return new EC2HardwareBuilder("t1.milli")
                .ram(1024)
                .processors(ImmutableList.of(new Processor(1, 1)))
                .volumes(ImmutableList.<Volume>of(new VolumeImpl(40.0f, true, true)));
    }
View Full Code Here

    }

    public EC2HardwareBuilder m1_small() {
        return new EC2HardwareBuilder("m1.small")
                .ram(2048)
                .processors(ImmutableList.of(new Processor(2, 1)))
                .volumes(ImmutableList.<Volume>of(new VolumeImpl(80.0f, true, true)));
    }
View Full Code Here

TOP

Related Classes of org.jclouds.compute.domain.Processor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.