Search in sources :

Example 1 with DatalakeResizeFlowChainStartEvent

use of com.sequenceiq.datalake.flow.detach.event.DatalakeResizeFlowChainStartEvent in project cloudbreak by hortonworks.

the class SdxReactorFlowManager method triggerSdxResize.

public FlowIdentifier triggerSdxResize(Long sdxClusterId, SdxCluster newSdxCluster) {
    LOGGER.info("Trigger Datalake resizing for: {}", sdxClusterId);
    String userId = ThreadBasedUserCrnProvider.getUserCrn();
    boolean performBackup = sdxBackupRestoreService.shouldSdxBackupBePerformed(newSdxCluster, entitlementService.isDatalakeBackupOnResizeEnabled(ThreadBasedUserCrnProvider.getAccountId()));
    boolean performRestore = sdxBackupRestoreService.shouldSdxRestoreBePerformed(newSdxCluster, entitlementService.isDatalakeBackupOnResizeEnabled(ThreadBasedUserCrnProvider.getAccountId()));
    eventSenderService.sendEventAndNotification(newSdxCluster, userId, DATALAKE_RESIZE_TRIGGERED);
    return notify(SDX_RESIZE_FLOW_CHAIN_START_EVENT, new DatalakeResizeFlowChainStartEvent(sdxClusterId, newSdxCluster, userId, environmentClientService.getBackupLocation(newSdxCluster.getEnvCrn()), performBackup, performRestore), newSdxCluster.getClusterName());
}
Also used : DatalakeResizeFlowChainStartEvent(com.sequenceiq.datalake.flow.detach.event.DatalakeResizeFlowChainStartEvent)

Example 2 with DatalakeResizeFlowChainStartEvent

use of com.sequenceiq.datalake.flow.detach.event.DatalakeResizeFlowChainStartEvent in project cloudbreak by hortonworks.

the class DatalakeResizeFlowEventChainTest method chainCreationTest.

@Test
public void chainCreationTest() {
    DatalakeResizeFlowChainStartEvent event = new DatalakeResizeFlowChainStartEvent(sdxCluster.getId(), sdxCluster, USER_CRN, BACKUP_LOCATION, true, true);
    FlowTriggerEventQueue flowTriggerEventQueue = factory.createFlowTriggerEventQueue(event);
    assertEquals(7, flowTriggerEventQueue.getQueue().size());
    assertTriggerBackupEvent(flowTriggerEventQueue);
}
Also used : FlowTriggerEventQueue(com.sequenceiq.flow.core.chain.config.FlowTriggerEventQueue) DatalakeResizeFlowChainStartEvent(com.sequenceiq.datalake.flow.detach.event.DatalakeResizeFlowChainStartEvent) Test(org.junit.Test)

Example 3 with DatalakeResizeFlowChainStartEvent

use of com.sequenceiq.datalake.flow.detach.event.DatalakeResizeFlowChainStartEvent in project cloudbreak by hortonworks.

the class DatalakeResizeFlowEventChainTest method chainCreationWithRazTest.

@Test
public void chainCreationWithRazTest() {
    SdxCluster clusterWithRaz = getValidSdxClusterwithRaz();
    DatalakeResizeFlowChainStartEvent event = new DatalakeResizeFlowChainStartEvent(clusterWithRaz.getId(), clusterWithRaz, USER_CRN, BACKUP_LOCATION, true, true);
    FlowTriggerEventQueue flowTriggerEventQueue = factory.createFlowTriggerEventQueue(event);
    assertEquals(7, flowTriggerEventQueue.getQueue().size());
    assertTriggerBackupEvent(flowTriggerEventQueue);
}
Also used : FlowTriggerEventQueue(com.sequenceiq.flow.core.chain.config.FlowTriggerEventQueue) SdxCluster(com.sequenceiq.datalake.entity.SdxCluster) DatalakeResizeFlowChainStartEvent(com.sequenceiq.datalake.flow.detach.event.DatalakeResizeFlowChainStartEvent) Test(org.junit.Test)

Aggregations

DatalakeResizeFlowChainStartEvent (com.sequenceiq.datalake.flow.detach.event.DatalakeResizeFlowChainStartEvent)3 FlowTriggerEventQueue (com.sequenceiq.flow.core.chain.config.FlowTriggerEventQueue)2 Test (org.junit.Test)2 SdxCluster (com.sequenceiq.datalake.entity.SdxCluster)1