public void executeCooldown(String nsr_id, String vnfr_id, long cooldown) { log.info("[EXECUTOR] START_COOLDOWN " + new Date().getTime()); if (actionMonitor.isTerminating(vnfr_id)) { actionMonitor.finishedAction(vnfr_id, Action.TERMINATED); return; } log.info("Starting CooldownTask for VNFR with id: " + vnfr_id); if (actionMonitor.requestAction(vnfr_id, Action.COOLDOWN)) { log.debug("Creating new CooldownTask for VNFR with id: " + vnfr_id); CooldownTask cooldownTask = new CooldownTask(nsr_id, vnfr_id, cooldown, executionEngine, actionMonitor); taskScheduler.execute(cooldownTask); } else { if (actionMonitor.getAction(vnfr_id) == Action.COOLDOWN) { log.debug( "Waiting already for Cooldown for VNFR with id: " + vnfr_id + ". Cannot create another ExecutionTask for VNFR with id: " + vnfr_id); } else if (actionMonitor.getAction(vnfr_id) == Action.SCALE) { log.debug("VNFR with id: " + vnfr_id + " is still in Scaling."); } else { log.debug(actionMonitor.toString()); } } }
public void executeActions( String nsr_id, String vnfr_id, Set<ScalingAction> actions, long cooldown) { log.info("[EXECUTOR] RECEIVED_ACTION " + new Date().getTime()); log.info( "Processing execution request of ScalingActions: " + actions + " for VNFR with id: " + vnfr_id); if (actionMonitor.requestAction(vnfr_id, Action.SCALE)) { log.debug( "Creating new ExecutionTask of ScalingActions: " + actions + " for VNFR with id: " + vnfr_id); ExecutionTask executionTask = new ExecutionTask(nsr_id, vnfr_id, actions, cooldown, executionEngine, actionMonitor); taskScheduler.execute(executionTask); } else { if (actionMonitor.getAction(vnfr_id) == Action.SCALE) { log.debug( "Processing already an execution request for VNFR with id: " + vnfr_id + ". Cannot create another ExecutionTask for VNFR with id: " + vnfr_id); } else if (actionMonitor.getAction(vnfr_id) == Action.COOLDOWN) { log.debug( "Waiting for Cooldown for VNFR with id: " + vnfr_id + ". Cannot create another ExecutionTask for VNFR with id: " + vnfr_id); } else { log.warn( "Problem while starting ExecutionThread. Internal Status is: " + actionMonitor.getAction(vnfr_id)); } } }
@Override public void execute(Runnable task, long startTimeout) { execute(task); }