use of com.sequenceiq.datalake.flow.detach.event.DatalakeResizeRecoveryFlowChainStartEvent in project cloudbreak by hortonworks.
the class DatalakeResizeRecoveryFlowEventChainTest method chainCreationTestAllEvents.
@Test
public void chainCreationTestAllEvents() {
SdxCluster oldCluster = new SdxCluster();
oldCluster.setId(OLD_CLUSTER_SDX_ID);
oldCluster.setDetached(true);
SdxCluster newCluster = new SdxCluster();
newCluster.setId(NEW_CLUSTER_SDX_ID);
DatalakeResizeRecoveryFlowChainStartEvent event = new DatalakeResizeRecoveryFlowChainStartEvent(oldCluster, newCluster, USER_CRN);
FlowTriggerEventQueue flowTriggerEventQueue = factory.createFlowTriggerEventQueue(event);
assertEquals(4, flowTriggerEventQueue.getQueue().size());
Queue<Selectable> flowQueue = flowTriggerEventQueue.getQueue();
checkEventIsDetach(flowQueue.remove());
checkEventIsDeletion(flowQueue.remove());
checkEventIsDetachRecovery(flowQueue.remove());
checkEventIsStart(flowQueue.remove());
}
use of com.sequenceiq.datalake.flow.detach.event.DatalakeResizeRecoveryFlowChainStartEvent in project cloudbreak by hortonworks.
the class SdxReactorFlowManager method triggerSdxResizeRecovery.
public FlowIdentifier triggerSdxResizeRecovery(SdxCluster oldSdxCluster, SdxCluster newSdxCluster) {
LOGGER.info("Triggering recovery for failed SDX resize with original cluster: {} and resized cluster: {}", oldSdxCluster, newSdxCluster);
String userId = ThreadBasedUserCrnProvider.getUserCrn();
return notify(SDX_RESIZE_RECOVERY_FLOW_CHAIN_START_EVENT, new DatalakeResizeRecoveryFlowChainStartEvent(oldSdxCluster, newSdxCluster, userId), oldSdxCluster.getClusterName());
}
use of com.sequenceiq.datalake.flow.detach.event.DatalakeResizeRecoveryFlowChainStartEvent in project cloudbreak by hortonworks.
the class DatalakeResizeRecoveryFlowEventChainTest method chainCreationTestNewDLNull.
@Test
public void chainCreationTestNewDLNull() {
SdxCluster oldCluster = new SdxCluster();
oldCluster.setId(OLD_CLUSTER_SDX_ID);
oldCluster.setDetached(true);
DatalakeResizeRecoveryFlowChainStartEvent event = new DatalakeResizeRecoveryFlowChainStartEvent(oldCluster, null, USER_CRN);
FlowTriggerEventQueue flowTriggerEventQueue = factory.createFlowTriggerEventQueue(event);
assertEquals(2, flowTriggerEventQueue.getQueue().size());
Queue<Selectable> flowQueue = flowTriggerEventQueue.getQueue();
checkEventIsDetachRecovery(flowQueue.remove());
checkEventIsStart(flowQueue.remove());
}
use of com.sequenceiq.datalake.flow.detach.event.DatalakeResizeRecoveryFlowChainStartEvent in project cloudbreak by hortonworks.
the class DatalakeResizeRecoveryFlowEventChainTest method chainCreationTestNewDLAlreadyDeletedAndOldDLNotDetached.
@Test
public void chainCreationTestNewDLAlreadyDeletedAndOldDLNotDetached() {
SdxCluster oldCluster = new SdxCluster();
oldCluster.setId(OLD_CLUSTER_SDX_ID);
oldCluster.setDetached(false);
SdxCluster newCluster = new SdxCluster();
newCluster.setDeleted(1L);
DatalakeResizeRecoveryFlowChainStartEvent event = new DatalakeResizeRecoveryFlowChainStartEvent(oldCluster, newCluster, USER_CRN);
FlowTriggerEventQueue flowTriggerEventQueue = factory.createFlowTriggerEventQueue(event);
assertEquals(1, flowTriggerEventQueue.getQueue().size());
Queue<Selectable> flowQueue = flowTriggerEventQueue.getQueue();
checkEventIsStart(flowQueue.remove());
}
use of com.sequenceiq.datalake.flow.detach.event.DatalakeResizeRecoveryFlowChainStartEvent in project cloudbreak by hortonworks.
the class DatalakeResizeRecoveryFlowEventChainTest method chainCreationTestNewDLAlreadyDeleted.
@Test
public void chainCreationTestNewDLAlreadyDeleted() {
SdxCluster oldCluster = new SdxCluster();
oldCluster.setId(OLD_CLUSTER_SDX_ID);
oldCluster.setDetached(true);
SdxCluster newCluster = new SdxCluster();
newCluster.setDeleted(1L);
DatalakeResizeRecoveryFlowChainStartEvent event = new DatalakeResizeRecoveryFlowChainStartEvent(oldCluster, newCluster, USER_CRN);
FlowTriggerEventQueue flowTriggerEventQueue = factory.createFlowTriggerEventQueue(event);
assertEquals(2, flowTriggerEventQueue.getQueue().size());
Queue<Selectable> flowQueue = flowTriggerEventQueue.getQueue();
checkEventIsDetachRecovery(flowQueue.remove());
checkEventIsStart(flowQueue.remove());
}
Aggregations