Search in sources :

Example 6 with NodeHealthCheckerService

use of org.apache.hadoop.yarn.server.nodemanager.NodeHealthCheckerService in project hadoop by apache.

the class TestNMWebServer method createNodeHealthCheckerService.

private NodeHealthCheckerService createNodeHealthCheckerService(Configuration conf) {
    NodeHealthScriptRunner scriptRunner = NodeManager.getNodeHealthScriptRunner(conf);
    LocalDirsHandlerService dirsHandler = new LocalDirsHandlerService();
    return new NodeHealthCheckerService(scriptRunner, dirsHandler);
}
Also used : NodeHealthCheckerService(org.apache.hadoop.yarn.server.nodemanager.NodeHealthCheckerService) NodeHealthScriptRunner(org.apache.hadoop.util.NodeHealthScriptRunner) LocalDirsHandlerService(org.apache.hadoop.yarn.server.nodemanager.LocalDirsHandlerService)

Example 7 with NodeHealthCheckerService

use of org.apache.hadoop.yarn.server.nodemanager.NodeHealthCheckerService in project hadoop by apache.

the class TestContainerLogsPage method createNodeHealthCheckerService.

private NodeHealthCheckerService createNodeHealthCheckerService(Configuration conf) {
    NodeHealthScriptRunner scriptRunner = NodeManager.getNodeHealthScriptRunner(conf);
    LocalDirsHandlerService dirsHandler = new LocalDirsHandlerService();
    return new NodeHealthCheckerService(scriptRunner, dirsHandler);
}
Also used : NodeHealthCheckerService(org.apache.hadoop.yarn.server.nodemanager.NodeHealthCheckerService) NodeHealthScriptRunner(org.apache.hadoop.util.NodeHealthScriptRunner) LocalDirsHandlerService(org.apache.hadoop.yarn.server.nodemanager.LocalDirsHandlerService)

Example 8 with NodeHealthCheckerService

use of org.apache.hadoop.yarn.server.nodemanager.NodeHealthCheckerService in project hadoop by apache.

the class TestNMWebServer method startNMWebAppServer.

private int startNMWebAppServer(String webAddr) {
    Configuration conf = new Configuration();
    Context nmContext = new NodeManager.NMContext(null, null, null, null, null, false, conf);
    ResourceView resourceView = new ResourceView() {

        @Override
        public long getVmemAllocatedForContainers() {
            return 0;
        }

        @Override
        public long getPmemAllocatedForContainers() {
            return 0;
        }

        @Override
        public long getVCoresAllocatedForContainers() {
            return 0;
        }

        @Override
        public boolean isVmemCheckEnabled() {
            return true;
        }

        @Override
        public boolean isPmemCheckEnabled() {
            return true;
        }
    };
    conf.set(YarnConfiguration.NM_LOCAL_DIRS, testRootDir.getAbsolutePath());
    conf.set(YarnConfiguration.NM_LOG_DIRS, testLogDir.getAbsolutePath());
    NodeHealthCheckerService healthChecker = createNodeHealthCheckerService(conf);
    healthChecker.init(conf);
    LocalDirsHandlerService dirsHandler = healthChecker.getDiskHandler();
    conf.set(YarnConfiguration.NM_WEBAPP_ADDRESS, webAddr);
    WebServer server = new WebServer(nmContext, resourceView, new ApplicationACLsManager(conf), dirsHandler);
    try {
        server.init(conf);
        server.start();
        return server.getPort();
    } finally {
        server.stop();
        healthChecker.stop();
    }
}
Also used : ContainerLaunchContext(org.apache.hadoop.yarn.api.records.ContainerLaunchContext) Context(org.apache.hadoop.yarn.server.nodemanager.Context) ResourceView(org.apache.hadoop.yarn.server.nodemanager.ResourceView) ApplicationACLsManager(org.apache.hadoop.yarn.server.security.ApplicationACLsManager) YarnConfiguration(org.apache.hadoop.yarn.conf.YarnConfiguration) Configuration(org.apache.hadoop.conf.Configuration) NodeHealthCheckerService(org.apache.hadoop.yarn.server.nodemanager.NodeHealthCheckerService) LocalDirsHandlerService(org.apache.hadoop.yarn.server.nodemanager.LocalDirsHandlerService)

Aggregations

LocalDirsHandlerService (org.apache.hadoop.yarn.server.nodemanager.LocalDirsHandlerService)8 NodeHealthCheckerService (org.apache.hadoop.yarn.server.nodemanager.NodeHealthCheckerService)8 Configuration (org.apache.hadoop.conf.Configuration)4 YarnConfiguration (org.apache.hadoop.yarn.conf.YarnConfiguration)4 ApplicationAttemptId (org.apache.hadoop.yarn.api.records.ApplicationAttemptId)3 ApplicationId (org.apache.hadoop.yarn.api.records.ApplicationId)3 ContainerId (org.apache.hadoop.yarn.api.records.ContainerId)3 AsyncDispatcher (org.apache.hadoop.yarn.event.AsyncDispatcher)3 RecordFactory (org.apache.hadoop.yarn.factories.RecordFactory)3 Context (org.apache.hadoop.yarn.server.nodemanager.Context)3 NMContext (org.apache.hadoop.yarn.server.nodemanager.NodeManager.NMContext)3 Application (org.apache.hadoop.yarn.server.nodemanager.containermanager.application.Application)3 ApplicationACLsManager (org.apache.hadoop.yarn.server.security.ApplicationACLsManager)3 Test (org.junit.Test)3 File (java.io.File)2 Path (org.apache.hadoop.fs.Path)2 NodeHealthScriptRunner (org.apache.hadoop.util.NodeHealthScriptRunner)2 ContainerLaunchContext (org.apache.hadoop.yarn.api.records.ContainerLaunchContext)2 ResourceView (org.apache.hadoop.yarn.server.nodemanager.ResourceView)2 Container (org.apache.hadoop.yarn.server.nodemanager.containermanager.container.Container)2