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());
}
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);
}
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);
}
Aggregations