Examples of IJobUpdateInstructions


Examples of org.apache.aurora.scheduler.storage.entities.IJobUpdateInstructions

        public boolean apply(IScheduledTask input) {
          Optional<IJobUpdate> update = Optional.fromNullable(
              roleJobUpdates.get(input.getAssignedTask().getTask().getJob()));

          if (update.isPresent()) {
            IJobUpdateInstructions instructions = update.get().getInstructions();
            RangeSet<Integer> initialInstances = instanceRangeSet(instructions.getInitialState());
            RangeSet<Integer> desiredInstances = instanceRangeSet(instructions.isSetDesiredState()
                ? ImmutableSet.of(instructions.getDesiredState())
                : ImmutableSet.<IInstanceTaskConfig>of());

            int instanceId = input.getAssignedTask().getInstanceId();
            return !initialInstances.contains(instanceId) && !desiredInstances.contains(instanceId);
          }
View Full Code Here

Examples of org.apache.aurora.scheduler.storage.entities.IJobUpdateInstructions

      @Override
      protected void execute(MutableStoreProvider storeProvider)
          throws UpdateStateException {

        IJobUpdateSummary summary = update.getSummary();
        IJobUpdateInstructions instructions = update.getInstructions();
        IJobKey job = summary.getJobKey();

        // Validate the update configuration by making sure we can create an updater for it.
        updateFactory.newUpdate(update.getInstructions(), true);

        if (instructions.getInitialState().isEmpty() && !instructions.isSetDesiredState()) {
          throw new IllegalArgumentException("Update instruction is a no-op.");
        }

        LOG.info("Starting update for job " + job);
        ILock lock;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.