Search in sources :

Example 1 with DatalakeUpgradeStartEvent

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);
}
Also used : FlowTriggerEventQueue(com.sequenceiq.flow.core.chain.config.FlowTriggerEventQueue) Selectable(com.sequenceiq.cloudbreak.common.event.Selectable) ConcurrentLinkedQueue(java.util.concurrent.ConcurrentLinkedQueue) DatalakeUpgradeStartEvent(com.sequenceiq.datalake.flow.datalake.upgrade.event.DatalakeUpgradeStartEvent) DatalakeTriggerBackupEvent(com.sequenceiq.datalake.flow.dr.backup.event.DatalakeTriggerBackupEvent)

Example 2 with DatalakeUpgradeStartEvent

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());
    }
}
Also used : DatalakeUpgradeFlowChainStartEvent(com.sequenceiq.datalake.flow.datalake.upgrade.event.DatalakeUpgradeFlowChainStartEvent) DatalakeUpgradeStartEvent(com.sequenceiq.datalake.flow.datalake.upgrade.event.DatalakeUpgradeStartEvent)

Aggregations

DatalakeUpgradeStartEvent (com.sequenceiq.datalake.flow.datalake.upgrade.event.DatalakeUpgradeStartEvent)2 Selectable (com.sequenceiq.cloudbreak.common.event.Selectable)1 DatalakeUpgradeFlowChainStartEvent (com.sequenceiq.datalake.flow.datalake.upgrade.event.DatalakeUpgradeFlowChainStartEvent)1 DatalakeTriggerBackupEvent (com.sequenceiq.datalake.flow.dr.backup.event.DatalakeTriggerBackupEvent)1 FlowTriggerEventQueue (com.sequenceiq.flow.core.chain.config.FlowTriggerEventQueue)1 ConcurrentLinkedQueue (java.util.concurrent.ConcurrentLinkedQueue)1