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

Examples of com.elastisys.scale.cloudadapers.api.types.Machine$MachineWithState


    if (privateIp != null) {
      privateIps.add(privateIp);
    }

    JsonObject metadata = JsonUtils.toJson(instance).getAsJsonObject();
    return new Machine(id, state, launchtime, publicIps, privateIps,
        metadata);
  }
View Full Code Here


      } else {
        publicIps.add(ip);
      }
    }
    JsonElement metadata = JsonUtils.toJson(server);
    return new Machine(server.getId(), state, launchTime, publicIps,
        privateIps, metadata);
  }
View Full Code Here

    checkArgument(terminationCandidates.size() >= numVictims,
        "more victims (%s) than eligble termination candidates (%s)",
        numVictims, terminationCandidates.size());
    for (int i = 0; i < numVictims; i++) {
      // use victim selection strategy to pick a victim
      Machine victim = this.victimSelectionStrategy
          .selectVictim(terminationCandidates);
      victims.add(victim);
      terminationCandidates.remove(victim);
    }
View Full Code Here

   *
   * @param livenessTestResult
   */
  private void updateStateAndAlertOnChange(
      LivenessTestResult livenessTestResult) {
    Machine machine = livenessTestResult.getMachine();
    LivenessState newState = livenessTestResult.getState();

    String id = machine.getId();
    LivenessState previousState = this.livenessObservations.get(id);
    this.livenessObservations.put(machine.getId(), newState);

    if ((previousState == null) || (previousState != newState)) {
      LivenessStateChange livenessChange = new LivenessStateChange(
          machine, previousState, newState);
      LOG.info("liveness state change: " + livenessChange);
View Full Code Here

      this.livenessCheckTask = livenessTestTask;
    }

    @Override
    public LivenessTestResult call() throws Exception {
      Machine machine = this.livenessCheckTask.getMachine();

      LivenessTestResult result = null;
      try {
        SshCommandResult commandResult = this.livenessCheckTask.call();
        LivenessState state = (commandResult.getExitStatus() == 0) ? LivenessState.LIVE
View Full Code Here

    if (privateIp != null) {
      privateIps.add(privateIp);
    }

    JsonObject metadata = JsonUtils.toJson(instance).getAsJsonObject();
    return new Machine(id, state, launchtime, publicIps, privateIps,
        metadata);
  }
View Full Code Here

      List<Machine> requestedInstances = Lists.newArrayList();
      int missingInstances = desiredCapacity - actualCapacity;
      if (missingInstances > 0) {
        for (int i = 1; i <= missingInstances; i++) {
          String pseudoId = String.format("i-requested%d", i);
          requestedInstances.add(new Machine(pseudoId,
              MachineState.REQUESTED, null, null, null, null));
        }
      }

      // retrieve all scaling group members
View Full Code Here

TOP

Related Classes of com.elastisys.scale.cloudadapers.api.types.Machine$MachineWithState

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.