use of com.sequenceiq.cloudbreak.core.flow2.event.StackImageUpdateTriggerEvent in project cloudbreak by hortonworks.
the class UpgradeDistroxFlowEventChainFactoryTest method assertImageUpdateEvent.
private void assertImageUpdateEvent(FlowTriggerEventQueue flowChainQueue) {
Selectable imageUpdateEvent = flowChainQueue.getQueue().remove();
assertEquals(STACK_IMAGE_UPDATE_TRIGGER_EVENT, imageUpdateEvent.selector());
assertEquals(STACK_ID, imageUpdateEvent.getResourceId());
assertTrue(imageUpdateEvent instanceof StackImageUpdateTriggerEvent);
StackImageUpdateTriggerEvent event = (StackImageUpdateTriggerEvent) imageUpdateEvent;
assertEquals(imageChangeDto.getImageId(), event.getNewImageId());
assertEquals(imageChangeDto.getImageCatalogName(), event.getImageCatalogName());
assertEquals(imageChangeDto.getImageCatalogUrl(), event.getImageCatalogUrl());
}
use of com.sequenceiq.cloudbreak.core.flow2.event.StackImageUpdateTriggerEvent in project cloudbreak by hortonworks.
the class UpgradeDistroxFlowEventChainFactory method createFlowTriggerEventQueue.
@Override
public FlowTriggerEventQueue createFlowTriggerEventQueue(DistroXUpgradeTriggerEvent event) {
LOGGER.debug("Creating flow trigger event queue for distrox upgrade with event {}", event);
Queue<Selectable> flowEventChain = new ConcurrentLinkedQueue<>();
createUpgradeValidationEvent(event).ifPresent(flowEventChain::add);
flowEventChain.add(new StackEvent(SaltUpdateEvent.SALT_UPDATE_EVENT.event(), event.getResourceId(), event.accepted()));
flowEventChain.add(new ClusterUpgradeTriggerEvent(CLUSTER_UPGRADE_INIT_EVENT.event(), event.getResourceId(), event.accepted(), event.getImageChangeDto().getImageId()));
flowEventChain.add(new StackImageUpdateTriggerEvent(FlowChainTriggers.STACK_IMAGE_UPDATE_TRIGGER_EVENT, event.getImageChangeDto()));
if (event.isReplaceVms()) {
Map<String, List<String>> nodeMap = getReplaceableInstancesByHostgroup(event);
flowEventChain.add(new ClusterRepairTriggerEvent(FlowChainTriggers.CLUSTER_REPAIR_TRIGGER_EVENT, event.getResourceId(), nodeMap, true, event.getTriggeredStackVariant()));
}
return new FlowTriggerEventQueue(getName(), event, flowEventChain);
}
Aggregations