Search in sources :

Example 1 with LogHandler

use of org.apache.hadoop.yarn.server.nodemanager.containermanager.loghandler.LogHandler in project hadoop by apache.

the class ContainerManagerImpl method serviceInit.

@Override
public void serviceInit(Configuration conf) throws Exception {
    LogHandler logHandler = createLogHandler(conf, this.context, this.deletionService);
    addIfService(logHandler);
    dispatcher.register(LogHandlerEventType.class, logHandler);
    // add the shared cache upload service (it will do nothing if the shared
    // cache is disabled)
    SharedCacheUploadService sharedCacheUploader = createSharedCacheUploaderService();
    addService(sharedCacheUploader);
    dispatcher.register(SharedCacheUploadEventType.class, sharedCacheUploader);
    createAMRMProxyService(conf);
    waitForContainersOnShutdownMillis = conf.getLong(YarnConfiguration.NM_SLEEP_DELAY_BEFORE_SIGKILL_MS, YarnConfiguration.DEFAULT_NM_SLEEP_DELAY_BEFORE_SIGKILL_MS) + conf.getLong(YarnConfiguration.NM_PROCESS_KILL_WAIT_MS, YarnConfiguration.DEFAULT_NM_PROCESS_KILL_WAIT_MS) + SHUTDOWN_CLEANUP_SLOP_MS;
    super.serviceInit(conf);
    recover();
}
Also used : NonAggregatingLogHandler(org.apache.hadoop.yarn.server.nodemanager.containermanager.loghandler.NonAggregatingLogHandler) LogHandler(org.apache.hadoop.yarn.server.nodemanager.containermanager.loghandler.LogHandler) SharedCacheUploadService(org.apache.hadoop.yarn.server.nodemanager.containermanager.localizer.sharedcache.SharedCacheUploadService)

Example 2 with LogHandler

use of org.apache.hadoop.yarn.server.nodemanager.containermanager.loghandler.LogHandler in project hadoop by apache.

the class TestContainerManagerRecovery method createContainerManager.

private ContainerManagerImpl createContainerManager(Context context) {
    final LogHandler logHandler = mock(LogHandler.class);
    final ResourceLocalizationService rsrcSrv = new ResourceLocalizationService(null, null, null, null, context) {

        @Override
        public void serviceInit(Configuration conf) throws Exception {
        }

        @Override
        public void serviceStart() throws Exception {
        // do nothing
        }

        @Override
        public void serviceStop() throws Exception {
        // do nothing
        }

        @Override
        public void handle(LocalizationEvent event) {
        // do nothing
        }
    };
    final ContainersLauncher launcher = new ContainersLauncher(context, null, null, null, null) {

        @Override
        public void handle(ContainersLauncherEvent event) {
        // do nothing
        }
    };
    return new ContainerManagerImpl(context, mock(ContainerExecutor.class), mock(DeletionService.class), mock(NodeStatusUpdater.class), metrics, null) {

        @Override
        protected LogHandler createLogHandler(Configuration conf, Context context, DeletionService deletionService) {
            return logHandler;
        }

        @Override
        protected ResourceLocalizationService createResourceLocalizationService(ContainerExecutor exec, DeletionService deletionContext, Context context) {
            return rsrcSrv;
        }

        @Override
        protected ContainersLauncher createContainersLauncher(Context context, ContainerExecutor exec) {
            return launcher;
        }

        @Override
        public void setBlockNewContainerRequests(boolean blockNewContainerRequests) {
        // do nothing
        }

        @Override
        public NMTimelinePublisher createNMTimelinePublisher(Context context) {
            return null;
        }
    };
}
Also used : LogHandler(org.apache.hadoop.yarn.server.nodemanager.containermanager.loghandler.LogHandler) FileContext(org.apache.hadoop.fs.FileContext) NMContext(org.apache.hadoop.yarn.server.nodemanager.NodeManager.NMContext) ContainerLaunchContext(org.apache.hadoop.yarn.api.records.ContainerLaunchContext) LogAggregationContext(org.apache.hadoop.yarn.api.records.LogAggregationContext) Context(org.apache.hadoop.yarn.server.nodemanager.Context) ContainerExecutor(org.apache.hadoop.yarn.server.nodemanager.ContainerExecutor) ResourceLocalizationService(org.apache.hadoop.yarn.server.nodemanager.containermanager.localizer.ResourceLocalizationService) ContainersLauncher(org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainersLauncher) Configuration(org.apache.hadoop.conf.Configuration) YarnConfiguration(org.apache.hadoop.yarn.conf.YarnConfiguration) DeletionService(org.apache.hadoop.yarn.server.nodemanager.DeletionService) NodeStatusUpdater(org.apache.hadoop.yarn.server.nodemanager.NodeStatusUpdater) LocalizationEvent(org.apache.hadoop.yarn.server.nodemanager.containermanager.localizer.event.LocalizationEvent) ContainersLauncherEvent(org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainersLauncherEvent)

Aggregations

LogHandler (org.apache.hadoop.yarn.server.nodemanager.containermanager.loghandler.LogHandler)2 Configuration (org.apache.hadoop.conf.Configuration)1 FileContext (org.apache.hadoop.fs.FileContext)1 ContainerLaunchContext (org.apache.hadoop.yarn.api.records.ContainerLaunchContext)1 LogAggregationContext (org.apache.hadoop.yarn.api.records.LogAggregationContext)1 YarnConfiguration (org.apache.hadoop.yarn.conf.YarnConfiguration)1 ContainerExecutor (org.apache.hadoop.yarn.server.nodemanager.ContainerExecutor)1 Context (org.apache.hadoop.yarn.server.nodemanager.Context)1 DeletionService (org.apache.hadoop.yarn.server.nodemanager.DeletionService)1 NMContext (org.apache.hadoop.yarn.server.nodemanager.NodeManager.NMContext)1 NodeStatusUpdater (org.apache.hadoop.yarn.server.nodemanager.NodeStatusUpdater)1 ContainersLauncher (org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainersLauncher)1 ContainersLauncherEvent (org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainersLauncherEvent)1 ResourceLocalizationService (org.apache.hadoop.yarn.server.nodemanager.containermanager.localizer.ResourceLocalizationService)1 LocalizationEvent (org.apache.hadoop.yarn.server.nodemanager.containermanager.localizer.event.LocalizationEvent)1 SharedCacheUploadService (org.apache.hadoop.yarn.server.nodemanager.containermanager.localizer.sharedcache.SharedCacheUploadService)1 NonAggregatingLogHandler (org.apache.hadoop.yarn.server.nodemanager.containermanager.loghandler.NonAggregatingLogHandler)1