Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2987,6 +2987,51 @@ public static boolean isAclEnabled(Configuration conf) {
public static final int
DEFAULT_YARN_DISPATCHER_CPU_MONITOR_SAMPLES_PER_MIN = 60;

/**
* Resource manager dispatcher has a thread pool that prints EventQueue,
* configure the corePoolSize of this thread pool,
* the meaning of corePoolSize is the number of threads to keep in the pool.
*/
public static final String YARN_DISPATCHER_PRINT_THREAD_POOL_CORE_POOL_SIZE =
YARN_PREFIX + "dispatcher.print-thread-pool.core-pool-size";

/**
* The minimum number of core threads for the
* Resource manager dispatcher is 1.
*/
public static final int DEFAULT_YARN_DISPATCHER_PRINT_THREAD_POOL_CORE_POOL_SIZE = 1;

/**
* Resource manager dispatcher has a thread pool that prints EventQueue,
* configure the maximumPoolSize of this thread pool,
* the meaning of maximumPoolSize is the maximum number of threads to allow in the pool.
*/
public static final String YARN_DISPATCHER_PRINT_THREAD_POOL_MAXIMUM_POOL_SIZE =
YARN_PREFIX + "dispatcher.print-thread-pool.maximum-pool-size";

/**
* The maximum number of core threads for the
* Resource manager dispatcher is 5.
*/
public static final int DEFAULT_YARN_DISPATCHER_PRINT_THREAD_POOL_MAXIMUM_POOL_SIZE = 5;

/**
* Resource manager dispatcher has a thread pool that prints EventQueue,
* configure the keepAliveTime of this thread pool,
* The meaning of keepAliveTime is as follows
* when the number of threads is greater than the core,
* this is the maximum time that excess idle threads will wait for new tasks before terminating.
*/
public static final String YARN_DISPATCHER_PRINT_THREAD_POOL_KEEP_ALIVE_TIME =
YARN_PREFIX + "dispatcher.print-thread-pool.keep-alive-time";

/**
* The keep alive time of core threads for the
* Resource manager dispatcher is 10s.
*/
public static final long DEFAULT_YARN_DISPATCHER_PRINT_THREAD_POOL_KEEP_ALIVE_TIME =
10*1000; // 10s

/**
* CLASSPATH for YARN applications. A comma-separated list of CLASSPATH
* entries
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,21 @@ protected void serviceInit(Configuration conf) throws Exception{
.build();
// Thread pool for async print event details,
// to prevent wasting too much time for RM.
int numCorePoolSizeThreads = getConfig().getInt(
YarnConfiguration.YARN_DISPATCHER_PRINT_THREAD_POOL_CORE_POOL_SIZE,
YarnConfiguration.DEFAULT_YARN_DISPATCHER_PRINT_THREAD_POOL_CORE_POOL_SIZE);

int numMaximumPoolSizeThreads = getConfig().getInt(
YarnConfiguration.YARN_DISPATCHER_PRINT_THREAD_POOL_MAXIMUM_POOL_SIZE,
YarnConfiguration.DEFAULT_YARN_DISPATCHER_PRINT_THREAD_POOL_MAXIMUM_POOL_SIZE);

long keepAliveTime =
conf.getTimeDuration(YarnConfiguration.YARN_DISPATCHER_PRINT_THREAD_POOL_KEEP_ALIVE_TIME,
YarnConfiguration.DEFAULT_YARN_DISPATCHER_PRINT_THREAD_POOL_KEEP_ALIVE_TIME,
TimeUnit.SECONDS);

printEventDetailsExecutor = new ThreadPoolExecutor(
1, 5, 10, TimeUnit.SECONDS,
numCorePoolSizeThreads, numMaximumPoolSizeThreads, keepAliveTime, TimeUnit.SECONDS,
new LinkedBlockingQueue<>(), threadFactory);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,41 @@
<value>60</value>
</property>

<property>
<description>
Resource manager dispatcher has a thread pool that prints EventQueue,
configure the corePoolSize of this thread pool,
the meaning of corePoolSize is the number of threads to keep in the pool.
the default value is 1.
</description>
<name>yarn.dispatcher.print-thread-pool.core-pool-size</name>
<value>1</value>
</property>

<property>
<description>
Resource manager dispatcher has a thread pool that prints EventQueue,
configure the maximumPoolSize of this thread pool,
the meaning of maximumPoolSize is the maximum number of threads to allow in the pool.
the default value is 5.
</description>
<name>yarn.dispatcher.print-thread-pool.maximum-pool-size</name>
<value>5</value>
</property>

<property>
<description>
Resource manager dispatcher has a thread pool that prints EventQueue,
configure the keepAliveTime of this thread pool,
The meaning of keepAliveTime is as follows
when the number of threads is greater than the core,
this is the maximum time that excess idle threads will wait for new tasks before terminating.
the default value is 10s.
</description>
<name>yarn.dispatcher.print-thread-pool.keep-alive-time</name>
<value>10s</value>
</property>

<property>
<description>The expiry interval for application master reporting.</description>
<name>yarn.am.liveness-monitor.expiry-interval-ms</name>
Expand Down