use of com.sequenceiq.cloudbreak.service.stack.repair.UnhealthyInstances in project cloudbreak by hortonworks.
the class ReactorFlowManagerTest method shouldReturnTheNextFailureTransition.
@Test
public void shouldReturnTheNextFailureTransition() {
InstanceGroupAdjustmentJson instanceGroupAdjustment = new InstanceGroupAdjustmentJson();
HostGroupAdjustmentJson hostGroupAdjustment = new HostGroupAdjustmentJson();
underTest.triggerProvisioning(stackId);
underTest.triggerClusterInstall(stackId);
underTest.triggerClusterReInstall(stackId);
underTest.triggerStackStop(stackId);
underTest.triggerStackStart(stackId);
underTest.triggerClusterStop(stackId);
underTest.triggerClusterStart(stackId);
underTest.triggerTermination(stackId, false, false);
underTest.triggerTermination(stackId, false, true);
underTest.triggerStackUpscale(stackId, instanceGroupAdjustment, true);
underTest.triggerStackDownscale(stackId, instanceGroupAdjustment);
underTest.triggerStackRemoveInstance(stackId, "hostgroup", "hostname");
underTest.triggerClusterUpscale(stackId, hostGroupAdjustment);
underTest.triggerClusterDownscale(stackId, hostGroupAdjustment);
underTest.triggerClusterSync(stackId);
underTest.triggerStackSync(stackId);
underTest.triggerFullSync(stackId);
underTest.triggerClusterCredentialReplace(stackId, "admin", "admin1");
underTest.triggerClusterCredentialUpdate(stackId, "admin1");
underTest.triggerClusterTermination(stackId, false, false);
underTest.triggerClusterTermination(stackId, true, false);
underTest.triggerClusterUpgrade(stackId);
underTest.triggerManualRepairFlow(stackId);
underTest.triggerStackRepairFlow(stackId, new UnhealthyInstances());
underTest.triggerClusterRepairFlow(stackId, new HashMap<>(), true);
underTest.triggerEphemeralUpdate(stackId);
// Not start from 0 because flow cancellations
int count = 5;
for (Method method : underTest.getClass().getDeclaredMethods()) {
if (method.getName().startsWith("trigger")) {
count++;
}
}
verify(reactor, times(count)).notify((Object) anyObject(), any(Event.class));
}
use of com.sequenceiq.cloudbreak.service.stack.repair.UnhealthyInstances in project cloudbreak by hortonworks.
the class StackRepairFlowEventChainFactory method createFlowTriggerEventQueue.
@Override
public Queue<Selectable> createFlowTriggerEventQueue(StackRepairTriggerEvent event) {
Queue<Selectable> flowChainTriggers = new ConcurrentLinkedDeque<>();
flowChainTriggers.add(new StackEvent(FlowChainTriggers.FULL_SYNC_TRIGGER_EVENT, event.getStackId(), event.accepted()));
UnhealthyInstances unhealthyInstances = event.getUnhealthyInstances();
String fullUpscaleTriggerEvent = FlowChainTriggers.FULL_UPSCALE_TRIGGER_EVENT;
for (String hostGroupName : unhealthyInstances.getHostGroups()) {
List<String> instances = unhealthyInstances.getInstancesForGroup(hostGroupName);
flowChainTriggers.add(new StackAndClusterUpscaleTriggerEvent(fullUpscaleTriggerEvent, event.getStackId(), hostGroupName, instances.size(), ScalingType.UPSCALE_TOGETHER));
}
return flowChainTriggers;
}
Aggregations