Package org.apache.aurora.gen

Examples of org.apache.aurora.gen.JobUpdateAction


      } else {
        statusChanges = entry.getValue().getStatusChanges();
      }

      for (InstanceUpdateStatus statusChange : statusChanges) {
        JobUpdateAction action = STATE_MAP.get(Pair.of(statusChange, updaterStatus));
        requireNonNull(action);

        IJobInstanceUpdateEvent event = IJobInstanceUpdateEvent.build(
            new JobInstanceUpdateEvent()
                .setInstanceId(entry.getKey())
                .setTimestampMs(clock.nowMillis())
                .setAction(action));
        updateStore.saveJobInstanceUpdateEvent(event, summary.getUpdateId());
      }
    }

    OneWayStatus status = result.getStatus();
    if (status == SUCCEEDED || status == OneWayStatus.FAILED) {
      if (SideEffect.hasActions(result.getSideEffects().values())) {
        throw new IllegalArgumentException(
            "A terminal state should not specify actions: " + result);
      }

      if (status == SUCCEEDED) {
        changeUpdateStatus(storeProvider,
            summary,
            update.getSuccessStatus(),
            Optional.<String>absent());
      } else {
        changeUpdateStatus(
            storeProvider,
            summary,
            update.getFailureStatus(),
            Optional.<String>absent());
      }
    } else {
      LOG.info("Executing side-effects for update of " + job + ": " + result.getSideEffects());
      for (Map.Entry<Integer, SideEffect> entry : result.getSideEffects().entrySet()) {
        IInstanceKey instance = InstanceKeys.from(job, entry.getKey());

        Optional<InstanceAction> action = entry.getValue().getAction();
        if (action.isPresent()) {
          Optional<InstanceActionHandler> handler = action.get().getHandler();
          if (handler.isPresent()) {
            Amount<Long, Time> reevaluateDelay = handler.get().getReevaluationDelay(
                instance,
                updateStore.fetchJobUpdateInstructions(summary.getUpdateId()).get(),
                storeProvider,
View Full Code Here

TOP

Related Classes of org.apache.aurora.gen.JobUpdateAction

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.