@Override protected void serviceInit(Configuration conf) throws Exception { dispatcher.register(TaskManagerEvent.EventType.class, this); super.serviceInit(conf); }
@Override protected void serviceInit(Configuration conf) throws Exception { dispatcher.register(TaskManagerEvent.EventType.class, this); super.serviceInit(conf); }
/** * Register the handlers for alwaysOn services */ private Dispatcher setupDispatcher() { Dispatcher dispatcher = createDispatcher(); dispatcher.register(RMFatalEventType.class, new ResourceManager.RMFatalEventDispatcher()); return dispatcher; }
/** * Register the handlers for alwaysOn services */ private Dispatcher setupDispatcher() { Dispatcher dispatcher = createDispatcher(); dispatcher.register(RMFatalEventType.class, new ResourceManager.RMFatalEventDispatcher()); return dispatcher; }
private void createAndRegisterOpportunisticDispatcher( ApplicationMasterService service) { if (!isOpportunisticSchedulingEnabled(conf)) { return; } EventDispatcher oppContainerAllocEventDispatcher = new EventDispatcher( (OpportunisticContainerAllocatorAMService) service, OpportunisticContainerAllocatorAMService.class.getName()); // Add an event dispatcher for the // OpportunisticContainerAllocatorAMService to handle node // additions, updates and removals. Since the SchedulerEvent is currently // a super set of theses, we register interest for it. addService(oppContainerAllocEventDispatcher); rmDispatcher .register(SchedulerEventType.class, oppContainerAllocEventDispatcher); }
/** * Register the handlers for alwaysOn services */ private Dispatcher setupDispatcher() { Dispatcher dispatcher = createDispatcher(); dispatcher.register(RMFatalEventType.class, new ResourceManager.RMFatalEventDispatcher()); return dispatcher; }
@Override protected void serviceInit(Configuration conf) throws Exception { this.tajoConf = TUtil.checkTypeAndGet(conf, TajoConf.class); this.totalResource = createWorkerResource(tajoConf); this.availableResource = NodeResources.clone(totalResource); this.dispatcher.register(NodeResourceEvent.EventType.class, this); validateConf(tajoConf); this.enableTest = conf.get(TajoConstants.TEST_KEY, Boolean.FALSE.toString()) .equalsIgnoreCase(Boolean.TRUE.toString()); super.serviceInit(conf); LOG.info("Initialized NodeResourceManager for " + totalResource); }
@Override protected void serviceInit(Configuration conf) throws Exception { this.tajoConf = TUtil.checkTypeAndGet(conf, TajoConf.class); this.totalResource = createWorkerResource(tajoConf); this.availableResource = NodeResources.clone(totalResource); this.dispatcher.register(NodeResourceEvent.EventType.class, this); validateConf(tajoConf); this.enableTest = conf.get(TajoConstants.TEST_KEY, Boolean.FALSE.toString()) .equalsIgnoreCase(Boolean.TRUE.toString()); this.diskParallels = tajoConf.getIntVar(TajoConf.ConfVars.WORKER_RESOURCE_AVAILABLE_DISK_PARALLEL_NUM); super.serviceInit(conf); LOG.info("Initialized NodeResourceManager for " + totalResource); }
@Override protected void serviceInit(Configuration conf) throws Exception { super.serviceInit(conf); getDispatcher().register(SystemMetricsEventType.class, new TimelineV2EventHandler()); publishContainerEvents = getConfig().getBoolean( YarnConfiguration.RM_PUBLISH_CONTAINER_EVENTS_ENABLED, YarnConfiguration.DEFAULT_RM_PUBLISH_CONTAINER_EVENTS_ENABLED); }
/** Create and initialize (but don't start) a single job. * @param forcedState a state to force the job into or null for normal operation. * @param diagnostic a diagnostic message to include with the job. */ protected Job createJob(Configuration conf, JobStateInternal forcedState, String diagnostic) { // create single job Job newJob = new JobImpl(jobId, appAttemptID, conf, dispatcher.getEventHandler(), taskAttemptListener, jobTokenSecretManager, jobCredentials, clock, completedTasksFromPreviousRun, metrics, committer, newApiCommitter, currentUser.getUserName(), appSubmitTime, amInfos, context, forcedState, diagnostic); ((RunningAppContext) context).jobs.put(newJob.getID(), newJob); dispatcher.register(JobFinishEvent.Type.class, createJobFinishEventHandler()); return newJob; } // end createJob()
@Override protected void serviceInit(Configuration conf) throws Exception { dispatcher = createDispatcher(); dispatcher.register(NMTimelineEventType.class, new ForwardingEventHandler()); addIfService(dispatcher); this.nmLoginUGI = UserGroupInformation.isSecurityEnabled() ? UserGroupInformation.getLoginUser() : UserGroupInformation.getCurrentUser(); LOG.info("Initialized NMTimelinePublisher UGI to " + nmLoginUGI); String webAppURLWithoutScheme = WebAppUtils.getNMWebAppURLWithoutScheme(conf); if (webAppURLWithoutScheme.contains(":")) { httpPort = webAppURLWithoutScheme.split(":")[1]; } super.serviceInit(conf); }
@Override protected void serviceInit(Configuration conf) throws Exception { client = TimelineClient.createTimelineClient(); addIfService(client); super.serviceInit(conf); getDispatcher().register(SystemMetricsEventType.class, new TimelineV1EventHandler()); }
@Override protected void serviceStart() throws Exception { if (nodeLabelsEnabled) { initNodeLabelStore(getConfig()); } // init dispatcher only when service start, because recover will happen in // service init, we don't want to trigger any event handling at that time. initDispatcher(getConfig()); if (null != dispatcher) { dispatcher.register(NodeLabelsStoreEventType.class, new ForwardingEventHandler()); } startDispatcher(); }
@Override protected void serviceStart() throws Exception { if (nodeLabelsEnabled) { initNodeLabelStore(getConfig()); } // init dispatcher only when service start, because recover will happen in // service init, we don't want to trigger any event handling at that time. initDispatcher(getConfig()); if (null != dispatcher) { dispatcher.register(NodeLabelsStoreEventType.class, new ForwardingEventHandler()); } startDispatcher(); }
@Override protected void serviceStart() throws Exception { initNodeAttributeStore(getConfig()); // init dispatcher only when service start, because recover will happen in // service init, we don't want to trigger any event handling at that time. initDispatcher(getConfig()); if (null != dispatcher) { dispatcher.register(NodeAttributesStoreEventType.class, new ForwardingEventHandler()); } startDispatcher(); super.serviceStart(); }
@Override protected void serviceStart() throws Exception { if (nodeLabelsEnabled) { setInitNodeLabelStoreInProgress(true); initNodeLabelStore(getConfig()); setInitNodeLabelStoreInProgress(false); } // init dispatcher only when service start, because recover will happen in // service init, we don't want to trigger any event handling at that time. initDispatcher(getConfig()); if (null != dispatcher) { dispatcher.register(NodeLabelsStoreEventType.class, new ForwardingEventHandler()); } startDispatcher(); }
@Override public void serviceInit(Configuration conf) throws Exception { this.systemConf = TUtil.checkTypeAndGet(conf, TajoConf.class); this.rpcParams = RpcParameterFactory.get(this.systemConf); this.heartBeatRequestQueue = Queues.newLinkedBlockingQueue(); this.serviceTracker = ServiceTrackerFactory.get(systemConf); this.workerContext.getNodeResourceManager().getDispatcher().register(NodeStatusEvent.EventType.class, this); this.heartBeatInterval = systemConf.getIntVar(TajoConf.ConfVars.WORKER_HEARTBEAT_IDLE_INTERVAL); this.updaterThread = new StatusUpdaterThread(); this.updaterThread.setName("NodeStatusUpdater"); super.serviceInit(conf); }
protected void setupDispatcher(RMContext rmContext, Configuration conf) { TestDispatcher testDispatcher = new TestDispatcher(); TestAppManagerDispatcher testAppManagerDispatcher = new TestAppManagerDispatcher(); rmContext.getDispatcher().register(RMAppEventType.class, testDispatcher); rmContext.getDispatcher().register(RMAppManagerEventType.class, testAppManagerDispatcher); ((Service)rmContext.getDispatcher()).init(conf); ((Service)rmContext.getDispatcher()).start(); Assert.assertEquals("app event type is wrong before", RMAppEventType.KILL, appEventType); }
protected void setupDispatcher(RMContext rmContext, Configuration conf) { TestDispatcher testDispatcher = new TestDispatcher(); TestAppManagerDispatcher testAppManagerDispatcher = new TestAppManagerDispatcher(); rmContext.getDispatcher().register(RMAppEventType.class, testDispatcher); rmContext.getDispatcher().register(RMAppManagerEventType.class, testAppManagerDispatcher); ((Service)rmContext.getDispatcher()).init(conf); ((Service)rmContext.getDispatcher()).start(); Assert.assertEquals("app event type is wrong before", RMAppEventType.KILL, appEventType); }
@Override public void serviceInit(Configuration conf) throws Exception { this.systemConf = TUtil.checkTypeAndGet(conf, TajoConf.class); this.rpcParams = RpcParameterFactory.get(this.systemConf); this.heartBeatRequestQueue = Queues.newLinkedBlockingQueue(); this.serviceTracker = ServiceTrackerFactory.get(systemConf); this.workerContext.getNodeResourceManager().getDispatcher().register(NodeStatusEvent.EventType.class, this); this.heartBeatInterval = systemConf.getIntVar(TajoConf.ConfVars.WORKER_HEARTBEAT_IDLE_INTERVAL); this.updaterThread = new StatusUpdaterThread(); this.updaterThread.setName("NodeStatusUpdater"); super.serviceInit(conf); }