use of com.dtstack.taier.pluginapi.CustomThreadFactory in project Taier by DTStack.
the class TaskLogStoreDealer method init.
@PostConstruct
public void init() {
dbConfig.put(ConfigConstant.JDBCURL, environmentContext.getJdbcUrl());
dbConfig.put(ConfigConstant.USERNAME, environmentContext.getJdbcUser());
dbConfig.put(ConfigConstant.PASSWORD, environmentContext.getJdbcPassword());
dbConfig.put(ConfigConstant.INITIAL_SIZE, String.valueOf(environmentContext.getInitialPoolSize()));
dbConfig.put(ConfigConstant.MINIDLE, String.valueOf(environmentContext.getMinPoolSize()));
dbConfig.put(ConfigConstant.MAXACTIVE, String.valueOf(environmentContext.getMaxPoolSize()));
logStore = LogStoreFactory.getLogStore(dbConfig);
this.scheduledService = new ScheduledThreadPoolExecutor(1, new CustomThreadFactory(this.getClass().getSimpleName()));
scheduledService.scheduleWithFixedDelay(this, 0, CHECK_INTERVAL, TimeUnit.MILLISECONDS);
}
use of com.dtstack.taier.pluginapi.CustomThreadFactory in project Taier by DTStack.
the class JobSchedulerListener method onApplicationEvent.
@Override
public void onApplicationEvent(ApplicationStartedEvent applicationStartedEvent) {
LOGGER.info("Initializing " + this.getClass().getName());
if (!environmentContext.openJobSchedule()) {
LOGGER.info("job schedule is not open!!!");
return;
}
executors.add(fillDataJobScheduler);
executors.add(cycleJobScheduler);
executors.add(restartJobScheduler);
executorService = new ThreadPoolExecutor(3, 3, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(), new CustomThreadFactory("ExecutorDealer"));
for (AbstractJobSummitScheduler scheduler : executors) {
executorService.submit(scheduler);
}
}
use of com.dtstack.taier.pluginapi.CustomThreadFactory in project Taier by DTStack.
the class JobStatusDealer method start.
public void start() {
long jobStatusCheckInterVal = environmentContext.getJobStatusCheckInterVal();
ScheduledExecutorService scheduledService = new ScheduledThreadPoolExecutor(1, new CustomThreadFactory(jobResource + this.getClass().getSimpleName()));
scheduledService.scheduleWithFixedDelay(this, 0, jobStatusCheckInterVal, TimeUnit.MILLISECONDS);
LOGGER.info("{} thread start ...", jobResource + this.getClass().getSimpleName());
}
use of com.dtstack.taier.pluginapi.CustomThreadFactory in project Taier by DTStack.
the class AbstractJobSummitScheduler method afterPropertiesSet.
@Override
public void afterPropertiesSet() throws Exception {
super.afterPropertiesSet();
scheduleJobQueue = new LinkedBlockingQueue<>(env.getQueueSize());
String threadName = this.getClass().getSimpleName() + "_" + getSchedulerName() + "_startJobProcessor";
executorService = new ThreadPoolExecutor(env.getJobExecutorPoolCorePoolSize(), env.getJobExecutorPoolMaximumPoolSize(), env.getJobExecutorPoolKeepAliveTime(), TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(env.getJobExecutorPoolQueueSize()), new CustomThreadFactory(threadName), new CustomThreadRunsPolicy(threadName, getSchedulerName()));
}
use of com.dtstack.taier.pluginapi.CustomThreadFactory in project Taier by DTStack.
the class QueueListener method afterPropertiesSet.
@Override
public void afterPropertiesSet() throws Exception {
checkJobMaxPriorityStrategy = environmentContext.getCheckJobMaxPriorityStrategy();
scheduledService = new ScheduledThreadPoolExecutor(1, new CustomThreadFactory(this.getClass().getSimpleName()));
scheduledService.scheduleWithFixedDelay(this, 0, CHECK_INTERVAL, TimeUnit.MILLISECONDS);
}
Aggregations