Search in sources :

Example 1 with DatalakeUpgradeFlowChainStartEvent

use of com.sequenceiq.datalake.flow.datalake.upgrade.event.DatalakeUpgradeFlowChainStartEvent in project cloudbreak by hortonworks.

the class SdxReactorFlowManager method triggerDatalakeRuntimeUpgradeFlow.

public FlowIdentifier triggerDatalakeRuntimeUpgradeFlow(SdxCluster cluster, String imageId, SdxUpgradeReplaceVms replaceVms, boolean skipBackup) {
    LOGGER.info("Trigger Datalake runtime upgrade for: {} with imageId: {} and replace vm param: {}", cluster, imageId, replaceVms);
    String userId = ThreadBasedUserCrnProvider.getUserCrn();
    if (!skipBackup && sdxBackupRestoreService.shouldSdxBackupBePerformed(cluster, entitlementService.isDatalakeBackupOnUpgradeEnabled(ThreadBasedUserCrnProvider.getAccountId()))) {
        LOGGER.info("Triggering backup before an upgrade");
        return notify(DatalakeUpgradeFlowChainStartEvent.DATALAKE_UPGRADE_FLOW_CHAIN_EVENT, new DatalakeUpgradeFlowChainStartEvent(DatalakeUpgradeFlowChainStartEvent.DATALAKE_UPGRADE_FLOW_CHAIN_EVENT, cluster.getId(), userId, imageId, replaceVms.getBooleanValue(), environmentClientService.getBackupLocation(cluster.getEnvCrn())), cluster.getClusterName());
    } else {
        return notify(DATALAKE_UPGRADE_EVENT.event(), new DatalakeUpgradeStartEvent(DATALAKE_UPGRADE_EVENT.event(), cluster.getId(), userId, imageId, replaceVms.getBooleanValue()), cluster.getClusterName());
    }
}
Also used : DatalakeUpgradeFlowChainStartEvent(com.sequenceiq.datalake.flow.datalake.upgrade.event.DatalakeUpgradeFlowChainStartEvent) DatalakeUpgradeStartEvent(com.sequenceiq.datalake.flow.datalake.upgrade.event.DatalakeUpgradeStartEvent)

Aggregations

DatalakeUpgradeFlowChainStartEvent (com.sequenceiq.datalake.flow.datalake.upgrade.event.DatalakeUpgradeFlowChainStartEvent)1 DatalakeUpgradeStartEvent (com.sequenceiq.datalake.flow.datalake.upgrade.event.DatalakeUpgradeStartEvent)1