Package com.elastisys.scale.cloudadapers.api.types

Examples of com.elastisys.scale.cloudadapers.api.types.MachinePool


  @Consumes(MediaType.APPLICATION_JSON)
  @Produces(MediaType.APPLICATION_JSON)
  public Response getPool() {
    log.info("GET /pool");
    try {
      MachinePool machinePool = this.cloudAdapter.getMachinePool();
      return Response.ok(machinePool.toJson()).build();
    } catch (Exception e) {
      String message = "failure to process pool get request: "
          + e.getMessage();
      log.error(message, e);
      return Response.status(Status.INTERNAL_SERVER_ERROR)
View Full Code Here


  public MachinePool getMachinePool() throws CloudAdapterException {
    checkState(getConfiguration().isPresent(),
        "cloud adapter needs to be configured before use");
    try {
      List<Machine> members = this.scalingGroup.listMachines();
      return new MachinePool(members, UtcTime.now());
    } catch (Exception e) {
      String message = format("failed to retrieve scaling group: %s\n%s",
          e.getMessage(), Throwables.getStackTraceAsString(e));
      this.eventBus.post(new Alert(AlertTopics.POOL_FETCH.name(),
          AlertSeverity.ERROR, UtcTime.now(), message));
View Full Code Here

      return;
    }

    LOG.info("updating pool size to desired size {}", desiredSize());

    MachinePool machinePool = getMachinePool();
    int poolSize = machinePool.getAllocatedMachines().size();

    // clean out obsolete machines from termination queue
    this.terminationQueue.filter(machinePool.getAllocatedMachines());
    ResizePlanner resizePlanner = new ResizePlanner(machinePool,
        this.terminationQueue, scaleDownConfig()
            .getVictimSelectionPolicy(), scaleDownConfig()
            .getInstanceHourMargin());
    int netSize = resizePlanner.getEffectiveSize();
View Full Code Here

TOP

Related Classes of com.elastisys.scale.cloudadapers.api.types.MachinePool

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.