use of com.sequenceiq.datalake.flow.datalake.upgrade.event.DatalakeUpgradeStartEvent in project cloudbreak by hortonworks.
the class DatalakeUpgradeFlowEventChainFactory method createFlowTriggerEventQueue.
@Override
public FlowTriggerEventQueue createFlowTriggerEventQueue(DatalakeUpgradeFlowChainStartEvent event) {
Queue<Selectable> chain = new ConcurrentLinkedQueue<>();
chain.add(new DatalakeTriggerBackupEvent(DATALAKE_TRIGGER_BACKUP_EVENT.event(), event.getResourceId(), event.getUserId(), event.getBackupLocation(), "", DatalakeBackupFailureReason.BACKUP_ON_UPGRADE, event.accepted()));
chain.add(new DatalakeUpgradeStartEvent(DATALAKE_UPGRADE_EVENT.event(), event.getResourceId(), event.getUserId(), event.getImageId(), event.getReplaceVms()));
return new FlowTriggerEventQueue(getName(), event, chain);
}
use of com.sequenceiq.datalake.flow.datalake.upgrade.event.DatalakeUpgradeStartEvent 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());
}
}
Aggregations