Search in sources :

Example 1 with ScheduleTaskRunner

use of co.cask.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").build()));
    taskRunner = new ScheduleTaskRunner(lifecycleService, propertiesResolver, taskExecutorService, namespaceQueryAdmin, cConf);
    int numPartitions = Schedulers.getJobQueue(multiThreadDatasetCache, datasetFramework).getNumPartitions();
    for (int partition = 0; partition < numPartitions; partition++) {
        taskExecutorService.submit(new ConstraintCheckerThread(partition));
    }
    LOG.info("Started ConstraintCheckerService. state: " + state());
}
Also used : ScheduleTaskRunner(co.cask.cdap.internal.app.runtime.schedule.ScheduleTaskRunner) ThreadFactoryBuilder(com.google.common.util.concurrent.ThreadFactoryBuilder) CheckableConstraint(co.cask.cdap.internal.app.runtime.schedule.constraint.CheckableConstraint) Constraint(co.cask.cdap.internal.schedule.constraint.Constraint)

Aggregations

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