use of com.sequenceiq.flow.core.chain.config.FlowTriggerEventQueue in project cloudbreak by hortonworks.
the class ClusterRepairFlowEventChainFactoryTest method testRepairCoreNodes.
@Test
public void testRepairCoreNodes() {
Stack stack = getStack(NOT_MULTIPLE_GATEWAY);
when(stackService.findClustersConnectedToDatalakeByDatalakeStackId(STACK_ID)).thenReturn(Set.of(ATTACHED_WORKLOAD));
setupHostGroup(false);
setupStackView();
FlowTriggerEventQueue eventQueues = underTest.createFlowTriggerEventQueue(new TriggerEventBuilder(stack).withFailedCore().build());
List<String> triggeredOperations = eventQueues.getQueue().stream().map(Selectable::selector).collect(Collectors.toList());
assertEquals(List.of("FLOWCHAIN_INIT_TRIGGER_EVENT", "FULL_DOWNSCALE_TRIGGER_EVENT", "FULL_UPSCALE_TRIGGER_EVENT", "RESCHEDULE_STATUS_CHECK_TRIGGER_EVENT", "FLOWCHAIN_FINALIZE_TRIGGER_EVENT"), triggeredOperations);
}
use of com.sequenceiq.flow.core.chain.config.FlowTriggerEventQueue in project cloudbreak by hortonworks.
the class ClusterRepairFlowEventChainFactoryTest method testRepairSingleGatewayMultipleNodes.
@Test
public void testRepairSingleGatewayMultipleNodes() {
Stack stack = getStack(NOT_MULTIPLE_GATEWAY);
setupStackView();
when(stackService.findClustersConnectedToDatalakeByDatalakeStackId(STACK_ID)).thenReturn(Set.of());
HostGroup masterHostGroup = setupHostGroup("hostGroup-master", setupInstanceGroup(InstanceGroupType.GATEWAY));
when(hostGroupService.findHostGroupInClusterByName(anyLong(), eq("hostGroup-master"))).thenReturn(Optional.of(masterHostGroup));
HostGroup coreHostGroup = setupHostGroup("hostGroup-core", setupInstanceGroup(InstanceGroupType.CORE));
when(hostGroupService.findHostGroupInClusterByName(anyLong(), eq("hostGroup-core"))).thenReturn(Optional.of(coreHostGroup));
setupPrimaryGateway();
FlowTriggerEventQueue eventQueues = underTest.createFlowTriggerEventQueue(new TriggerEventBuilder(stack).withFailedPrimaryGateway().withFailedCore().build());
List<String> triggeredOperations = eventQueues.getQueue().stream().map(Selectable::selector).collect(Collectors.toList());
assertEquals(List.of("FLOWCHAIN_INIT_TRIGGER_EVENT", "STACK_DOWNSCALE_TRIGGER_EVENT", "FULL_UPSCALE_TRIGGER_EVENT", "RESCHEDULE_STATUS_CHECK_TRIGGER_EVENT", "FLOWCHAIN_FINALIZE_TRIGGER_EVENT"), triggeredOperations);
}
use of com.sequenceiq.flow.core.chain.config.FlowTriggerEventQueue in project cloudbreak by hortonworks.
the class ClusterRepairFlowEventChainFactoryTest method testRepairNotGatewayInstanceGroup.
@Test
public void testRepairNotGatewayInstanceGroup() {
Stack stack = getStack(NOT_MULTIPLE_GATEWAY);
when(stackService.findClustersConnectedToDatalakeByDatalakeStackId(STACK_ID)).thenReturn(Set.of());
setupHostGroup(false);
setupStackView();
FlowTriggerEventQueue eventQueues = underTest.createFlowTriggerEventQueue(new TriggerEventBuilder(stack).withFailedCore().build());
List<String> triggeredOperations = eventQueues.getQueue().stream().map(Selectable::selector).collect(Collectors.toList());
assertEquals(List.of("FLOWCHAIN_INIT_TRIGGER_EVENT", "FULL_DOWNSCALE_TRIGGER_EVENT", "FULL_UPSCALE_TRIGGER_EVENT", "RESCHEDULE_STATUS_CHECK_TRIGGER_EVENT", "FLOWCHAIN_FINALIZE_TRIGGER_EVENT"), triggeredOperations);
}
use of com.sequenceiq.flow.core.chain.config.FlowTriggerEventQueue in project cloudbreak by hortonworks.
the class ClusterRepairFlowEventChainFactoryTest method testRepairSingleGatewayWithNoAttached.
@Test
public void testRepairSingleGatewayWithNoAttached() {
Stack stack = getStack(NOT_MULTIPLE_GATEWAY);
setupStackView();
when(stackService.findClustersConnectedToDatalakeByDatalakeStackId(STACK_ID)).thenReturn(Set.of());
setupHostGroup(true);
FlowTriggerEventQueue eventQueues = underTest.createFlowTriggerEventQueue(new TriggerEventBuilder(stack).withFailedPrimaryGateway().build());
List<String> triggeredOperations = eventQueues.getQueue().stream().map(Selectable::selector).collect(Collectors.toList());
assertEquals(List.of("FLOWCHAIN_INIT_TRIGGER_EVENT", "STACK_DOWNSCALE_TRIGGER_EVENT", "FULL_UPSCALE_TRIGGER_EVENT", "RESCHEDULE_STATUS_CHECK_TRIGGER_EVENT", "FLOWCHAIN_FINALIZE_TRIGGER_EVENT"), triggeredOperations);
}
use of com.sequenceiq.flow.core.chain.config.FlowTriggerEventQueue in project cloudbreak by hortonworks.
the class UpgradeDistroxFlowEventChainFactoryTest method testChainQueueForNonReplaceVms.
@Test
public void testChainQueueForNonReplaceVms() {
ReflectionTestUtils.setField(underTest, "upgradeValidationEnabled", true);
DistroXUpgradeTriggerEvent event = new DistroXUpgradeTriggerEvent(FlowChainTriggers.DISTROX_CLUSTER_UPGRADE_CHAIN_TRIGGER_EVENT, STACK_ID, imageChangeDto, false, false, "variant");
FlowTriggerEventQueue flowChainQueue = underTest.createFlowTriggerEventQueue(event);
assertEquals(4, flowChainQueue.getQueue().size());
assertUpdateValidationEvent(flowChainQueue);
assertSaltUpdateEvent(flowChainQueue);
assertUpgradeEvent(flowChainQueue);
assertImageUpdateEvent(flowChainQueue);
}
Aggregations