Search in sources :

Example 11 with CustomThreadFactory

use of com.dtstack.taier.pluginapi.CustomThreadFactory in project Taier by DTStack.

the class SessionClientFactory method startYarnSessionClientMonitor.

private void startYarnSessionClientMonitor() {
    String threadName = String.format("%s-%s", sessionAppNameSuffix, "flink_yarn_monitor");
    LOG.warn("ThreadName : [{}] start a yarn session client monitor [{}].", Thread.currentThread().getName(), threadName);
    yarnMonitorES = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(), new CustomThreadFactory(threadName));
    // 启动守护线程---用于获取当前application状态和更新flink对应的application
    yarnMonitorES.submit(new AppStatusMonitor(flinkClientBuilder, this));
}
Also used : CustomThreadFactory(com.dtstack.taier.pluginapi.CustomThreadFactory) ThreadPoolExecutor(java.util.concurrent.ThreadPoolExecutor) LinkedBlockingQueue(java.util.concurrent.LinkedBlockingQueue)

Example 12 with CustomThreadFactory

use of com.dtstack.taier.pluginapi.CustomThreadFactory in project Taier by DTStack.

the class AcceptedApplicationMonitor method start.

public static void start(YarnConfiguration yarnConf, String queueName, BaseConfig config) {
    AcceptedApplicationMonitor monitor = new AcceptedApplicationMonitor();
    monitor.queueName = queueName;
    monitor.yarnConf = yarnConf;
    monitor.config = config;
    String namePrefix = monitor.getClass().getSimpleName() + SPLIT + queueName;
    scheduledService = new ScheduledThreadPoolExecutor(1, new CustomThreadFactory(namePrefix));
    scheduledService.scheduleWithFixedDelay(monitor, 0, INTERVAL, TimeUnit.MILLISECONDS);
}
Also used : CustomThreadFactory(com.dtstack.taier.pluginapi.CustomThreadFactory) ScheduledThreadPoolExecutor(java.util.concurrent.ScheduledThreadPoolExecutor)

Aggregations

CustomThreadFactory (com.dtstack.taier.pluginapi.CustomThreadFactory)12 ScheduledThreadPoolExecutor (java.util.concurrent.ScheduledThreadPoolExecutor)5 ThreadPoolExecutor (java.util.concurrent.ThreadPoolExecutor)4 LinkedBlockingQueue (java.util.concurrent.LinkedBlockingQueue)3 CustomThreadRunsPolicy (com.dtstack.taier.common.CustomThreadRunsPolicy)1 EnvironmentContext (com.dtstack.taier.common.env.EnvironmentContext)1 JobClientComparator (com.dtstack.taier.common.queue.comparator.JobClientComparator)1 WorkerOperator (com.dtstack.taier.scheduler.WorkerOperator)1 JobSubmitDealer (com.dtstack.taier.scheduler.jobdealer.JobSubmitDealer)1 JobPartitioner (com.dtstack.taier.scheduler.server.JobPartitioner)1 AbstractJobSummitScheduler (com.dtstack.taier.scheduler.server.scheduler.AbstractJobSummitScheduler)1 EngineJobCacheService (com.dtstack.taier.scheduler.service.EngineJobCacheService)1 ExecutorService (java.util.concurrent.ExecutorService)1 ScheduledExecutorService (java.util.concurrent.ScheduledExecutorService)1 PostConstruct (javax.annotation.PostConstruct)1