Search in sources :

Example 1 with SdxCmSyncStartEvent

use of com.sequenceiq.datalake.flow.datalake.cmsync.event.SdxCmSyncStartEvent in project cloudbreak by hortonworks.

the class SdxCmSyncActions method callCoreCmSync.

@Bean(name = "CORE_CM_SYNC_STATE")
public Action<?, ?> callCoreCmSync() {
    return new AbstractSdxCmSyncAction<>(SdxCmSyncStartEvent.class) {

        @Override
        protected void doExecute(SdxContext context, SdxCmSyncStartEvent payload, Map<Object, Object> variables) throws Exception {
            LOGGER.debug("Calling cm sync on core");
            sdxCmSyncService.callCmSync(payload.getResourceId());
            sendEvent(context, new SdxEvent(SDX_CM_SYNC_IN_PROGRESS_EVENT.event(), context));
        }
    };
}
Also used : SdxCmSyncStartEvent(com.sequenceiq.datalake.flow.datalake.cmsync.event.SdxCmSyncStartEvent) SdxEvent(com.sequenceiq.datalake.flow.SdxEvent) Map(java.util.Map) SdxContext(com.sequenceiq.datalake.flow.SdxContext) Bean(org.springframework.context.annotation.Bean)

Example 2 with SdxCmSyncStartEvent

use of com.sequenceiq.datalake.flow.datalake.cmsync.event.SdxCmSyncStartEvent in project cloudbreak by hortonworks.

the class SdxReactorFlowManager method triggerDatalakeSyncComponentVersionsFromCmFlow.

public FlowIdentifier triggerDatalakeSyncComponentVersionsFromCmFlow(SdxCluster cluster) {
    LOGGER.info("Trigger Datalake sync component versions from CM");
    String userId = ThreadBasedUserCrnProvider.getUserCrn();
    SdxCmSyncStartEvent event = new SdxCmSyncStartEvent(cluster.getId(), userId);
    return notify(event.selector(), event, cluster.getClusterName());
}
Also used : SdxCmSyncStartEvent(com.sequenceiq.datalake.flow.datalake.cmsync.event.SdxCmSyncStartEvent)

Aggregations

SdxCmSyncStartEvent (com.sequenceiq.datalake.flow.datalake.cmsync.event.SdxCmSyncStartEvent)2 SdxContext (com.sequenceiq.datalake.flow.SdxContext)1 SdxEvent (com.sequenceiq.datalake.flow.SdxEvent)1 Map (java.util.Map)1 Bean (org.springframework.context.annotation.Bean)1