use of com.sequenceiq.cloudbreak.core.flow2.event.DatabaseBackupTriggerEvent in project cloudbreak by hortonworks.
the class BackupDatalakeDatabaseFlowEventChainFactory method createFlowTriggerEventQueue.
@Override
public FlowTriggerEventQueue createFlowTriggerEventQueue(DatabaseBackupTriggerEvent event) {
Queue<Selectable> flowEventChain = new ConcurrentLinkedQueue<>();
flowEventChain.add(new StackEvent(SaltUpdateEvent.SALT_UPDATE_EVENT.event(), event.getResourceId(), event.accepted()));
flowEventChain.add(new DatabaseBackupTriggerEvent(DATABASE_BACKUP_EVENT.event(), event.getResourceId(), event.getBackupLocation(), event.getBackupId(), event.getCloseConnections()));
return new FlowTriggerEventQueue(getName(), event, flowEventChain);
}
use of com.sequenceiq.cloudbreak.core.flow2.event.DatabaseBackupTriggerEvent in project cloudbreak by hortonworks.
the class ReactorFlowManagerTest method testTriggerDatabaseBackupFlowchain.
@Test
public void testTriggerDatabaseBackupFlowchain() {
long stackId = 1L;
String backupId = UUID.randomUUID().toString();
underTest.triggerDatalakeDatabaseBackup(stackId, BACKUP_LOCATION, backupId, true);
ArgumentCaptor<Acceptable> captor = ArgumentCaptor.forClass(Acceptable.class);
verify(reactorNotifier).notify(eq(stackId), eq(FlowChainTriggers.DATALAKE_DATABASE_BACKUP_CHAIN_TRIGGER_EVENT), captor.capture());
DatabaseBackupTriggerEvent event = (DatabaseBackupTriggerEvent) captor.getValue();
assertEquals(stack.getId(), event.getResourceId());
assertEquals(backupId, event.getBackupId());
assertEquals(BACKUP_LOCATION, event.getBackupLocation());
assertEquals(FlowChainTriggers.DATALAKE_DATABASE_BACKUP_CHAIN_TRIGGER_EVENT, event.selector());
}
Aggregations