use of co.cask.cdap.api.schedule.ScheduleBuilder in project cdap by caskdata.
the class DataPipelineApp method configure.
@Override
public void configure() {
ETLBatchConfig config = getConfig();
setDescription(Objects.firstNonNull(config.getDescription(), DEFAULT_DESCRIPTION));
BatchPipelineSpec spec = new BatchPipelineSpecGenerator<>(getConfigurer(), ImmutableSet.of(BatchSource.PLUGIN_TYPE), ImmutableSet.of(BatchSink.PLUGIN_TYPE, SparkSink.PLUGIN_TYPE, AlertPublisher.PLUGIN_TYPE), config.getEngine()).generateSpec(config);
addWorkflow(new SmartWorkflow(spec, supportedPluginTypes, getConfigurer(), config.getEngine()));
ScheduleBuilder scheduleBuilder = buildSchedule(SCHEDULE_NAME, ProgramType.WORKFLOW, SmartWorkflow.NAME).setDescription("Data pipeline schedule");
Integer maxConcurrentRuns = config.getMaxConcurrentRuns();
if (maxConcurrentRuns != null) {
scheduleBuilder.withConcurrency(maxConcurrentRuns);
}
schedule(scheduleBuilder.triggerByTime(config.getSchedule()));
}
Aggregations