@SuppressWarnings("rawtypes") protected EventHandler getRMStateStoreEventHandler() { return dispatcher.getEventHandler(); } }
public synchronized EventHandler getEventHandler() { if(eventHandler == null) { eventHandler = dispatcher.getEventHandler(); } return eventHandler; }
public synchronized EventHandler getEventHandler() { if(eventHandler == null) { eventHandler = dispatcher.getEventHandler(); } return eventHandler; }
@Override public void handle(Event event) { // Use hashCode (of ApplicationId) to dispatch the event to the child // dispatcher, such that all the writing events of one application will // be handled by one thread, the scheduled order of the these events // will be preserved int index = (event.hashCode() & Integer.MAX_VALUE) % dispatchers.size(); dispatchers.get(index).getEventHandler().handle(event); }
@Override public void handle(Event event) { // Use hashCode (of ApplicationId) to dispatch the event to the child // dispatcher, such that all the writing events of one application will // be handled by one thread, the scheduled order of the these events // will be preserved int index = (event.hashCode() & Integer.MAX_VALUE) % dispatchers.size(); dispatchers.get(index).getEventHandler().handle(event); } }
@Override public void handle(Event event) { // Use hashCode (of ApplicationId) to dispatch the event to the child // dispatcher, such that all the writing events of one application will // be handled by one thread, the scheduled order of the these events // will be preserved int index = (event.hashCode() & Integer.MAX_VALUE) % dispatchers.size(); dispatchers.get(index).getEventHandler().handle(event); }
@Override public void handle(Event event) { // Use hashCode (of ApplicationId) to dispatch the event to the child // dispatcher, such that all the writing events of one application will // be handled by one thread, the scheduled order of the these events // will be preserved int index = (event.hashCode() & Integer.MAX_VALUE) % dispatchers.size(); dispatchers.get(index).getEventHandler().handle(event); }
@Override public void handle(Event event) { // Use hashCode (of ApplicationId) to dispatch the event to the child // dispatcher, such that all the writing events of one application will // be handled by one thread, the scheduled order of the these events // will be preserved int index = (event.hashCode() & Integer.MAX_VALUE) % dispatchers.size(); dispatchers.get(index).getEventHandler().handle(event); }
@Override public void handle(Event event) { // Use hashCode (of ApplicationId) to dispatch the event to the child // dispatcher, such that all the writing events of one application will // be handled by one thread, the scheduled order of the these events // will be preserved int index = (event.hashCode() & Integer.MAX_VALUE) % dispatchers.size(); dispatchers.get(index).getEventHandler().handle(event); }
@Override public EventHandler<Event> getEventHandler() { return dispatcher.getEventHandler(); }
@Override public void handle(Event event) { dispatcher.getEventHandler().handle(event); }
@Override public void handle(Event event) { dispatcher.getEventHandler().handle(event); }
@SuppressWarnings("unchecked") public void updateApplicationAttemptState( ApplicationAttemptStateData attemptState) { dispatcher.getEventHandler().handle( new RMStateUpdateAppAttemptEvent(attemptState)); }
@SuppressWarnings("unchecked") public void updateApplicationAttemptState( ApplicationAttemptStateData attemptState) { dispatcher.getEventHandler().handle( new RMStateUpdateAppAttemptEvent(attemptState)); }
@SuppressWarnings("unchecked") public void updateApplicationState( ApplicationStateData appState) { dispatcher.getEventHandler().handle(new RMStateUpdateAppEvent(appState)); }
@SuppressWarnings("unchecked") public void updateApplicationState( ApplicationStateData appState) { dispatcher.getEventHandler().handle(new RMStateUpdateAppEvent(appState)); }
@Override public void handleCredentialUpdate() { Set<ApplicationId> invalidApps = logHandler.getInvalidTokenApps(); if (!invalidApps.isEmpty()) { dispatcher.getEventHandler().handle(new LogHandlerTokenUpdatedEvent()); } } }
void addAttempt() { TaskAttempt taskAttempt = new MyTaskAttemptImpl(taskID, attempts.size(), clock); TaskAttemptId taskAttemptID = taskAttempt.getID(); attempts.put(taskAttemptID, taskAttempt); System.out.println("TLTRE.MyTaskImpl.addAttempt " + getID()); SpeculatorEvent event = new SpeculatorEvent(taskID, +1); dispatcher.getEventHandler().handle(event); }
void startUp() { startMockTime = clock.getTime(); overridingState = null; slotsInUse.addAndGet(taskTypeSlots(myAttemptID.getTaskId().getTaskType())); System.out.println("TLTRE.MyTaskAttemptImpl.startUp starting " + getID()); SpeculatorEvent event = new SpeculatorEvent(getID().getTaskId(), -1); dispatcher.getEventHandler().handle(event); }
@Test(timeout = 20000) public void testFlushResourceReport() throws Exception { CountDownLatch barrier = new CountDownLatch(2); statusUpdater = new MockNodeStatusUpdater(barrier, workerContext); statusUpdater.init(conf); statusUpdater.start(); assertEquals(0, statusUpdater.getQueueSize()); dispatcher.getEventHandler().handle(new NodeStatusEvent(NodeStatusEvent.EventType.FLUSH_REPORTS)); barrier.await(); assertEquals(0, statusUpdater.getQueueSize()); } }