MAPREDUCE-6443. Add JvmPauseMonitor to JobHistoryServer. Contributed by Robert Kanter.

(cherry picked from commit c8469357ba)

Conflicts:

	hadoop-mapreduce-project/CHANGES.txt
This commit is contained in:
Junping Du 2015-08-06 07:00:42 -07:00
parent cfee02b3bd
commit e73a928a63
2 changed files with 15 additions and 2 deletions

View File

@ -373,6 +373,9 @@ Release 2.8.0 - UNRELEASED
MAPREDUCE-6384. Add the last reporting reducer info for too many fetch MAPREDUCE-6384. Add the last reporting reducer info for too many fetch
failure diagnostics (Chang Li via jlowe) failure diagnostics (Chang Li via jlowe)
MAPREDUCE-6443. Add JvmPauseMonitor to JobHistoryServer. (Robert Kanter
via junping_du)
OPTIMIZATIONS OPTIMIZATIONS
MAPREDUCE-6376. Add avro binary support for jhist files (Ray Chiang via MAPREDUCE-6376. Add avro binary support for jhist files (Ray Chiang via

View File

@ -38,6 +38,7 @@ import org.apache.hadoop.service.AbstractService;
import org.apache.hadoop.service.CompositeService; import org.apache.hadoop.service.CompositeService;
import org.apache.hadoop.util.ExitUtil; import org.apache.hadoop.util.ExitUtil;
import org.apache.hadoop.util.GenericOptionsParser; import org.apache.hadoop.util.GenericOptionsParser;
import org.apache.hadoop.util.JvmPauseMonitor;
import org.apache.hadoop.util.ShutdownHookManager; import org.apache.hadoop.util.ShutdownHookManager;
import org.apache.hadoop.util.StringUtils; import org.apache.hadoop.util.StringUtils;
import org.apache.hadoop.yarn.YarnUncaughtExceptionHandler; import org.apache.hadoop.yarn.YarnUncaughtExceptionHandler;
@ -70,6 +71,7 @@ public class JobHistoryServer extends CompositeService {
private AggregatedLogDeletionService aggLogDelService; private AggregatedLogDeletionService aggLogDelService;
private HSAdminServer hsAdminServer; private HSAdminServer hsAdminServer;
private HistoryServerStateStoreService stateStore; private HistoryServerStateStoreService stateStore;
private JvmPauseMonitor pauseMonitor;
// utility class to start and stop secret manager as part of service // utility class to start and stop secret manager as part of service
// framework and implement state recovery for secret manager on startup // framework and implement state recovery for secret manager on startup
@ -140,6 +142,12 @@ public class JobHistoryServer extends CompositeService {
addService(clientService); addService(clientService);
addService(aggLogDelService); addService(aggLogDelService);
addService(hsAdminServer); addService(hsAdminServer);
DefaultMetricsSystem.initialize("JobHistoryServer");
JvmMetrics jm = JvmMetrics.initSingleton("JobHistoryServer", null);
pauseMonitor = new JvmPauseMonitor(getConfig());
jm.setPauseMonitor(pauseMonitor);
super.serviceInit(config); super.serviceInit(config);
} }
@ -190,14 +198,16 @@ public class JobHistoryServer extends CompositeService {
@Override @Override
protected void serviceStart() throws Exception { protected void serviceStart() throws Exception {
DefaultMetricsSystem.initialize("JobHistoryServer"); pauseMonitor.start();
JvmMetrics.initSingleton("JobHistoryServer", null);
super.serviceStart(); super.serviceStart();
} }
@Override @Override
protected void serviceStop() throws Exception { protected void serviceStop() throws Exception {
DefaultMetricsSystem.shutdown(); DefaultMetricsSystem.shutdown();
if (pauseMonitor != null) {
pauseMonitor.stop();
}
super.serviceStop(); super.serviceStop();
} }