use of org.apache.hadoop.util.concurrent.HadoopScheduledThreadPoolExecutor in project hadoop by apache.
the class NonAggregatingLogHandler method createScheduledThreadPoolExecutor.
ScheduledThreadPoolExecutor createScheduledThreadPoolExecutor(Configuration conf) {
ThreadFactory tf = new ThreadFactoryBuilder().setNameFormat("LogDeleter #%d").build();
sched = new HadoopScheduledThreadPoolExecutor(conf.getInt(YarnConfiguration.NM_LOG_DELETION_THREADS_COUNT, YarnConfiguration.DEFAULT_NM_LOG_DELETE_THREAD_COUNT), tf);
return sched;
}
use of org.apache.hadoop.util.concurrent.HadoopScheduledThreadPoolExecutor in project hadoop by apache.
the class JobHistory method serviceStart.
@Override
protected void serviceStart() throws Exception {
hsManager.start();
if (storage instanceof Service) {
((Service) storage).start();
}
scheduledExecutor = new HadoopScheduledThreadPoolExecutor(2, new ThreadFactoryBuilder().setNameFormat("Log Scanner/Cleaner #%d").build());
scheduledExecutor.scheduleAtFixedRate(new MoveIntermediateToDoneRunnable(), moveThreadInterval, moveThreadInterval, TimeUnit.MILLISECONDS);
// Start historyCleaner
scheduleHistoryCleaner();
super.serviceStart();
}
use of org.apache.hadoop.util.concurrent.HadoopScheduledThreadPoolExecutor in project hadoop by apache.
the class DeletionService method serviceInit.
@Override
protected void serviceInit(Configuration conf) throws Exception {
ThreadFactory tf = new ThreadFactoryBuilder().setNameFormat("DeletionService #%d").build();
if (conf != null) {
sched = new HadoopScheduledThreadPoolExecutor(conf.getInt(YarnConfiguration.NM_DELETE_THREAD_COUNT, YarnConfiguration.DEFAULT_NM_DELETE_THREAD_COUNT), tf);
debugDelay = conf.getInt(YarnConfiguration.DEBUG_NM_DELETE_DELAY_SEC, 0);
} else {
sched = new HadoopScheduledThreadPoolExecutor(YarnConfiguration.DEFAULT_NM_DELETE_THREAD_COUNT, tf);
}
sched.setExecuteExistingDelayedTasksAfterShutdownPolicy(false);
sched.setKeepAliveTime(60L, SECONDS);
if (stateStore.canRecover()) {
recover(stateStore.loadDeletionServiceState());
}
super.serviceInit(conf);
}
Aggregations