use of com.sequenceiq.freeipa.flow.freeipa.downscale.event.DownscaleEvent in project cloudbreak by hortonworks.
the class FreeIpaDownscaleActions method startingDownscaleAction.
@Bean(name = "STARTING_DOWNSCALE_STATE")
public Action<?, ?> startingDownscaleAction() {
return new AbstractDownscaleAction<>(DownscaleEvent.class) {
@Override
protected void doExecute(StackContext context, DownscaleEvent payload, Map<Object, Object> variables) {
Stack stack = context.getStack();
List<String> instanceIds = payload.getInstanceIds();
setInstanceIds(variables, instanceIds);
String operationId = payload.getOperationId();
setOperationId(variables, operationId);
List<String> fqdns = getInstanceMetadataFromStack(stack, instanceIds).stream().map(InstanceMetaData::getDiscoveryFQDN).filter(Objects::nonNull).collect(Collectors.toList());
setDownscaleHosts(variables, fqdns);
setRepair(variables, payload.isRepair());
setChainedAction(variables, payload.isChained());
setFinalChain(variables, payload.isFinalChain());
setInstanceCountByGroup(variables, payload.getInstanceCountByGroup());
LOGGER.info("Starting downscale {}", payload);
stackUpdater.updateStackStatus(stack.getId(), getInProgressStatus(variables), "Starting downscale");
sendEvent(context, STARTING_DOWNSCALE_FINISHED_EVENT.selector(), new StackEvent(stack.getId()));
}
};
}
Aggregations