Search in sources :

Example 1 with ScheduleTaskRunner

use of io.cdap.cdap.internal.app.runtime.schedule.ScheduleTaskRunner in project cdap by caskdata.

the class ConstraintCheckerService method startUp.

@Override
protected void startUp() throws Exception {
    LOG.info("Starting ConstraintCheckerService.");
    taskExecutorService = MoreExecutors.listeningDecorator(Executors.newCachedThreadPool(new ThreadFactoryBuilder().setNameFormat("constraint-checker-task-%d").build()));
    taskRunner = new ScheduleTaskRunner(store, lifecycleService, propertiesResolver, namespaceQueryAdmin, cConf);
    int numPartitions = cConf.getInt(Constants.Scheduler.JOB_QUEUE_NUM_PARTITIONS);
    for (int partition = 0; partition < numPartitions; partition++) {
        taskExecutorService.submit(new ConstraintCheckerThread(partition));
    }
    LOG.info("Started ConstraintCheckerService. state: " + state());
}
Also used : ScheduleTaskRunner(io.cdap.cdap.internal.app.runtime.schedule.ScheduleTaskRunner) ThreadFactoryBuilder(com.google.common.util.concurrent.ThreadFactoryBuilder) CheckableConstraint(io.cdap.cdap.internal.app.runtime.schedule.constraint.CheckableConstraint) Constraint(io.cdap.cdap.internal.schedule.constraint.Constraint)

Aggregations

ThreadFactoryBuilder (com.google.common.util.concurrent.ThreadFactoryBuilder)1 ScheduleTaskRunner (io.cdap.cdap.internal.app.runtime.schedule.ScheduleTaskRunner)1 CheckableConstraint (io.cdap.cdap.internal.app.runtime.schedule.constraint.CheckableConstraint)1 Constraint (io.cdap.cdap.internal.schedule.constraint.Constraint)1