use of com.vip.saturn.job.console.utils.ConsoleThreadFactory in project Saturn by vipshop.
the class DashboardLeaderHandler method createNodeCache.
private void createNodeCache() throws Exception {
executorService = Executors.newSingleThreadExecutor(new ConsoleThreadFactory("nodeCache-for-dashboardLeaderHost-" + zkAlias, false));
nodeCache = new NodeCache(curatorFramework, SaturnSelfNodePath.SATURN_CONSOLE_DASHBOARD_LEADER_HOST);
nodeCache.start();
nodeCache.getListenable().addListener(new NodeCacheListener() {
@Override
public void nodeChanged() throws Exception {
electLeaderIfNecessary();
}
}, executorService);
}
use of com.vip.saturn.job.console.utils.ConsoleThreadFactory in project Saturn by vipshop.
the class DashboardLeaderTreeCache method createNodeCache.
private void createNodeCache() throws Exception {
executorService = Executors.newSingleThreadExecutor(new ConsoleThreadFactory("nodeCache-for-dashboardLeaderHost-" + zkAlias, false));
nodeCache = new NodeCache(curatorFramework, SaturnSelfNodePath.SATURN_CONSOLE_DASHBOARD_LEADER_HOST);
nodeCache.start();
nodeCache.getListenable().addListener(new NodeCacheListener() {
@Override
public void nodeChanged() throws Exception {
electLeaderIfNecessary();
}
}, executorService);
}
use of com.vip.saturn.job.console.utils.ConsoleThreadFactory in project Saturn by vipshop.
the class StatisticsRefreshServiceImpl method initStatExecutorService.
private void initStatExecutorService() {
if (statExecutorService != null) {
statExecutorService.shutdownNow();
}
ThreadPoolExecutor tp = new ThreadPoolExecutor(STAT_THREAD_NUM, STAT_THREAD_NUM, DashboardConstants.REFRESH_INTERVAL_IN_MINUTE + 1, TimeUnit.MINUTES, new LinkedBlockingQueue<Runnable>(), new ConsoleThreadFactory("dashboard-statistics-thread", true));
tp.allowCoreThreadTimeOut(true);
statExecutorService = tp;
}
Aggregations